mongodb / stitch-android-sdk

MongoDB Stitch Android SDK
Apache License 2.0
58 stars 33 forks source link

Access to the accessToken #185

Open f10l opened 4 years ago

f10l commented 4 years ago

Hello,

I am trying to use the new graphql API from an Android client. My target was to use the android sdk to obtain the access token and do not need to query for it manually. I tried to stay close to the javascript browser example provided in https://docs.mongodb.com/stitch/graphql/connect-from-a-client-application/ The accessToken is simply available in client.auth.activeUserAuthInfo. For the android sdk this seems not to be the case. I have access to the id, deviceId and so on, but not to the activeUserAuthInfo or to the access token.

Is there any way to get the access token from the android sdk? It seems to be present in the very same way as in js in the AuthInfo class.

Used sdk version: 4.7.0