Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(schemas): add idp-initiated SSO client side callback url columns #6675

Open
wants to merge 2 commits into
base: simeng-log-10156-experience-api-retrieve-idp-initiated-saml-sso-assertion-by
Choose a base branch
from

Conversation

simeng-li
Copy link
Contributor

Summary

Alternate the sso_connector_idp_initiated_auth_configs to support directly redirecting the user to the client app to initiate a standard OIDC authorization request.

Context

For better security and to support SPA applications, instead of automatically sending the OIDC authorization requests from the server side, we provide a more recommended option, redirect the user to the client side to initiate an OIDC authentication flow.

Since the IdP-initiated SAML SSO authentication request is unsolicited, thus sending an OIDC authorization request directly from the server side can not provide the necessary CRSF attack protection.

E.g. the state parameter and PKCE flow for SPA application.

As a better recommendation, by default, we redirect the user to a given client callback URL to initiate a standard OIDC auth flow, while keeping a live IdP-initiated SSO assertion session, so the user can be automatically authenticated via the same SSO connector.

Option A (Default):

  • auto_send_authorization_request set to false.
  • Provide a fieldclient_idp_initiated_auth_callback_uri` in the config.
  • Logto will create an idp-initiated SAML SSO session, and redirect the user to the above URL to trigger a standard OIDC authentication request with sign-in param `direct-sign-in=sso:{connectorId}

Option B (Previously implemented):

  • auto_send_authorization_request set to true.
  • Set the redirect_uri and other auth_parameters
  • Logto generate and send an OIDC authorization request on behave of the user.

Updates

  • Add new field auto_send_authorization_request. Default false. When disabled, Logto will redirect the user to the client side to trigger an auth request.
  • Add new field client_idp_initiated_auth_callback_uri. Exclusively stores the client side idp-initiated auth callback URL.
  • Add SPA application type.

Testing

Checklist

  • .changeset
  • unit tests
  • integration tests
  • necessary TSDoc comments

Copy link

github-actions bot commented Oct 14, 2024

COMPARE TO master

Total Size Diff ⚠️ 📈 +11.07 KB

Diff by File
Name Diff
packages/core/src/mocks/sso.ts 📈 +337 Bytes
packages/core/src/libraries/sso-connector.test.ts 📈 +192 Bytes
packages/core/src/libraries/sso-connector.ts 📈 +294 Bytes
packages/core/src/queries/sso-connectors.ts 📈 +309 Bytes
packages/core/src/routes/interaction/utils/single-sign-on.test.ts 📈 +6.31 KB
packages/core/src/routes/interaction/utils/single-sign-on.ts 📈 +1.99 KB
packages/core/src/utils/test-utils.ts 📈 +26 Bytes
packages/schemas/alterations/next-1728887713-add-client-idp-initiated-auth-callback-uri-columns.ts 📈 +1.35 KB
packages/schemas/tables/sso_connector_idp_initiated_auth_configs.sql 📈 +287 Bytes

@github-actions github-actions bot added feature Cool stuff size/s labels Oct 14, 2024
@simeng-li simeng-li changed the title feat(schemas): add idp-initiated SSO client side callback feat(schemas): add idp-initiated SSO client side callback url columns Oct 14, 2024
@simeng-li simeng-li force-pushed the simeng-log-10216-coreschemas-add-the-redirect-without-sign-in-flow branch from 61721ea to 39a2eca Compare October 14, 2024 07:14
@simeng-li simeng-li marked this pull request as draft October 14, 2024 07:19
@simeng-li simeng-li marked this pull request as ready for review October 14, 2024 07:37
@simeng-li simeng-li force-pushed the simeng-log-10156-experience-api-retrieve-idp-initiated-saml-sso-assertion-by branch from 4eb15aa to b027604 Compare October 14, 2024 07:39
@simeng-li simeng-li force-pushed the simeng-log-10216-coreschemas-add-the-redirect-without-sign-in-flow branch from 8b37668 to 0a30f8b Compare October 14, 2024 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

1 participant