小编aar*_*onR的帖子

IdentityServer4的有效grant_type值与使用混合授权类型的客户端有什么关系?

我正在使用IdentityServer4软件包的1.0.0版本.

"IdentityServer4": "1.0.0"
Run Code Online (Sandbox Code Playgroud)

我创建了一个客户端

new Client
{
    ClientId = "MobleAPP",
    ClientName = "Moble App",
    ClientUri= "http://localhost:52997/api/",                    
    AllowedGrantTypes = GrantTypes.HybridAndClientCredentials,

    ClientSecrets =
    {
        new Secret("SecretForMobleAPP".Sha256())
    },

    AllowedScopes =
    {
        IdentityServerConstants.StandardScopes.OpenId,
        IdentityServerConstants.StandardScopes.Profile,
        "api"
    },
    AllowOfflineAccess = true
}
Run Code Online (Sandbox Code Playgroud)

和范围/ ApiResources

public static IEnumerable<ApiResource> GetApiResources()
{
   return new List<ApiResource>
   {

      new ApiResource("api", "My API")

    };
}
Run Code Online (Sandbox Code Playgroud)

使用以下用户/ TestUser

public static List<TestUser> GetUsers()
{
        return new List<TestUser>
        {

            new TestUser
            {
                SubjectId = "2",
                Username = "bob",
                Password = "password",

                Claims = new [] …
Run Code Online (Sandbox Code Playgroud)

postman identityserver4

4
推荐指数
1
解决办法
6669
查看次数

标签 统计

identityserver4 ×1

postman ×1