C# Azure AD回调不会验证ExternalAsync方法
我正在使用C# Azure AD回调不会验证ExternalAsync方法,c#,google-signin,identityserver3,openid-connect,azure-active-directory,C#,Google Signin,Identityserver3,Openid Connect,Azure Active Directory,我正在使用OpenID Connect连接到Azure ID,我可以在Azure中成功进行身份验证,并将请求返回到OpenID Azure AD配置中指定的重定向uri app.UseOpenIdConnectAuthentication( 新的OpenIdConnectAuthenticationOptions { AuthenticationType=“测试”, Caption=“测试Azure广告”, SignInAsAuthenticationType=signInAsType, Cl
OpenID Connect
连接到Azure ID,我可以在Azure中成功进行身份验证,并将请求返回到OpenID Azure AD配置中指定的重定向uri
app.UseOpenIdConnectAuthentication(
新的OpenIdConnectAuthenticationOptions
{
AuthenticationType=“测试”,
Caption=“测试Azure广告”,
SignInAsAuthenticationType=signInAsType,
ClientId=“”,
权威=”https://sts.windows.net/",
ResponseType=OpenIDConnectResponseType.CodeIdToken,
重定向URI=”https://localhost:44392/External/Login,这是另一个webapi项目,而不是identityserver主机。
AuthenticationMode=AuthenticationMode.Passive,
});
成功验证后,它将重定向回https://localhost:44392/External/Login
带有代码,IdToken
问题:
AuthenticateExternalAsync
方法,而不像google signin
IdToken
JWT才能获得用户声明访问令牌
,以授权其他webapiIDsrv3
一起工作IdSrv3
示例?最好是Azure广告我刚刚经历了这个过程,所以我会尽力回答,以帮助您/其他人。如果我误解了你的问题,请原谅
AuthenticateExternalAsync
中,您可以获得ExternalAuthenticationContext.ExternalIdentity
,其中包含声明-无需解码JWT令牌AuthenticateExternalAsync
中返回成功的AuthenticatedResult
后,IDS将处理此问题,类似于context.AuthenticateResult=new AuthenticateResult(“UserId”、name、claims”)代码>