Identity Server not returning refresh token

前端 未结 2 638
故里飘歌
故里飘歌 2021-01-04 04:39

I\'m trying to set up Thinktecture\'s Identity Server 3, but I can\'t seem to get it to return a refresh token when exchanging an authorization code (or when using the Resou

2条回答
  •  渐次进展
    2021-01-04 05:03

    Add offline_access value in scope while sending token request

    new Client
                {
                    ClientId = "ro.angular",
                    AllowedGrantTypes = GrantTypes.ResourceOwnerPassword,
    
                    ClientSecrets =
                    {
                        new Secret("secret".Sha256())
                    },
                    AllowedScopes = {
                        IdentityServerConstants.StandardScopes.OpenId,
                        IdentityServerConstants.StandardScopes.Profile,
                        IdentityServerConstants.StandardScopes.Email,
                        IdentityServerConstants.StandardScopes.Address,
                        "api1",
                        IdentityServerConstants.StandardScopes.OfflineAccess
                    },
                    AllowOfflineAccess = true,
                    RefreshTokenUsage = TokenUsage.ReUse,
                    RefreshTokenExpiration = TokenExpiration.Sliding
    
                }
    

提交回复
热议问题