Skip to content

feat: add custom OAuth provider support#14

Merged
jwfing merged 1 commit into
InsForge:mainfrom
junaiddshaukat:feat/custom-oauth-support
Mar 23, 2026
Merged

feat: add custom OAuth provider support#14
jwfing merged 1 commit into
InsForge:mainfrom
junaiddshaukat:feat/custom-oauth-support

Conversation

@junaiddshaukat
Copy link
Copy Markdown
Contributor

@junaiddshaukat junaiddshaukat commented Mar 21, 2026

Summary

Adds non-breaking support for custom OAuth providers configured in the InsForge dashboard, mirroring the approach already implemented in the JS SDK and Swift SDK.

This work stems from InsForge/InsForge#859 which added backend support for custom OAuth providers with configurable credentials and OIDC discovery endpoints.

Changes

  • getOAuthUrl(providerKey: String, redirectUri, codeChallenge) — new overload that routes to /oauth/custom/{key} for dashboard-configured custom providers
  • signInWithOAuthPage(providerKey: String, redirectUri) — new overload with full PKCE flow, generates code verifier/challenge and launches browser
  • OAuthProvider enum is completely untouched — no source-breaking changes, existing consumers are unaffected
  • Uses Ktor's appendPathSegments("oauth", "custom", providerKey) for URL construction — provider key is encoded exactly once as a single path segment (avoids double-encoding and slash pass-through issues)

Usage

// Built-in provider (unchanged)
client.auth.signInWithOAuthPage(OAuthProvider.GOOGLE, "myapp://callback")

// Custom provider configured in dashboard (new overload)
client.auth.signInWithOAuthPage("auth0-acme", "myapp://callback")

- Changed not() signature from value: Any to value: Any?
- null maps to 'null' string for PostgREST (e.g. not.is.null)
- Applied to TableQuery, UpdateQuery, and DeleteQuery
- Added test for not(col, 'is', null)
@junaiddshaukat
Copy link
Copy Markdown
Contributor Author

Hey @jwfing —> this PR adds custom OAuth provider support to the Kotlin SDK, completing the rollout across all three SDKs (JS, Swift, Kotlin).

Same non-breaking approach as the Swift PR: OAuthProvider enum is untouched, and two new overloads (getOAuthUrl and signInWithOAuthPage) accept a providerKey: String that routes to /oauth/custom/{key}. URL encoding is handled via Ktor's appendPathSegments — single encoding, no double-encoding issues.

Ready for review whenever you get a chance!

@jwfing jwfing merged commit 8ec42c4 into InsForge:main Mar 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants