Skip to content

Add federated authentication support with GitHub and Google buttons#11

Merged
brionmario merged 1 commit into
thunder-id:mainfrom
brionmario:flexible-vendor-config
Jul 16, 2026
Merged

Add federated authentication support with GitHub and Google buttons#11
brionmario merged 1 commit into
thunder-id:mainfrom
brionmario:flexible-vendor-config

Conversation

@brionmario

@brionmario brionmario commented Jul 16, 2026

Copy link
Copy Markdown
Member

Purpose

  • Introduced FederatedAuthSession for handling browser redirects during federated login.
  • Added ic_provider_github and ic_provider_google drawable resources.
  • Updated GitHubButton and GoogleButton components to use images instead of custom drawings.
  • Simplified AuthScreen by removing unnecessary components and parameters.

Approach

N/A

Related Issues

Related PRs

  • N/A

Checklist

  • Followed the contribution guidelines.
  • Manual test round performed and verified.
  • Documentation provided. (Add links if there are any)
  • Tests provided. (Add links if there are any)
    • Unit Tests
    • Integration Tests
  • Breaking changes. (Fill if applicable)
    • Breaking changes section filled.
    • breaking change label added.

Security checks

  • Followed secure coding standards in WSO2 Secure Coding Guidelines
  • Confirmed that this PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.

Summary by CodeRabbit

  • New Features

    • Added browser-based redirection support for federated and social sign-in flows.
    • Updated Google and GitHub sign-in buttons with refreshed provider icons.
  • Bug Fixes

    • Improved sign-in action matching for more reliable form interactions.
  • Changes

    • Simplified the quickstart login experience by removing the password recovery and sign-up actions from the login sheet.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@brionmario, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 47 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 4736c788-21ca-489b-b9a1-78bb4c3d4f4b

📥 Commits

Reviewing files that changed from the base of the PR and between 35ae3d0 and 4cb7f8f.

⛔ Files ignored due to path filters (2)
  • src/main/res/drawable-nodpi/ic_provider_github.png is excluded by !**/*.png
  • src/main/res/drawable-nodpi/ic_provider_google.png is excluded by !**/*.png
📒 Files selected for processing (6)
  • build.gradle.kts
  • samples/quickstart/src/main/kotlin/dev/thunderid/quickstart/AuthScreen.kt
  • src/main/kotlin/dev/thunderid/android/auth/FederatedAuthSession.kt
  • src/main/kotlin/dev/thunderid/compose/components/actions/adapters/GitHubButton.kt
  • src/main/kotlin/dev/thunderid/compose/components/actions/adapters/GoogleButton.kt
  • src/main/kotlin/dev/thunderid/compose/components/presentation/auth/SignIn.kt
📝 Walkthrough

Walkthrough

Changes

The PR adds a federated browser redirect session, removes password-recovery and sign-up actions from the quickstart login sheet, standardizes action identifier matching, and switches Google and GitHub buttons to drawable-based icons.

Federated browser authentication

Layer / File(s) Summary
Browser redirect session
build.gradle.kts, src/main/kotlin/dev/thunderid/android/auth/FederatedAuthSession.kt
Adds the Android Browser dependency and a singleton that launches Custom Tabs, awaits redirect URIs, and cancels abandoned requests.

Authentication presentation updates

Layer / File(s) Summary
Action identifier matching
src/main/kotlin/dev/thunderid/compose/components/presentation/auth/SignIn.kt
Matches actions and components using a shared ref ?: id identifier key during enrichment and rendering.
Quickstart authentication sheets
samples/quickstart/src/main/kotlin/dev/thunderid/quickstart/AuthScreen.kt
Removes login-sheet recovery and sign-up actions, deletes the recover sheet, and simplifies sheet routing.

Provider icon rendering

Layer / File(s) Summary
Drawable provider icons
src/main/kotlin/dev/thunderid/compose/components/actions/adapters/GitHubButton.kt, src/main/kotlin/dev/thunderid/compose/components/actions/adapters/GoogleButton.kt
Replaces custom Canvas glyphs with 18dp drawable-backed Compose images.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant AuthCaller
  participant FederatedAuthSession
  participant CustomTab
  participant AppCallback
  AuthCaller->>FederatedAuthSession: launch(context, redirectUrl)
  FederatedAuthSession->>CustomTab: Open redirect URL
  CustomTab->>AppCallback: Return callback deep-link
  AppCallback->>FederatedAuthSession: onRedirect(uri)
  FederatedAuthSession-->>AuthCaller: Return callback Uri
Loading

Possibly related PRs

  • thunder-id/android-sdks#2: Introduced the recover sheet flow that this PR removes from the quickstart authentication screen.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title matches the main change: federated auth support plus GitHub and Google button updates.
Description check ✅ Passed The description follows the template and covers purpose, approach, issues, PRs, checklist, and security checks.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/main/kotlin/dev/thunderid/android/auth/FederatedAuthSession.kt`:
- Around line 27-28: Update the launch flow in FederatedAuthSession so it
cancels any existing pending CompletableDeferred before assigning the newly
created deferred to pending. Preserve the current behavior for the first launch
and ensure the prior launch caller is released rather than orphaned when
launches overlap.

In
`@src/main/kotlin/dev/thunderid/compose/components/actions/adapters/GitHubButton.kt`:
- Around line 49-51: Remove trailing commas from the final arguments at the
Image and TriggerButtonStyle call sites in
src/main/kotlin/dev/thunderid/compose/components/actions/adapters/GitHubButton.kt
lines 49-51 and
src/main/kotlin/dev/thunderid/compose/components/actions/adapters/GoogleButton.kt
lines 49-51, specifically after Modifier.size(18.dp) and the closing content
block. No other call-site formatting changes are needed.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b26f5d20-48cc-4dc7-86c1-efa6fc6fb201

📥 Commits

Reviewing files that changed from the base of the PR and between b8262f8 and 35ae3d0.

⛔ Files ignored due to path filters (2)
  • src/main/res/drawable-nodpi/ic_provider_github.png is excluded by !**/*.png
  • src/main/res/drawable-nodpi/ic_provider_google.png is excluded by !**/*.png
📒 Files selected for processing (6)
  • build.gradle.kts
  • samples/quickstart/src/main/kotlin/dev/thunderid/quickstart/AuthScreen.kt
  • src/main/kotlin/dev/thunderid/android/auth/FederatedAuthSession.kt
  • src/main/kotlin/dev/thunderid/compose/components/actions/adapters/GitHubButton.kt
  • src/main/kotlin/dev/thunderid/compose/components/actions/adapters/GoogleButton.kt
  • src/main/kotlin/dev/thunderid/compose/components/presentation/auth/SignIn.kt

Comment thread src/main/kotlin/dev/thunderid/android/auth/FederatedAuthSession.kt
DonOmalVindula
DonOmalVindula previously approved these changes Jul 16, 2026
@brionmario brionmario closed this Jul 16, 2026
@brionmario
brionmario force-pushed the flexible-vendor-config branch from 35ae3d0 to b8262f8 Compare July 16, 2026 08:56
- Introduced `FederatedAuthSession` for handling browser redirects during federated login.
- Added `ic_provider_github` and `ic_provider_google` drawable resources.
- Updated `GitHubButton` and `GoogleButton` components to use images instead of custom drawings.
- Simplified `AuthScreen` by removing unnecessary components and parameters.
@brionmario
brionmario merged commit a4b586c into thunder-id:main Jul 16, 2026
6 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