简体   繁体   中英

Identity Server 4 - Unable to authenticate user

I have the following client:

 new Client
 {
    RequirePkce = false,
    AllowAccessTokensViaBrowser = true,
    ClientId = "client_id_mobile",
    ClientSecrets =
    {
      new Secret("client_secret_mobile".Sha256())
    },
    AllowedGrantTypes = GrantTypes.ResourceOwnerPassword,
    AllowedScopes =
    {
      IdentityServerConstants.StandardScopes.OpenId,                    
    },
    RedirectUris = new []
    {
      "https://www.getpostman.com/oauth2/callback"
    },
  }

I'm trying to authenticate a user by doing the following within postman:

在此处输入图像描述

But as you can see I get unsupported_grant_type , I've tried changing the grant type to code I then get unauthorized_client

Can anyone point out what I'm doing wrong here?

For new development, you should only consider using the authorization code flow or the client credentials flow. All other flows is deprecated as of OAuth2.1.

If you want to login using a username/password and there is no user involved, then use the client credentials flow instead.

As per OAuth2.1 specification, PKCE should be supported in Authorization code grant but many servers support Authorization grant as per OAuth2.0. You can try any 1 of them.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM