ng-token-auth icon indicating copy to clipboard operation
ng-token-auth copied to clipboard

Support authenticate with facebook access token

Open Charlie-Hua opened this issue 8 years ago • 0 comments

what's done

$auth.authenticateAccessToken is added to authenticate with access-token obtained by client-side SDK such as $cordovaFacebook.

how

It takes advantage of /auth/:provider/callback path to send access token directly to devise_token_auth/omniauth_callbacks#omniauth_success on the server, which gets authenticated by the OmniAuth::Strategies:FacebookAccessToken middleware. If the access token is valid, the server responds with user data which will be passed to handlePostMessage so it behaves just like $auth.authenticate

dependencies

lynndylanhurley/devise_token_auth#793 omniauth-facebook-access-token gem

Charlie-Hua avatar Dec 16 '16 13:12 Charlie-Hua