Closed aliexalter closed 2 years ago
Hi @aliexalter, thank you for your request. I will have a look at it. I think it should be possible to return the access token.
How plugin chose its OIDC provider or OAuth provider. Can we set provider in this plugin ?
The provider is chosen with the method you use for sign in (e.g. signInWithGoogle
, signInWithFacebook
, etc.).
@robingenz Thank you I hope this access token works with google photo library REST API.
Do you also need it on Android? On Android, unfortunately, the access token is not provided and I would have to expose a server auth token instead, which you would have to swap server-side for a google access token.
Yes that will be great.
@aliexalter Feel free to test the new dev version and let me know if it works:
npm i @capacitor-firebase/authentication@0.2.0-dev.eeac0a7.1648649641
on iOS
on Adnroid
Fixed. Should work now:
npm i @capacitor-firebase/authentication@0.2.0-dev.1e9823b.1648714344
Thanks it's working great on iOS.
Have you only tested iOS or does Android still not work?
I only tested on iOS. On android I don't need access token to get google API as we already on google platform so we use sharing and camera plugin to access google drive and photos.
I am using
FirebaseAuthentication.signInWithGoogle()
Which return both User and AuthCredential. Under AuthCredential I am not getting oAuth access token. I am only getting providerId and idToken.
I would like to use oAuth access token to call REST API of google photo library (https://photoslibrary.googleapis.com/v1/albums). But When I console.log SignInResult.AuthCredential.accessToken its undefined.
How plugin chose its OIDC provider or OAuth provider. Can we set provider in this plugin ?
I test it on iOS device.