[英]How to login with Yii2 through twitter account
I am following the yii2-user guide, and I succeed to login through a facebook account. 我正在关注yii2用户指南,我成功通过Facebook帐户登录。 Now i want to login through a twitter account and my
现在我想通过推特账号和我的账户登录
'consumerKey' => 'h5XFtvRVSxxxxxxxxxxxxx',
'consumerSecret' => 'Zb6lCescDoatl1thwGxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
but when I try to login through twitter I get the following error: 但是当我尝试通过Twitter登录时,我收到以下错误:
Request failed with code: 401, message:
<?xml version="1.0" encoding="UTF-8"?>
<hash>
<error>Desktop applications only support the oauth_callback value 'oob'</error>
<request>/oauth/request_token</request>
</hash>
</xml>
I searched for this error but did not found a suitable solution. 我搜索了这个错误,但没有找到合适的解决方案。 This is my login page:
这是我的登录页面:
现在我对自己的问题有一个答案。我通过在创建api密钥时定义回调URL解决了这个问题,我将Callback URL作为可选,因为我得到了错误。但是在定义了正确的回调URL后,它对我来说工作正常。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.