-
Notifications
You must be signed in to change notification settings - Fork 117
Document OAuth2 on react native #120
Comments
One note about @catalinmiron gist: it will trigger |
This was testen only on iOS. About the get method, you might be right. It's a fast inplementation just to get an idea around oauth in react native. If you want I can make a full example with better code. Sent from my iPhone
|
You can check if title is empty to prevent calling method several times. It is working solution but not ideal. Some things I dislikes:
I can propose more elegant way guys. But it may (and imho will) require modification of Scenario:
Pros:
Cons:
|
@farwayer can you post a simple example? |
I see that to implement @farwayer suggestion it would take some changes to feathers. Here is another example for those looking for guidance on the issue. https://github.com/sscaff1/hopePing/blob/master/src/scenes/LoginScene.js It's very similar to @catalinmiron suggestion but CookieManager has since been updated. The above reflects the update. Also I avoid triggering this.authenticate multiple times by setting state immediately following getting my cookie values. Hope this helps. EDIT: Also the above is an active side project for me so I will continue to work on and refine the code over the next few weeks (the above is 1 night of hacking). I'll try to write a blog about a final solution to this issue for others. Hope this helps @ekryski. |
Sscaff1 LoginScene is pretty accurate. It works as long as the provider supports WebViews. This became effective in September 2016 or so. The method suggested by Farwayer, of using the App url scheme and the native browser seems to be the way to go. |
This has also been improved in Feathers v4 authentication which allows to authenticate with an existing oAuth token the same way as with any other strategy (and without additional configuration necessary). Please see the migration guide for more information. Closing this issue in order to archive this repository. Related issues can be opened at the new code location in the Feathers main repository. |
It works and people have got it working but can make it easier or we should provide a guide.
@catalinmiron put together a gist showing how you can do it. We should just tighten it up a bit and add it to a guide.
The text was updated successfully, but these errors were encountered: