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: "microsoft.com")
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?
Answer
Refer to below gitHub:
https://github.com/firebase/firebase-ios-sdk/issues/3076
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.
https://github.com/firebase/firebase-ios-sdk/pull/2916/files
Related Questions
- → Function Undefined in Axios promise
- → What are the pluses/minuses of different ways to configure GPIOs on the Beaglebone Black?
- → Click to navigate on mobile devices
- → Playing Video - Server is not correctly configured - 12939
- → How to allow api access to android or ios app only(laravel)?
- → Axios array map callback
- → Access the Camera and CameraRoll on Android using React Native?
- → Update React [Native] View on Day Change
- → Shopify iOS SDK - issue converting BuyProductVariant to BuyProduct
- → BigCommerce and shopify API
- → Warning: Each child in an array or iterator should have a unique "key" prop. Check the render method of `ListView`
- → React Native - Differences between Android and IOS
- → What is the difference between React Native and React?