Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facebook login popup from Angular + JWT + DRF #1121

Open
gnud opened this issue Jul 14, 2019 · 0 comments
Open

Facebook login popup from Angular + JWT + DRF #1121

gnud opened this issue Jul 14, 2019 · 0 comments

Comments

@gnud
Copy link

gnud commented Jul 14, 2019

I am having an Angular SPA based frontend and it's server via localhost:4200 (for development), and has proxy for /api at api.mybackend.local.
I am using DRF token authentication having Authentication Token bearer. However, the user is always AnonoymousUser since I can't pass the header via a popup window.
Also it crashes with state invalid.

Any solution how can I use a popup window to use the social:begin having the Token authentication instead of session?
I was researching the season and I found the DjangoStrategy, but don't know if I need to change something there in order to use a token, meanwhile, I made custom authentication that intercepts the token via GET param and logs the users, but I it's not working.

Also, I have a custom subclasses Facebook provider in order to have different permissions, cause I am having one facebook app for one set of users and second app for different set of users.

4 solutions I come up with:

  • iframe in dialog, but I can't capture events like closed or something
  • popup window, automatically closes via the redirect to custom template haveing window.close
  • redirect option, instead of fb to load with popup true in extra data, it can redirect there and pass the token via GET param. But redirect sucks.
    Any tips are welcomed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant