用于外部提供商的IdentityServer连接/令牌

时间:2019-05-24 14:52:15

标签: identityserver4

我有一个想法,可以使用IdentityServer4并将其配置为使用外部提供程序或它自己的用户数据库。例如,如果通过.json文件配置了Azure AD,请使用它。如果没有可用的Azure AD,请使用自己的用户数据库。管理员可以根据某些设置条件来更改配置文件。

但是我不明白如何从IdentityServer .well-known/openid-configuration内容中获取外部提供者信息

我已经启动了IdentityServer4.Samples \ Quickstarts \ 4_ImplicitFlowAuthenticationWithExternal \ src \ IdentityServer,并且似乎在访问http://localhost:5000/.well-known/openid-configuration时没有外部提供程序信息。

但是http://localhost:5000/Account/Login显示login password文本框和OpenID connect按钮。

Here is gist和示例源代码。这是openidconnect配置:

.AddOpenIdConnect("oidc", "OpenID Connect", options =>
{
    options.SignInScheme = IdentityServerConstants.ExternalCookieAuthenticationScheme;
    options.SignOutScheme = IdentityServerConstants.SignoutScheme;
    options.SaveTokens = true;

    options.Authority = "https://demo.identityserver.io/";
    options.ClientId = "implicit";

    options.TokenValidationParameters = new TokenValidationParameters
    {
        NameClaimType = "name",
        RoleClaimType = "role"
    };
});

启动IdentityServer后,我可以使用登录名和密码文本框和http://localhost:5000/Account/Login按钮浏览OpenId Connect页面。此按钮链接到http://localhost:5000/External/Challenge?provider=oidc网址。

因此,每个用户都可以看到此外部提供程序按钮并用于登录。 但是服务(或创建客户端的开发人员)又如何将我的服务用作数据源呢?

是否可以将IdentityServer4配置为在发现页面输出中显示外部提供程序?

是否可以将IdentityServer4设置为外部身份提供商的透明代理?要使http://localhost:5000/connect/token调用外部提供程序(如果已设置)还是使用本地用户数据库?

0 个答案:

没有答案
相关问题