asp.net indentity 잘 작동합니다. 사용자가 로그인 그러나 때 다음과 같은 정보를 제공 할 수있는 상태인지, 구글이 사용자에게 요청 :ASP.Net ID 공급자가 너무 많은 정보 요청
을 - 귀하의 이메일 주소를 볼
- 계정
문제에 대한 기본 정보보기는 그 I 돈 그 정보를 원한다. 나는 사용자를 식별 할 수있는 독특한 방법을 원한다. 나는 사용자가 나는 그들이 로그인 할 때 그들을 스팸거야 생각하지 않으 Startup.Auth.cs에서
나는 매우 바닐라 구글 설정을 사용합니다.
app.UseGoogleAuthentication();
편집 : 솔루션
을브록 (Brock)의 대답으로 올바른 해결책을 찾았습니다. 중요한 것은 "openid"를 범위에 추가하는 것이 었습니다.
var googleOAuth2AuthenticationOptions = new GoogleOAuth2AuthenticationOptions
{
ClientId = "XXXX",
ClientSecret = "YYYY",
CallbackPath = new PathString("/Account/LoginCallback/"),
};
googleOAuth2AuthenticationOptions.Scope.Add("openid"); //!Important
app.UseGoogleAuthentication(googleOAuth2AuthenticationOptions);
이것은 http://www.symbolsource.org/Public/Metadata/NuGet/Project/Microsoft.Owin.Security.Google/2.1.0-rc1/Release/.NETFramework,Version%3Dv4.5/에서 작동합니다. Microsoft.Owin.Security.Google/Microsoft.Owin.Security.Google/GoogleOAuth2AuthenticationHandler.cs?ImageName=Microsoft.Owin.Security.Google 기본 범위는 입니다. scope = "openid profile email"; –
좋아요, googleOAuth2AuthenticationOptions.Scope.Add ("openid")가 작동합니다. 이메일 권한 만 원하는 경우. 사용 ("openid 이메일") –