Skip to content

Commit 948fd89

Browse files
docs: improve OAuth documentation
1 parent 0a56dd6 commit 948fd89

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

FirebaseSwiftUI/first_draft.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,8 @@ When building custom views, you need to handle several things yourself that `Aut
640640

641641
You can create custom OAuth providers for services beyond the built-in ones:
642642

643+
> **⚠️ Important:** OIDC (OpenID Connect) providers must be configured in your Firebase project's Authentication settings before they can be used. In the Firebase Console, go to **Authentication → Sign-in method** and add your OIDC provider with the required credentials (Client ID, Client Secret, Issuer URL). You must also register the OAuth redirect URI provided by Firebase in your provider's developer console. See the [Firebase OIDC documentation](https://firebase.google.com/docs/auth/ios/openid-connect) for detailed setup instructions.
644+
643645
```swift
644646
import FirebaseAuthSwiftUI
645647
import FirebaseOAuthSwiftUI
@@ -655,6 +657,7 @@ struct ContentView: View {
655657
.withOAuthSignIn(
656658
OAuthProviderSwift(
657659
providerId: "oidc.line", // LINE OIDC provider
660+
scopes: ["profile", "openid", "email"], // LINE requires these scopes
658661
displayName: "Sign in with LINE",
659662
buttonIcon: Image("line-logo"),
660663
buttonBackgroundColor: .green,
@@ -664,6 +667,7 @@ struct ContentView: View {
664667
.withOAuthSignIn(
665668
OAuthProviderSwift(
666669
providerId: "oidc.custom-provider",
670+
scopes: ["profile", "openid"],
667671
displayName: "Sign in with Custom",
668672
buttonIcon: Image(systemName: "person.circle"),
669673
buttonBackgroundColor: .purple,

0 commit comments

Comments
 (0)