我尝试将我的Identityserver4配置为使用ADFS4.0作为外部提供程序。我将其配置如下:
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationScheme = IdentityServerConstants.ExternalCookieAuthenticationScheme
});
app.UseOpenIdConnectAuthentication(new OpenIdConnectOptions
{
ClientId = "60b3d106-d155-4f9f-ba75-84b8078829fa",
AuthenticationScheme = "oidc",
PostLogoutRedirectUri = "http://localhost:5000",
DisplayName = "ADFS TEST Domain",
MetadataAddress = "https://srv2016dc01.test.local/adfs/.well-known/openid-configuration",
SaveTokens = true,
GetClaimsFromUserInfoEndpoint = true
});看起来很管用,因为我可以登录并获得一些索赔:Claims get back from ADFS
但是看起来Userinfo终结点不会被调用...否则,应该会有更多的声明,并且我在ADFS服务器的DEbug日志中看不到对Userinfo端点的调用。
我还尝试在代码中调用Userinfo端点,如以下链接所示:ASP.NET Identity (with IdentityServer4) get external resource oauth access token
但是在"await _signInManager.UpdateExternalAuthenticationTokensAsync(info);“I‘t get a access_token back,only a id_token...”中,“await_signInManager.UpdateExternalAuthenticationTokensAsync(info);”I’t get a access_token back,only an id_token...
有没有人有一个使用ADFS4.0或至少使用其他外部OpenIdConnect服务器的Identityserver4的工作示例?
有没有其他方法可以从Userinfo Endpoint获取所有信息?
我需要从经过身份验证的用户获取组成员身份作为角色声明,以授予对WebApi资源的权限。
发布于 2017-02-13 18:57:22
如果我在选项中将"token id_token“设置为ResponseType值,我将获得令牌!ResponseType =“代码id_token”
如果access_token可用,将调用UserInfo终结点。
但是现在我将从Userinfo终结点得到一个401错误。不管怎样..。此问题可通过添加
ResponseType = "code id_token"到OpenIdConnectOptions
https://stackoverflow.com/questions/42155823
复制相似问题