php - OAuthException: redirect_uri isn't an absolute URI. Check RFC 3986 (Symfony) -


i add facebook login option website, following this tutorial. did in tutorial, still error:

oauthexception: redirect_uri isn't absolute uri 

how possible solve it?

this urls generated facebookoauthprovider. website not on localhost. runs on webserver, https.

this relevant code:

    // redirect facebook     $facebookoauthprovider = $this->get('app.facebook_provider');     $url = $facebookoauthprovider->getauthorizationurl([         // these default scopes         'scopes' => ['public_profile', 'email'],     ]);      return $this->redirect($url); 

it redirects url:

https://www.facebook.com/v2.3/dialog/oauth?scopes[0]=public_profile&scopes[1]=email&state=...&scope=public_profile,email&response_type=code&approval_prompt=auto&redirect_uri=/connect/facebook-check&client_id=... 

the redirect_uri indeed not absolute url. how possible fix it?


edit

if add 'redirect_uri' => [$redir] url looks this:

https://www.facebook.com/v2.3/dialog/oauth?scopes%5b0%5d=public_profile&scopes%5b1%5d=email&scopes%5b2%5d=user_location&redirect_uri%5b0%5d=https%3a%2f%2fexample.com%2fconnect%2ffacebook-check&state=...&scope=public_profile%2cemail&response_type=code&approval_prompt=auto&client_id=... 

i can see absolute redirect_uri in generated url, still error, if navigate

redir defined as:

$redir = $this->generateurl('connect_facebook_check', array(), urlgeneratorinterface::absolute_url); 

edit2

if replace [$redir] $redir facebook redirects me correctly /connect/facebook-check code, oauthexception: redirect_uri isn't absolute uri. check rfc 3986 there.


Comments

Popular posts from this blog

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

html - How to custom Bootstrap grid height? -

transpose - Maple isnt executing function but prints function term -