-
Notifications
You must be signed in to change notification settings - Fork 20
Description
We've been using NinjAuth alongside local auth successfully for a few weeks and it's worked correctly for FB, Twitter, Google. We just noticed that if an unauthenticated user starts the oauth dialog (i.e. clicks Facebook button) but clicks Cancel on the Facebook auth landing page, Facebook redirects back to our callback URL. That's correct behavior, but NinjAuth errors out in a big way because it's expecting a 'code' parameter (presumably from a successful auth). In other words, NinjAuth apparently doesn't handle the case where the user starts to auth and then cancels. We're running the most recent releases of ninjauth and oauth2 to date. This same problem occurs when attempting to auth Google.
Error page gives these details:
OAuth2\Exception [ Error ]: Required option not passed: access_token Array ( )
PKGPATH/oauth2/classes/token/access.php @ line 50
Backtrace:
PKGPATH/oauth2/classes/token.php @ line 28
PKGPATH/oauth2/classes/provider.php @ line 249
PKGPATH/ninjauth/classes/strategy/oauth2.php @ line 31
PKGPATH/ninjauth/classes/strategy.php @ line 86
PKGPATH/ninjauth/classes/controller.php @ line 46
COREPATH/classes/request.php @ line 442
DOCROOT/index.php @ line 43
Prior Nonfatal Errors:
Warning: file_get_contents(https://graph.facebook.com/oauth/access_token?client_id=347451178647181&client_secret=[snip]&grant_type=authorization_code&redirect_uri=http%3A%2F%[snip]%2Fauth%2Fcallback%2Ffacebook): failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request in PKGPATH/oauth2/classes/provider.php @ line 187