我正在请求针对我们在之前项目中使用的身份服务器应用程序的令牌,用于当前项目。在我的本地机器上,所以localhost级别。
令牌请求有效:
IdentityServer3.Core.ResponseHandling.TokenResponseGeneratorCreating token response
IdentityServer3.Core.ResponseHandling.TokenResponseGeneratorProcessing token request
Identity.Api.Monitoring.IdentityEventServiceInformation - 2020 - Refresh token issued - - IdentityServer3.Core.Events.RefreshTokenDetails
Identity.Api.Monitoring.IdentityEventServiceInformation - 2000 - Access token issued - - IdentityServer3.Core.Events.AccessTokenIssuedDetails
Identity.Api.Monitoring.IdentityEventServiceSuccess - 3000 - Endpoint success - - IdentityServer3.Core.Events.EndpointDetail
IdentityServer3.Core.Endpoints.TokenEndpointControllerEnd token request
IdentityServer3.Core.Results.TokenResultReturning token response.
我收到了这个回复:
{
"access_token": "myaccesstoken",
"expires_in": 86400,
"token_type": "Bearer",
"refresh_token": "myrefreshtoken"
}
现在,如果我在我的请求中使用该令牌,我会得到一个401 unauthorized
响应:
从表面上来看,我希望这个调用可以正常工作,因为我传递了一个正确的令牌。那么,我该怎么做才能弄清楚它为什么不起作用?
授权标头应该有Bearer而不是BASIC
Authorization: Bearer SomeTokenHere