diff --git a/web/src/pages/providers/oauth2/OAuth2ProviderForm.ts b/web/src/pages/providers/oauth2/OAuth2ProviderForm.ts index 6efda578a..4dce8fea6 100644 --- a/web/src/pages/providers/oauth2/OAuth2ProviderForm.ts +++ b/web/src/pages/providers/oauth2/OAuth2ProviderForm.ts @@ -117,7 +117,7 @@ export class OAuth2ProviderFormPage extends Form { name="redirectUris">

- ${t`Valid redirect URLs after a successful authorization flow. Also specify any origins here for CORS Headers.`} + ${t`Valid redirect URLs after a successful authorization flow. Also specify any origins here for Implicit flows.`}

@@ -157,9 +157,14 @@ export class OAuth2ProviderFormPage extends Form { ordering: "scope_name" }).then(scopes => { return scopes.results.map(scope => { - const selected = Array.from(this.provider?.propertyMappings || []).some(su => { - return su == scope.pk; - }); + let selected = false; + if (!this.provider?.propertyMappings) { + selected = scope.managed?.startsWith("goauthentik.io/providers/oauth2/scope-") || false; + } else { + selected = Array.from(this.provider?.propertyMappings).some(su => { + return su == scope.pk; + }); + } return html``; }); }), html``)} diff --git a/web/src/pages/providers/saml/SAMLProviderForm.ts b/web/src/pages/providers/saml/SAMLProviderForm.ts index e4107feb7..f6730466d 100644 --- a/web/src/pages/providers/saml/SAMLProviderForm.ts +++ b/web/src/pages/providers/saml/SAMLProviderForm.ts @@ -154,9 +154,14 @@ export class SAMLProviderFormPage extends Form { ordering: "saml_name" }).then(mappings => { return mappings.results.map(mapping => { - const selected = Array.from(this.provider?.propertyMappings || []).some(su => { - return su == mapping.pk; - }); + let selected = false; + if (!this.provider?.propertyMappings) { + selected = mapping.managed?.startsWith("goauthentik.io/providers/saml") || false; + } else { + selected = Array.from(this.provider?.propertyMappings).some(su => { + return su == mapping.pk; + }); + } return html``; }); }), html``)}