Hello,
I am using OAuth 2.0 authentication for authClientCollection.
When I use localhost: 8080 in console.developers.google.com works perfectly. but when http://www.projetobeauty.com.br use returns "Error: redirect_uri_mismatch".
// web.php
'authClientCollection' => [
'class' => 'yii\authclient\Collection',
'clients' => [
'google' => [
'class' => 'yii\authclient\clients\GoogleOAuth',
'clientId' => 'xxxxxxxxx',
'clientSecret' => 'xxxxxxxx',
'version'=> '2.0',
]
],
],
// institucional
public function actions()
{
return [
'auth' => [
'class' => 'yii\authclient\AuthAction',
'successCallback' => [$this, 'successCallback'],
],
];
}
/**
* Quando a autenticação for bem succedida
* @param type $cliente
*/
public function successCallback($authclient){
print_r($authclient->getUserAttributes());
}
in my console :
-
Origins authorized JavaScript = http://www.projetobeauty.com.br
-
Authorized redirect URIs = http://www.projetobeauty.com.br/yii/web/institucional/login