Supabase and Apple auth integration#9
Merged
Conversation
This commit introduces Supabase authentication to the kmauth library. Key changes include: - Added a new `kmauth-supabase` module. - Added a new `kmauth-supabase` module. - Implemented `SupabaseAuthManager` for handling Supabase authentication logic, including sign-in, sign-out, and user/session retrieval. - Introduced `SupabaseUser` data class to represent user information from Supabase. - Updated `KMAuthConfig` in `kmauth-core` to support Supabase-specific configurations (URL and key) and deprecated KMAuthInitializer old methods over KMAuthInitializer.initialize(config: KMAuthConfig) - Added `KMAuthSupabase` object as an entry point for initializing and accessing Supabase authentication features. - Included necessary Supabase dependencies in `build.gradle.kts` and updated `libs.versions.toml`. - Refactored `KMAuthInitializer` in `kmauth-core` to use the new `KMAuthConfig` for a unified configuration approach, while maintaining backward compatibility with deprecated methods.
This commit introduces the following changes: - Adds `SupabaseOAuthProvider` enum to represent available OAuth providers for Supabase authentication. - Introduces `SupabaseExternalAuthConfig` and `SupabaseExternalAuthConfigDefaults` to manage external authentication configurations for Supabase. - Updates `SupabaseAuthManager` and `KMAuthSupabase` to use the new `SupabaseOAuthProvider` and `SupabaseExternalAuthConfig`. - Removes the `kotlinCocoapods` plugin from `kmauth-supabase/build.gradle.kts`. - Adds `kmauth-supabase` dependency to `sample/composeApp/build.gradle.kts`. - Updates the version in `kmauth-google/kmauth_google.podspec`.
This commit introduces several enhancements to the Supabase integration in kmauth:
- **Deep Link Handling:**
- Added `DeepLinkHandler` (expect/actual) for platform-specific deep link processing.
- Implemented Android deep link handling in `DeepLinkHandler.android.kt` to use `KMAuthSupabase.getSupabaseClient().handleDeeplinks(intent)`.
- Added stub implementations for iOS, WasmJs, JS, and JVM.
- Added `androidDeepLinkHost` and `androidDeepLinkScheme` to `KMAuthConfig` for Supabase deep link configuration.
- **Session Management & User State:**
- `KMAuthSupabase` now observes Supabase session status and exposes the current `SupabaseUser` as a `StateFlow`.
- Added `startCollectingSessionStatus()` in `KMAuthSupabase` to listen for authentication changes.
- Added `toSupabaseUser()` extension function to convert `io.github.jan.supabase.auth.user.UserInfo` to `SupabaseUser`.
- **Refinements & Fixes:**
- `SupabaseAuthManager` now uses the globally initialized `SupabaseClient` from `KMAuthSupabase` instead of creating its own.
- Removed `onSignResult` callback from `SupabaseAuthManager.signIn` methods; user state should be observed via `KMAuthSupabase.supabaseUser`.
- Made `supabase-auth` an `api` dependency in `kmauth-supabase/build.gradle.kts`.
- Deprecated `KMAuthInitializer.initContext` in favor of `initialize(KMAuthConfig)`.
- Updated sample app to reflect new Supabase initialization and sign-in flow.
- Updated `kmauth-google.podspec` version to `0.3.0`.
- Added GoogleSignIn and GoogleSignInSwift package dependencies to the iOS sample project.
- Minor reordering of fields in `KMAuthConfig`.
…PLus add google signin package in sample iosApp
… integration, update README and dependencies
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supabase and Apple authentication integration