API 在 header 中使用正确的访问令牌调用给我一个 401 unauthorized
API call with correct access token in header gives me a 401 unauthorized
我正在为当前项目请求针对身份服务器应用程序的令牌,我们在之前的项目中使用了该令牌。在我的本地机器上,所以是本地主机级别。
令牌请求有效:
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
响应:
At face value I'd expect this call to work, as I'm passing a correct
token. So, what can I do to figure out why it doesn't work?
授权 header 应该有 Bearer 而不是 BASIC
Authorization: Bearer SomeTokenHere
我正在为当前项目请求针对身份服务器应用程序的令牌,我们在之前的项目中使用了该令牌。在我的本地机器上,所以是本地主机级别。
令牌请求有效:
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
响应:
At face value I'd expect this call to work, as I'm passing a correct token. So, what can I do to figure out why it doesn't work?
授权 header 应该有 Bearer 而不是 BASIC
Authorization: Bearer SomeTokenHere