redirect URI for authclient Google and Linkedin

I’ve successfully integrated Facebook, Github, and Twitter using Yii2 authclient. They are returning data as expected. When I try integrating Google and Linkedin, they both return an error saying the redirect_uri does not match one that is registered.

In the case of google, it appears to be looking for the following format :





http://www.mydomain.com/index.php?r=site/auth&authclient=google






However in the error message it adds encoding:





The redirect URI in the request: http://mydomain.com/index.php?r=site%2Fauth&authclient=google did not match a registered redirect URI



Not sure if that has anything to do with the problem.

Anyway, I tried that url and it doesn’t work, spits out the same message. I also tried the plain:

http://www.mydomain.com

But no matter what I put in there, it returns the same error message.

In the case of linkedin, it says the redirect URI does match one that is registered, but provides no other hint.

With Facebook, I listed an app domain:

mydomain.com

It works perfectly.

For Github and Twitter, I listed the callback url:

http://www.mydomain.com

Works perfectly.

I’m assuming the redirect URI is the same thing? Anyway, if anyone has an idea what the redirect URI should be, please let me know, thanks.

Also, just a bit of info. Twitter does not currently return the email address of the user, but according to their blog, it will be released within days. Unfortunately, they made that claim about a month ago.

[color="#FFFFFF"][font="sans-serif"][size="2"]e API Key.[/size][/font][/color]

Ok, partially solved. I switched to pretty URLs and Google recognizes the redirect URI. Now I’m getting a different error:

[color="#E51717"][font="inherit"][size="2"]Exception[/size][/font][/color] – yii\authclient\InvalidResponseException

[b]Request failed with code: 401, message: {

"error" : "invalid_client"

}[/b]

This seems like bug because I copied the config right out of the guide:







 'google' => [

                'class' => 'yii\authclient\clients\GoogleOAuth',

                'clientId' => 'my_id',

                'clientSecret' => 'my_secret',

            ],




Obviously I have plugged in the appropriate values for my_id and my_secret.

Full Gist for error message.

Also, the pretty urls did not solve the redirect_uri issue for linked in. If I get no response or help here, I will post it as an issue on Github.

At the end could you fix it ? I think I am having a similar issue.