The third-party provider.
A URL to send the user to after they are confirmed.
A space-separated list of scopes granted to the OAuth application.
Additional query params.
A custom configuration callback for opening the OAuth flow externally.
let session = try await supabase.auth.signInWithOAuth(
provider: .github
) \{ (session: ASWebAuthenticationSession) in
// customize session
\}
let session = try await supabase.auth.signInWithOAuth(
provider: .github
) \{ url in
// use url to start OAuth flow
// and return a result url that contains the OAuth token.
// ...
return resultURL
\}
let url = try await supabase.auth.getOAuthSignInURL(provider: .github, redirectTo: URL(string: "my-app-scheme://"))
let session = ASWebAuthenticationSession(url: url, callbackURLScheme: "my-app-scheme") \{ url, error in
guard let url else \{ return \}
Task \{
try await supabase.auth.session(from: url)
\}
\}
session.presentationContextProvider = self // yours ASWebAuthenticationPresentationContextProviding implementation.
session.start()
let url = try await supabase.auth.signInWithOAuth(
provider: .github,
scopes: "repo gist notifications"
)