我配置了一个扩展名为User
的基类Account
的模型,并配置了身份验证思想AccessToken
。现在,我想发出PUT
请求,使用生成的access_token更改帐户详细信息,但API会不断拒绝授权错误的请求。
PUT http://0.0.0.0.0:3000/api/Accounts/14
X-Access-Token: *thetoken*
{
"about": "it's me here"
}
{
"error": {
"statusCode": 401,
"name": "Error",
"message": "Authorization Required",
"code": "AUTHORIZATION_REQUIRED"
}
}
但帐户模型的ACL允许令牌所有者进行更改
"acls": [
{
"accessType": "READ",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "ALLOW"
},
{
"accessType": "EXECUTE",
"principalType": "USER",
"principalId": "$owner",
"permission": "ALLOW"
},
{
"accessType": "WRITE",
"principalType": "USER",
"principalId": "$owner",
"permission": "ALLOW"
}
]
我不知道问题出在哪里。