【发布时间】:2020-06-22 14:02:41
【问题描述】:
我在尝试获取自定义范围值的令牌时出错。下面是我的代码 sn-p。
public static IEnumerable<ApiResource> GetApis() =>
new List<ApiResource>
{
new ApiResource("ApiOne","ApiOne",new []{ "ApiOne"})
};
public static IEnumerable<Client> GetClients() =>
new List<Client> { new Client
{
ClientId="client1",
ClientSecrets={ new Secret("secret1".Sha256())},
AllowedGrantTypes={GrantType.ClientCredentials},
AllowedScopes={"ApiOne"},
AllowOfflineAccess=true,
},
};
【问题讨论】:
-
您的客户端配置是什么?
-
你在定义 API 的范围吗?
标签: c# asp.net-core identityserver4