概述
2019独角兽企业重金招聘Python工程师标准>>>
在使用token的出现错误
{
"name": "Unauthorized",
"message": "Your request was made with invalid credentials.",
"code": 0,
"status": 401,
"type": "yii\web\UnauthorizedHttpException"
}
很可能是由于apache服务器上需要配置.htaccess文件,要加上一行:
SetEnvIf Authorization “(.*)” HTTP_AUTHORIZATION=$1
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
转载于:https://my.oschina.net/u/3648322/blog/1920998
最后
以上就是可靠小蚂蚁为你收集整理的Yii的api无法认证Authorization的错误的全部内容,希望文章能够帮你解决Yii的api无法认证Authorization的错误所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复