Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net core 用户名密码通过外部身份服务器登录_Asp.net Core_Asp.net Core Identity - Fatal编程技术网

Asp.net core 用户名密码通过外部身份服务器登录

Asp.net core 用户名密码通过外部身份服务器登录,asp.net-core,asp.net-core-identity,Asp.net Core,Asp.net Core Identity,如何使用外部OAuth2服务器获取带有本地用户名/密码质询的令牌 当我添加OAuth方案时,它显示为一个按钮,但我希望它使用用户名/密码登录并向identity server请求令牌 services.AddAuthentication().AddOAuth("sso", "Single Sign-On", options => { options.ClientSecret = "so

如何使用外部OAuth2服务器获取带有本地用户名/密码质询的令牌

当我添加OAuth方案时,它显示为一个按钮,但我希望它使用用户名/密码登录并向identity server请求令牌

services.AddAuthentication().AddOAuth("sso", "Single Sign-On", options =>
            {
                options.ClientSecret = "somesecret";
                options.ClientId = "someid";
                options.ClaimsIssuer = "https://identity.somewhere.net";
                options.CallbackPath = "/api/authentication/ExternalLoginBack";
                options.AuthorizationEndpoint = "https://identity.somewhere.net/authorize";
                options.TokenEndpoint = "https://identity.somewhere.net/oauth2/token";
                
            });
这会导致显示一个按钮,上面写着“单点登录”。我不想要按钮,我想要登录按钮通过用户名/密码挑战

绿色很好。红色坏了


我试图了解您的设置,但我有点不清楚,所以我勾画了您的目标:

 0. User accesses webpage
        |
 _______V_______                          ________________
|               |  1. Redirect for authn |                |
|  Application  | ---------------------> |  Old Identity  |
|   / website   |                        |     server     |
|     server    | <--------------------- |                |
|_______________|  4. Redirect user back |________________|
                      with a token           Λ       |
  5. Use token                               |       |
     to start                                |       |
     a session        3. Entered credentials |       | 2. Prompt user for
                         sent to the server  |       |    credentials
                         and verified        |       |
                                          ___|_______V____
                                         |                |
                                         |   User login   |
                                         |      page      |
                                         |________________|
0。用户访问网页
|
_______V_uuuuuuuuuuuuuuuuuuuu________________
|               |  1. 为authn|重定向|
|应用程序|----------------->旧标识|
|/website | |服务器|

|服务器|也许我误解了您的问题,但我认为您误解了身份验证如何与外部OAuth2(OpenID)方一起工作。如果希望外部方执行身份验证,则不应处理用户的凭据,而应简单地将用户转发到其他地方登录,并将有效令牌返回给您。这就是“单一登录”按钮应该做的。@Xerilio是的。我正在尝试为此创建一个登录名。只是一个简单的登录页面,它不在identity server上,因为identity server是一个旧的ASP.Net identity server,我们无法升级,所以我们只想将其视为远程服务器的哑登录界面。Hmm。我原以为登录页面就是上面的那个页面,但这确实更有意义。我希望将身份服务器反向传输。所以是的。我确实想为identity server提供登录名。。。。但是在远程服务器上。