-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Omniauth without external window #654
Comments
Anyone have any tips on this? |
Any solutions are appreciated! |
I couldn't find a solution to this using devise_token_auth, and eventually gave up and used devise along with the tiddle gem. I've uploaded an example rails app, along with an android app currently using Google oAuth2 for authentication. I wonder if that might help you? https://github.com/glapworth/boilerplate-android-rails-api-oauth |
@glapworth I didn't want to re-implement a bunch of my tests and different API setups. However I did find a solution! Send a GET request to Override devise's
As you can see... this method is super hacky... I hardcoded the redirect route. If anyone has a better suggestion for this that would be great! Most of the code was taken from |
+1, waiting for any more answers. |
+1 |
1 similar comment
+1 |
Did anyone find a better solution for this? |
+1 |
I just created 2 pull request for this purpose, FYI! |
+1 on this. |
I'm confused. It seems as though one of the main attractions for using token authentication is being able to authenticate a user on a phone using something like facebook-sdk on the client. Is there some standard way to authenticate a mobile user on my rails server that I'm not seeing? I was under the impression that devise is more or less a standard for this, but it feels like I'm jumping through a lot of hoops here( overriding devise controller methods ) just to make this gem not use a redirect for omniauth, and ultimately being able to play nice with the iOS/Android facebook-sdk. If this isn't the standard what is? Or do most people just roll their own authentication entirely? |
Any news on this? |
+1 I am stuck at this, I am working on something similar to Tinder facebook login where I need to create account in backend once I get fb_token. |
+1 |
I have implemented a basic working solution on this using the Koala Gem. I created a route for this purpose eg 'customer_facebook_auth'. Then in the relevant controller using the facebook token that the mobile app acquired I create the new user (customer in my case) with the facebook user attributes. The facebook user attributes can be fetched using the Koala library gem.
Hope it helps. |
is there an official solution for this? |
@gibo there is not, but we do take pull requests! We'd love to see yours. |
@zachfeldman seems like there is already a PR for this :) #793 |
Ah, I didn't realize this was the same thing! Sorry about that @gibo . Have you tested the code in the open PR? If you've tested it along with the code that's currently in beta: then we may merge that PR sooner rather than later. |
@zachfeldman I’ll give it a test |
I made a small change to @geoandri code, as it was not returning the correct headers
|
Nice @gibo. Want to maybe submit a clean PR if you're done testing? |
I don't think it can really be tidied up into a PR, it really seems that Omniauth cannot be used with rails-api projects and therefore devise token auth. I think there needs to be a new gem created to handle this scenario which integrates into devise token auth. but for the time being perhaps the code above could be put into the read me? |
My users want to login with facebook and I have it setup where they can log into facebook using Facbook SDK on iOS. I want to pass the oauth access_token from SDK to omniauth, skipping the external window that devise_token_auth handles.
My question is how can I send an API request to /auth/:provider to go through the omniauth process when I already have an omniauth token?
I also am using the facebook-access-token gem which will handle the oauth token.
Related issues:
#556
#323
#175
Any advice is appreciated!
The text was updated successfully, but these errors were encountered: