Firebase Microsoft Login Cannot Get Access Token In Swift IOS

I'm using Microsoft Login to Authenticate Users in Firebase.

Everythings works fine so far. Now I want to access the Microsoft API with the access token.

However, I'm not able to get the access token.

 provider = OAuthProvider(providerID: "")

 provider?.customParameters = [
     "prompt": "consent",

 provider?.getCredentialWith(nil) { (credentials, error) in
     //credentials doesn't contain access token

The reason for that is because the returned credentials are of type AuthCredentials and not OAuthCredentials like for the Google or Facebook Login.

Is there any other solution to get the access token from the login?



Refer to below gitHub:

There is a bug on firebase iOS sdk, the issue is oauth credential property is not exposed to public.

Temporarily you can make below pull request changes, it will work until firebase team releases new update framework.