Skip to content

feat: add OIDC/SSO enterprise login support#8713

Open
giutrec wants to merge 2 commits into
AppFlowy-IO:mainfrom
VOLCANO-STUDIO:main
Open

feat: add OIDC/SSO enterprise login support#8713
giutrec wants to merge 2 commits into
AppFlowy-IO:mainfrom
VOLCANO-STUDIO:main

Conversation

@giutrec

@giutrec giutrec commented May 11, 2026

Copy link
Copy Markdown
  • Modified frontend/rust-lib/Cargo.toml to include patch for AppFlowy-Cloud.
  • Added Saml and Oidc variants to ProviderTypePB enum in frontend/rust-lib/flowy-user/src/entities/auth.rs.
  • Mapped 'sso' to ProviderTypePB.Oidc in af_cloud_auth_service.dart.
  • Added 'sso' variant to ThirdPartySignInButtonType enum and updated UI components.
  • Integrated SSO login button into the sign-in screens.
  • Ignored build_dockers.sh in .gitignore.

Feature Preview


PR Checklist

  • My code adheres to AppFlowy's Conventions
  • I've listed at least one issue that this PR fixes in the description above.
  • I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes.
  • All existing tests are passing.

Summary by Sourcery

Add support for enterprise SSO/OIDC login across frontend and Rust user auth, including wiring the new provider type through the sign-in UI and auth service.

New Features:

  • Expose a new SSO/enterprise login option in desktop and mobile sign-in screens.
  • Introduce an SSO provider type in the Flutter auth layer mapped to an OIDC provider in the Rust user auth entities.

Enhancements:

  • Patch Rust client dependencies to local AppFlowy-Cloud paths for client API and related entities.

Chores:

  • Ignore the build_dockers.sh script in version control.

- Modified frontend/rust-lib/Cargo.toml to include patch for AppFlowy-Cloud.
- Added Saml and Oidc variants to ProviderTypePB enum in frontend/rust-lib/flowy-user/src/entities/auth.rs.
- Mapped 'sso' to ProviderTypePB.Oidc in af_cloud_auth_service.dart.
- Added 'sso' variant to ThirdPartySignInButtonType enum and updated UI components.
- Integrated SSO login button into the sign-in screens.
- Ignored build_dockers.sh in .gitignore.
@sourcery-ai

sourcery-ai Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Adds enterprise SSO (OIDC) login support end-to-end by wiring a new SSO provider type from Rust auth entities through Flutter auth services and UI, plus pointing the Rust client to local AppFlowy-Cloud patches and ignoring a local Docker helper script.

File-Level Changes

Change Details Files
Add SSO button type and integrate it into desktop and mobile sign-in UIs
  • Extend ThirdPartySignInButtonType enum with an sso variant, including provider id mapping, icon selection, label text, and theming cases
  • Insert DesktopThirdPartySignInButton and MobileThirdPartySignInButton instances for SSO into existing third-party sign-in layouts, wired to onSignIn callbacks
frontend/appflowy_flutter/lib/user/presentation/screens/sign_in_screen/widgets/third_party_sign_in_button/third_party_sign_in_buttons.dart
frontend/appflowy_flutter/lib/user/presentation/screens/sign_in_screen/widgets/third_party_sign_in_button/third_party_sign_in_button.dart
Introduce SAML and OIDC provider types in Rust auth model and map SSO to OIDC in Flutter auth service
  • Add Saml and Oidc variants to ProviderTypePB enum with explicit numeric ids
  • Extend ProviderTypePB::value_string to return "saml" and "oidc" for new variants
  • Map incoming provider string "sso" to ProviderTypePB.Oidc in ProviderTypePBExtension
frontend/rust-lib/flowy-user/src/entities/auth.rs
frontend/appflowy_flutter/lib/user/application/auth/af_cloud_auth_service.dart
Point Rust frontend to local AppFlowy-Cloud client libraries for development
  • Add Cargo.toml patch section overriding AppFlowy-Cloud client-api, client-api-entity, workspace-template, and gotrue-entity crates to local paths
frontend/rust-lib/Cargo.toml
Ignore local Docker build script
  • Add build_dockers.sh to .gitignore to prevent it from being tracked
.gitignore

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@CLAassistant

CLAassistant commented May 11, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The SSO button label is hardcoded as 'Enterprise Login (SSO)' instead of using a localized key like the other providers; consider adding a LocaleKeys entry for this string to keep i18n consistent.
  • The new SSO button is always rendered on both desktop and mobile; if SSO is only available in certain deployments or behind a feature flag, consider conditionally showing this button based on configuration or server capabilities.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The SSO button label is hardcoded as `'Enterprise Login (SSO)'` instead of using a localized key like the other providers; consider adding a `LocaleKeys` entry for this string to keep i18n consistent.
- The new SSO button is always rendered on both desktop and mobile; if SSO is only available in certain deployments or behind a feature flag, consider conditionally showing this button based on configuration or server capabilities.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@github-actions

Copy link
Copy Markdown

🥷 Ninja i18n – 🛎️ Translations need to be updated

Project /project.inlang

lint rule new reports level link
Missing translation 29 warning contribute (via Fink 🐦)

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