/SwiftfulAuthenticatingFirebase

Firebase Authentication for SwiftfulAuthenticating

Primary LanguageSwiftMIT LicenseMIT

Firebase Auth for SwiftfulAuthenticating ✅

Add FirebaseAuth support to a Swift application through SwiftfulAuthenticating framework.

See documentation in the parent repo: https://github.com/SwiftfulThinking/SwiftfulAuthenticating

Example configuration:

// Example
#if DEBUG
let authManager = AuthManager(service: MockAuthService(user: nil))
#else
let authManager = AuthManager(service: FirebaseAuthService())
#endif

Example actions:

let uid = authManager.auth.uid
let uid = try authManager.getAuthId()
try await authManager.signInAnonymous()
try await authManager.signInApple()
try await authManager.signInGoogle(GIDClientID: String)
try await authManager.signOut()
try await authManager.deleteAccount()

Sign In With Apple

Details (Click to expand)

Firebase docs: https://firebase.google.com/docs/auth/ios/apple

1. Enable Apple as a Sign-In Method in Firebase Authentication console.

  • Firebase Console -> Authentication -> Sign-in method -> Add new provider

2. Follow remaining steps on parent repo docs

Parent repo: https://github.com/SwiftfulThinking/SwiftfulFirebaseAuth/edit/main/README.md

Sign In With Google

Details (Click to expand)

Firebase docs: https://firebase.google.com/docs/auth/ios/google-signin

1. Enable Google as a Sign-In Method in Firebase Authentication console.

  • Firebase Console -> Authentication -> Sign-in method -> Add new provider

2. Follow remaining steps on parent repo docs

Parent repo: https://github.com/SwiftfulThinking/SwiftfulFirebaseAuth/edit/main/README.md