RxSwiftCommunity / RxFirebase

RxSwift extensions for Firebase
MIT License
224 stars 66 forks source link

Firabase Auth Signin custom token data type issue #33

Closed brcbydr closed 4 years ago

brcbydr commented 4 years ago

Hi all, Below signIn function with custom token waiting AuthCredential parameter not String in FirebaseAuth. func signIn(withCustomToken token: String) -> Observable<AuthDataResult>

Because the token's type which created with GoogleProvider, FacebookProvider etc. is AuthCredential. let credential = FacebookAuthProvider.credential(withAccessToken: accessToken.tokenString)

Could you help me please?

ghost commented 4 years ago

signIn(withCustomToken token:) is used for custom token auth i.e JWT in your case you are using Facebbok auth which is totally different from custom token auth.

Instead use: signInAndRetrieveData(with credential:) to authenticate using AuthCredential. However, this will be deprecated in the next version and will be replaced with signIn(with:). So stick with signIn(withCustomToken token:) for now until next version release.