Skip to content

feat(sso): add ConfigureAuthType to enable or disable an SSO configuration - #836

Merged
dorsha merged 1 commit into
mainfrom
feat/sso-configure-auth-type
Aug 24, 2026
Merged

feat(sso): add ConfigureAuthType to enable or disable an SSO configuration#836
dorsha merged 1 commit into
mainfrom
feat/sso-configure-auth-type

Conversation

@dorsha

@dorsha dorsha commented Aug 24, 2026

Copy link
Copy Markdown
Member

Description

Wraps the new management endpoint POST /v1/mgmt/sso/settings/authtype

// disable one connection of a multi-SSO tenant, keeping its configuration
err := descopeClient.Management.SSO().ConfigureAuthType(ctx, "tenant-id", descope.SSOAuthTypeNone, "conf1")
// enable it again on the protocol it is configured for
err = descopeClient.Management.SSO().ConfigureAuthType(ctx, "tenant-id", descope.SSOAuthTypeSaml, "conf1")
// omit ssoID to target the tenant's default configuration
err = descopeClient.Management.SSO().ConfigureAuthType(ctx, "tenant-id", descope.SSOAuthTypeNone, "")

Why. A customer running their own admin UI on the management APIs needs to temporarily disable one SSO connection of a multi-SSO tenant. Until now the only per-connection off switch was DeleteSettings, which drops the connection: re-enabling meant NewSettings plus a full ConfigureSAMLSettings / ConfigureOIDCSettings replay, with the caller storing the mappings, the domains and the OIDC client secret (never returned on read). For SAML it was worse, since a recreated connection gets a new ACS URL and the tenant's IdP admin has to reconfigure. ConfigureAuthType leaves the stored configuration intact, so re-enabling needs no payload.

Adds descope.SSOAuthType with SSOAuthTypeNone / SSOAuthTypeSaml / SSOAuthTypeOidc, following the existing RoleInheritance / AuthFactor constant pattern.

Tests

descope/internal/mgmt/sso_test.go — the request body with an ssoID, the default-configuration call that omits it, and both missing-argument guards. MockSSO.ConfigureAuthType added for consumers. Full suite green.

…ation

Wraps POST /v1/mgmt/sso/settings/authtype: descope.SSOAuthTypeNone disables one
SSO configuration without deleting it, SSOAuthTypeSaml/SSOAuthTypeOidc enable it
on that protocol with its stored settings. Takes an optional ssoID, so a
multi-SSO tenant can have a single connection taken out of service and put back
without replaying its IdP payload, and without the new ACS URL a delete plus
recreate hands a SAML tenant.

Requires descope/backend#2355.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@shuni-bot

shuni-bot Bot commented Aug 24, 2026

Copy link
Copy Markdown

🐕 Review complete — View session on Shuni Portal 🐾

@shuni-bot

shuni-bot Bot commented Aug 24, 2026

Copy link
Copy Markdown

🐕 Suggested Reviewers

This PR introduces a new SSO management endpoint for configuring authentication types. The changes span API client definitions, SDK management interfaces, SSO-specific business logic, and comprehensive testing. The review strategy prioritizes contributors with deep expertise in the SSO domain and broad coverage across the SDK's architectural layers. Selected reviewers include specialists in SSO implementation (with both implementation and testing experience) and senior contributors familiar with the broader API/SDK structure to ensure consistency and quality across all modified areas.

Reviewer Reason
aviadl aviadl has the broadest expertise with 11 commits across 7 files including README.md, descope/api/client.go, and descope/internal/mgmt/sso.go. This breadth ensures review coverage across API definitions, SDK interfaces, and SSO logic—critical for a cohesive feature implementation.
omercnet omercnet has 15 commits across key architectural files (descope/api/client.go, descope/sdk/mgmt.go). Their experience with the SDK's public interfaces and client structure is essential for validating the API design and consistency of this new management endpoint.
yosiharan yosiharan has direct expertise in SSO implementation with 4 commits covering descope/internal/mgmt/sso.go, sso_test.go, and descope/sdk/mgmt.go. Their knowledge of SSO patterns and testing practices ensures the new ConfigureAuthType method aligns with existing patterns.
itaihanski itaihanski has specific focus on SSO testing with 2 commits in descope/internal/mgmt/sso_test.go. Their test-writing expertise is valuable for reviewing the test coverage and ensuring the new endpoint is properly validated.

Suggested by Shuni based on git history and PR context. Names are not @-mentioned to avoid notifying anyone — request a review from whoever fits best.

@shuni-bot shuni-bot 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.

🐕 Shuni Review

Adds ConfigureAuthType to enable/disable a single SSO configuration's auth type without dropping its stored settings, following the existing SSO management method pattern end-to-end.

Actionable comments posted: 0

Merge risk: 🟢 Low: small additive change, implementation/route/interface/mock/tests all consistent with sibling SSO methods (e.g. ConfigureSSORedirectURL, ConfigureOIDCSettings), no enum validation gaps beyond existing precedent, no missing integration points found.


Declared coverage: FULL — 7/7 changed files reviewed.

@dorsha
dorsha enabled auto-merge (squash) August 24, 2026 09:10
@ruvenzx
ruvenzx self-requested a review August 24, 2026 09:20
@dorsha
dorsha merged commit 679dad3 into main Aug 24, 2026
16 checks passed
@dorsha
dorsha deleted the feat/sso-configure-auth-type branch August 24, 2026 09:26
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