Android Question Firebase - access Google authorization token

Gentry

Member
Licensed User
Longtime User
Trying to move to Firebase and I have a need to use the Google Authentication token (not the Firebase token from GetUserTokenId) I see the properties in the Firebase Java API Doc and figured I could use the javaobject method to retrieve the value. I am trying this code:

B4X:
Sub Auth_SignedIn (User As FirebaseUser)
   Dim jo As JavaObject
   jo.InitializeStatic("com.firebase.client.AuthData")
   Dim gtoken As String
   gtoken = jo.RunMethod("getToken",Null)
   log(gtoken)

But of course I get
B4X:
 java.lang.ClassNotFoundException: com$firebase$client$AuthData

I tried to add a reference as #AddditionalJar but I couldn't find a firebase.jar to copy to libraries.

Am I barking up the right tree?

Thanks,
Gentry
 

Gentry

Member
Licensed User
Longtime User

After being successfully logged in with the firebase auth library (just like in the example), with the Google authentication method enabled in the dashboard, I then need to use the Google oauth token, which is stored in the firebase auth class, but is not exposed by the b4x library.

My need is to retrieve this oauth token value.
 
Upvote 0

Gentry

Member
Licensed User
Longtime User
The GetUserTokenId() provides a "firebase" token, which is not what I need. I require the underlying google oauth token which is a different value. I need the Google oath token specifically to a external service which uses this value to validate against google oauth directly (not against firebase).
 
Upvote 0

freedom2000

Well-Known Member
Licensed User
Longtime User
The GetUserTokenId() provides a "firebase" token, which is not what I need. I require the underlying google oauth token which is a different value. I need the Google oath token specifically to a external service which uses this value to validate against google oauth directly (not against firebase).
OK !
So i don't know :confused:
 
Upvote 0

Gentry

Member
Licensed User
Longtime User
Thanks for the confirm, guess we need to skin the cat a different way.

Already had google oauth in the UI, was trying to avoid multiple login processes for the user.

Gentry
 
Upvote 0
Top