firebase / firebase-ios-sdk

Firebase SDK for Apple App Development
https://firebase.google.com
Apache License 2.0
5.64k stars 1.48k forks source link

Firebase iOS SDK is not persisting auth state for Apple Sign In #12426

Closed filipealva closed 8 months ago

filipealva commented 8 months ago

Description

I've implemented Apple Sign In and it works properly, but if I close and open the app again it simply loses the authentication state.

Reproducing the issue

Just login to the app with Apple Sign In, close it and try to open again

Firebase SDK Version

10.21.0

Xcode Version

15.1

Installation Method

Swift Package Manager

Firebase Product(s)

Authentication

Targeted Platforms

iOS

Relevant Log Output

No response

If using Swift Package Manager, the project's Package.resolved

Expand Package.resolved snippet
```json Replace this line with the contents of your Package.resolved. ```

If using CocoaPods, the project's Podfile.lock

Expand Podfile.lock snippet
```yml Replace this line with the contents of your Podfile.lock! ```
google-oss-bot commented 8 months ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

filipealva commented 8 months ago

Some extra info:

I'm authenticating with the OAuthProvider.credential(withProviderID: idToken: rawNonce) with the data from Apple Sign In.

Firebase authorizes the user and it's everything normal until I kill the app. When I kill the app and launch it again, I check for the Apple Sign In credential state and it is authorized but the Firebase Auth service says it's not authenticated, there's no currentUser. It is not persisting the initial authorization

This is blocking me to release the app since Apple requires Apple Sign In when we have Google Sign In

filipealva commented 8 months ago

Nevermind, it was a problem within my implementation. Thank you