You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Could you make it clear in the documentation how to do oauth2 login in dart. There is a JavaScript example, but it is not clear how to do this with a dart mobile or web app. It would be nice to specify if this is actually possible, and if it is there should be something in the documentation showing how to do it, preferably in a way that is understandable for people that don't actually know exactly how oauth2 works.
The text was updated successfully, but these errors were encountered:
The documentation will be refactored in the near future and I'll add a Dart OAuth2 example, but that will be after #376.
Also please note that there are plans to simplify the OAuth2 flow in #55.
The Dart mobile flow is very similar to the JS example, with the main difference that instead of a regular redirect url you have to use a deep-link.
You'll need at least one screen to show the "Login with ..." buttons. Similar to the JS example, you can use client.users.listAuthMethods() to get the list of the currently allowed providers.
Note that most OAuth2 providers no longer allow webviews, so on a button click you need to open the url in the device's browser or use something like https://pub.dev/packages/flutter_web_auth that will open the url via ASWebAuthenticationSession or Chrome Custom Tabs.
The second activity/screen that you'll need would be to handle the deep-link redirect so that you can exchange the auth code for PocketBase token. This is where you call client.users.authViaOAuth2(...).
Could you make it clear in the documentation how to do oauth2 login in dart. There is a JavaScript example, but it is not clear how to do this with a dart mobile or web app. It would be nice to specify if this is actually possible, and if it is there should be something in the documentation showing how to do it, preferably in a way that is understandable for people that don't actually know exactly how oauth2 works.
The text was updated successfully, but these errors were encountered: