Tru*_*Xax 3 asp.net-core identityserver4
我正在尝试使用 client_credentials 从我的 Identity Server 4 获取访问令牌,我想我几乎用我的搜索完成了 Google 页面,但我什么也没找到。所以,请:
这是我的 GetClients 方法
[![请在此输入图像说明] [1] [1]我的邮递员请求,在头我只有Content_Type这application/x-www-form-urlencoded

和错误:
您从正确的代码行开始:"secret".Sha256()但后来忘记了。
请尝试以下操作:
var secret = new Secret {Value = "test".Sha512()};
ClientSecrets = new[] {secret};
Run Code Online (Sandbox Code Playgroud)
秘密必须被散列。
简要测试
curl https://localhost:5001/connect/token -d "grant_type=client_credentials&client_id=azure-client-id&client_secret=test"
和
curl https://localhost:5001/connect/token -H "授权:基本 YXp1cmUtY2xpZW50LWlkOnRlc3Q=" -d "grant_type=client_credentials"
| 归档时间: |
|
| 查看次数: |
4401 次 |
| 最近记录: |