@sneat/auth-ui 0.27.18 → 0.27.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/index.js +1 -0
- package/esm2022/index.js.map +1 -1
- package/esm2022/lib/pages/login-page/login-page.component.js +4 -3
- package/esm2022/lib/pages/login-page/login-page.component.js.map +1 -1
- package/esm2022/lib/pages/sneat-auth-routing.module.js +27 -0
- package/esm2022/lib/pages/sneat-auth-routing.module.js.map +1 -1
- package/esm2022/lib/sso/index.js +3 -0
- package/esm2022/lib/sso/index.js.map +1 -0
- package/esm2022/lib/sso/sso-api.service.js +64 -0
- package/esm2022/lib/sso/sso-api.service.js.map +1 -0
- package/esm2022/lib/sso/sso-callback-page.component.js +65 -0
- package/esm2022/lib/sso/sso-callback-page.component.js.map +1 -0
- package/esm2022/lib/sso/sso-errors.js +13 -0
- package/esm2022/lib/sso/sso-errors.js.map +1 -0
- package/esm2022/lib/sso/sso-login-page.component.js +102 -0
- package/esm2022/lib/sso/sso-login-page.component.js.map +1 -0
- package/esm2022/lib/sso/sso-onboarding-page.component.js +87 -0
- package/esm2022/lib/sso/sso-onboarding-page.component.js.map +1 -0
- package/esm2022/lib/sso/sso-settings-page.component.js +290 -0
- package/esm2022/lib/sso/sso-settings-page.component.js.map +1 -0
- package/esm2022/lib/sso/sso.models.js +17 -0
- package/esm2022/lib/sso/sso.models.js.map +1 -0
- package/index.d.ts +1 -0
- package/lib/pages/sneat-auth-routing.module.d.ts +1 -0
- package/lib/sso/index.d.ts +2 -0
- package/lib/sso/sso-api.service.d.ts +22 -0
- package/lib/sso/sso-callback-page.component.d.ts +13 -0
- package/lib/sso/sso-errors.d.ts +1 -0
- package/lib/sso/sso-login-page.component.d.ts +17 -0
- package/lib/sso/sso-onboarding-page.component.d.ts +19 -0
- package/lib/sso/sso-settings-page.component.d.ts +47 -0
- package/lib/sso/sso.models.d.ts +58 -0
- package/package.json +8 -2
- package/tsconfig.lib.prod.tsbuildinfo +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sso-settings-page.component.js","sourceRoot":"","sources":["../../../../../../../libs/auth/ui/src/lib/sso/sso-settings-page.component.ts","../../../../../../../libs/auth/ui/src/lib/sso/sso-settings-page.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EACL,uBAAuB,EACvB,SAAS,EAET,QAAQ,EACR,MAAM,EACN,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EACL,aAAa,EACb,QAAQ,EACR,SAAS,EACT,UAAU,EACV,OAAO,EACP,cAAc,EACd,UAAU,EACV,SAAS,EACT,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,UAAU,EACV,OAAO,EACP,WAAW,EACX,QAAQ,EACR,UAAU,GACX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EACL,kBAAkB,EAClB,WAAW,GAIZ,MAAM,cAAc,CAAC;;;AA0BtB,MAAM,OAAO,wBAAwB;IAxBrC;QAyBmB,UAAK,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;QAC/B,QAAG,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;QAC5B,cAAS,GAAG,QAAQ,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,SAAS,CAAC,CAAC;QAEvD,YAAO,GACxB,IAAI,CAAC,KAAK,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BACR,UAAU;qBACX","sourcesContent":["import { HttpErrorResponse } from '@angular/common/http';\nimport {\n ChangeDetectionStrategy,\n Component,\n OnInit,\n computed,\n inject,\n signal,\n} from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { FormsModule } from '@angular/forms';\nimport { ActivatedRoute } from '@angular/router';\nimport {\n IonBackButton,\n IonBadge,\n IonButton,\n IonButtons,\n IonCard,\n IonCardContent,\n IonContent,\n IonHeader,\n IonInput,\n IonItem,\n IonLabel,\n IonSpinner,\n IonText,\n IonTextarea,\n IonTitle,\n IonToolbar,\n} from '@ionic/angular';\nimport { SneatUserService } from '@sneat/auth-core';\nimport { firstValueFrom } from 'rxjs';\nimport { SsoApiService } from './sso-api.service';\nimport { ssoErrorMessage } from './sso-errors';\nimport {\n applicationBaseURL,\n emailDomain,\n SsoConfig,\n SsoProtocol,\n SsoProviderPreset,\n} from './sso.models';\n\n@Component({\n selector: 'sneat-sso-settings-page',\n templateUrl: './sso-settings-page.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n FormsModule,\n IonBackButton,\n IonBadge,\n IonButton,\n IonButtons,\n IonCard,\n IonCardContent,\n IonContent,\n IonHeader,\n IonInput,\n IonItem,\n IonLabel,\n IonSpinner,\n IonText,\n IonTextarea,\n IonTitle,\n IonToolbar,\n ],\n})\nexport class SsoSettingsPageComponent implements OnInit {\n private readonly route = inject(ActivatedRoute);\n private readonly sso = inject(SsoApiService);\n private readonly userState = toSignal(inject(SneatUserService).userState);\n\n protected readonly spaceID =\n this.route.snapshot.paramMap.get('spaceID') ?? '';\n protected readonly spaceHomeURL = `/space/${\n this.route.snapshot.paramMap.get('spaceType') ?? 'company'\n }/${this.spaceID}`;\n protected readonly step = signal(1);\n protected readonly protocol = signal<SsoProtocol>('oidc');\n protected readonly providerPreset = signal<SsoProviderPreset>('entra');\n protected readonly domain = signal(\n this.route.snapshot.queryParamMap.get('domain') ?? '',\n );\n protected readonly issuer = signal('');\n protected readonly clientID = signal('');\n protected readonly clientSecret = signal('');\n protected readonly loginHost = signal('');\n protected readonly samlMetadata = signal('');\n protected readonly config = signal<SsoConfig | undefined>(undefined);\n protected readonly loading = signal(true);\n protected readonly busy = signal(false);\n protected readonly error = signal<string | undefined>(undefined);\n protected readonly success = signal<string | undefined>(\n this.route.snapshot.queryParamMap.has('activated')\n ? 'SSO was tested successfully and is now active.'\n : undefined,\n );\n protected readonly isAdmin = computed(() => {\n const roles = this.userState()?.record?.spaces?.[this.spaceID]?.roles ?? [];\n return roles.some((role) => role === 'owner' || role === 'admin');\n });\n protected readonly userRecordLoaded = computed(\n () => this.userState()?.record !== undefined,\n );\n protected readonly isOIDC = computed(() => this.protocol() === 'oidc');\n protected readonly domainValid = computed(\n () =>\n emailDomain(`admin@${this.domain()}`) ===\n this.domain().trim().toLowerCase(),\n );\n protected readonly domainVerified = computed(\n () => !!this.config()?.domainVerification?.verifiedAt,\n );\n protected readonly connectionValid = computed(() => {\n if (this.isOIDC()) {\n return (\n !!this.issuer().trim() &&\n !!this.clientID().trim() &&\n (!!this.clientSecret() || !!this.config()?.hasClientSecret)\n );\n }\n return !!this.samlMetadata().trim() || !!this.config()?.hasSamlMetadata;\n });\n protected readonly samlMetadataURL = this.sso.samlMetadataURL();\n protected readonly oidcRedirectURL = `${applicationBaseURL()}/sso/callback`;\n\n ngOnInit(): void {\n void this.load();\n }\n\n protected chooseProvider(preset: SsoProviderPreset): void {\n if (this.busy()) {\n return;\n }\n this.providerPreset.set(preset);\n this.protocol.set(preset === 'generic_saml' ? 'saml' : 'oidc');\n }\n\n protected async prepareDomain(): Promise<void> {\n if (!this.isAdmin() || !this.domainValid() || this.busy()) {\n return;\n }\n this.beginOperation();\n try {\n const config = await firstValueFrom(\n this.sso.prepareDomain({\n spaceID: this.spaceID,\n emailDomain: this.domain().trim().toLowerCase(),\n protocol: this.protocol(),\n providerPreset: this.providerPreset(),\n }),\n );\n this.config.set(config);\n this.step.set(config.domainVerification?.verifiedAt ? 3 : 2);\n } catch (error) {\n this.error.set(ssoErrorMessage(error));\n } finally {\n this.busy.set(false);\n }\n }\n\n protected async verifyDomain(): Promise<void> {\n if (this.busy()) {\n return;\n }\n this.beginOperation();\n try {\n const config = await firstValueFrom(this.sso.verifyDomain(this.spaceID));\n this.config.set(config);\n this.success.set('Domain ownership verified. Add the provider details.');\n this.step.set(3);\n } catch (error) {\n this.error.set(ssoErrorMessage(error));\n } finally {\n this.busy.set(false);\n }\n }\n\n protected async save(): Promise<void> {\n if (\n !this.isAdmin() ||\n !this.domainVerified() ||\n !this.connectionValid() ||\n this.busy()\n ) {\n return;\n }\n this.beginOperation();\n try {\n const config = await firstValueFrom(\n this.sso.saveConfig({\n spaceID: this.spaceID,\n protocol: this.protocol(),\n providerPreset: this.providerPreset(),\n emailDomain: this.domain().trim().toLowerCase(),\n issuer: this.isOIDC() ? this.issuer().trim() : undefined,\n clientID: this.isOIDC() ? this.clientID().trim() : undefined,\n clientSecret: this.isOIDC() ? this.clientSecret() : undefined,\n loginHost: this.loginHost().trim() || undefined,\n samlIdpMetadataXML: this.isOIDC()\n ? undefined\n : this.samlMetadata().trim(),\n }),\n );\n this.config.set(config);\n this.clientSecret.set('');\n this.success.set(\n 'Configuration saved securely. Complete a real provider sign-in to activate it.',\n );\n this.step.set(4);\n } catch (error) {\n this.error.set(ssoErrorMessage(error));\n } finally {\n this.busy.set(false);\n }\n }\n\n protected async testAndActivate(): Promise<void> {\n if (this.busy() || !this.domainVerified()) {\n return;\n }\n this.beginOperation();\n try {\n const result = await firstValueFrom(\n this.sso.startActivation(this.spaceID, applicationBaseURL()),\n );\n location.assign(result.authorizationURL);\n } catch (error) {\n this.error.set(ssoErrorMessage(error));\n this.busy.set(false);\n }\n }\n\n protected editConnection(): void {\n this.clearMessages();\n this.step.set(3);\n }\n\n protected changeDomainOrProvider(): void {\n this.clearMessages();\n this.step.set(1);\n }\n\n protected async disable(): Promise<void> {\n if (this.busy() || this.config()?.status !== 'active') {\n return;\n }\n this.beginOperation();\n try {\n const config = await firstValueFrom(this.sso.disable(this.spaceID));\n this.config.set(config);\n this.success.set('SSO is disabled. Regular sign-in remains available.');\n } catch (error) {\n this.error.set(ssoErrorMessage(error));\n } finally {\n this.busy.set(false);\n }\n }\n\n protected async deleteConfiguration(): Promise<void> {\n if (\n this.busy() ||\n !confirm(\n 'Delete this SSO configuration and release its domain and login host?',\n )\n ) {\n return;\n }\n this.beginOperation();\n try {\n await firstValueFrom(this.sso.delete(this.spaceID));\n this.config.set(undefined);\n this.issuer.set('');\n this.clientID.set('');\n this.clientSecret.set('');\n this.samlMetadata.set('');\n this.loginHost.set('');\n this.step.set(1);\n this.success.set('SSO configuration deleted. The domain is available.');\n } catch (error) {\n this.error.set(ssoErrorMessage(error));\n } finally {\n this.busy.set(false);\n }\n }\n\n private beginOperation(): void {\n this.busy.set(true);\n this.clearMessages();\n }\n\n private clearMessages(): void {\n this.error.set(undefined);\n this.success.set(undefined);\n }\n\n private async load(): Promise<void> {\n try {\n const config = await firstValueFrom(this.sso.getConfig(this.spaceID));\n this.config.set(config);\n this.domain.set(config.emailDomains[0] ?? this.domain());\n this.protocol.set(config.protocol);\n this.providerPreset.set(\n config.providerPreset ??\n (config.protocol === 'saml' ? 'generic_saml' : 'generic_oidc'),\n );\n this.issuer.set(config.issuer);\n this.clientID.set(config.clientID);\n this.loginHost.set(config.loginHosts?.[0] ?? '');\n if (\n config.status === 'active' ||\n config.status === 'disabled' ||\n config.hasClientSecret ||\n config.hasSamlMetadata\n ) {\n this.step.set(4);\n } else if (config.domainVerification?.verifiedAt) {\n this.step.set(3);\n } else {\n this.step.set(2);\n }\n } catch (error) {\n if (!(error instanceof HttpErrorResponse) || error.status !== 404) {\n this.error.set(ssoErrorMessage(error));\n }\n } finally {\n this.loading.set(false);\n }\n }\n}\n","<ion-header>\n <ion-toolbar color=\"light\">\n <ion-buttons slot=\"start\">\n <ion-back-button [defaultHref]=\"spaceHomeURL\" />\n </ion-buttons>\n <ion-title>Enterprise SSO</ion-title>\n </ion-toolbar>\n</ion-header>\n\n<ion-content class=\"ion-padding\">\n @if (loading() || !userRecordLoaded()) {\n <div class=\"ion-text-center ion-padding\">\n <ion-spinner />\n <p>Loading SSO settings…</p>\n </div>\n } @else if (!isAdmin()) {\n <ion-card color=\"danger\">\n <ion-card-content>\n <h1>Owner or admin access required</h1>\n <p>You do not have permission to configure SSO for this space.</p>\n </ion-card-content>\n </ion-card>\n } @else {\n <ion-card>\n <ion-card-content>\n <h1>Company sign-in</h1>\n <p>Set up OIDC or SAML without changing Sneat users or memberships.</p>\n <p aria-label=\"Setup progress\">\n Step {{ step() }} of 4\n @if (config(); as current) {\n · Status:\n <ion-badge\n [color]=\"current.status === 'active' ? 'success' : 'medium'\"\n >{{ current.status }}</ion-badge\n >\n }\n </p>\n </ion-card-content>\n </ion-card>\n\n @if (step() === 1) {\n <ion-card>\n <ion-card-content>\n <h2>1. Choose your identity provider</h2>\n <p>Pick a guided preset or use a standards-based connection.</p>\n <ion-button\n fill=\"outline\"\n [color]=\"providerPreset() === 'entra' ? 'primary' : 'medium'\"\n (click)=\"chooseProvider('entra')\"\n >Microsoft Entra ID</ion-button\n >\n <ion-button\n fill=\"outline\"\n [color]=\"providerPreset() === 'okta' ? 'primary' : 'medium'\"\n (click)=\"chooseProvider('okta')\"\n >Okta</ion-button\n >\n <ion-button\n fill=\"outline\"\n [color]=\"providerPreset() === 'keycloak' ? 'primary' : 'medium'\"\n (click)=\"chooseProvider('keycloak')\"\n >Keycloak</ion-button\n >\n <ion-button\n fill=\"outline\"\n [color]=\"providerPreset() === 'generic_oidc' ? 'primary' : 'medium'\"\n (click)=\"chooseProvider('generic_oidc')\"\n >Generic OIDC</ion-button\n >\n <ion-button\n fill=\"outline\"\n [color]=\"providerPreset() === 'generic_saml' ? 'primary' : 'medium'\"\n (click)=\"chooseProvider('generic_saml')\"\n >SAML 2.0</ion-button\n >\n\n <ion-item class=\"ion-margin-top\">\n <ion-label position=\"stacked\">Primary email domain</ion-label>\n <ion-input\n name=\"email-domain\"\n placeholder=\"acme.com\"\n [ngModel]=\"domain()\"\n (ngModelChange)=\"domain.set($event)\"\n [disabled]=\"busy()\"\n />\n </ion-item>\n <ion-button\n expand=\"block\"\n class=\"ion-margin-top\"\n [disabled]=\"!domainValid() || busy()\"\n (click)=\"prepareDomain()\"\n >\n @if (busy()) {\n <ion-spinner name=\"lines-small\" slot=\"start\" />\n }\n Continue to domain verification\n </ion-button>\n </ion-card-content>\n </ion-card>\n } @else if (step() === 2) {\n <ion-card>\n <ion-card-content>\n <h2>2. Prove control of {{ domain() }}</h2>\n <p>\n Add this TXT record in your DNS provider. This prevents an arbitrary\n identity provider from claiming somebody else’s email domain.\n </p>\n <ion-item>\n <ion-label position=\"stacked\">DNS record name</ion-label>\n <ion-input\n name=\"dns-record-name\"\n readonly\n [value]=\"config()?.domainVerification?.recordName\"\n />\n </ion-item>\n <ion-item>\n <ion-label position=\"stacked\">TXT value</ion-label>\n <ion-input\n name=\"dns-record-value\"\n readonly\n [value]=\"config()?.domainVerification?.recordValue\"\n />\n </ion-item>\n <p>\n <ion-text color=\"medium\"\n >DNS changes may need a few minutes to propagate.</ion-text\n >\n </p>\n <ion-button fill=\"clear\" (click)=\"changeDomainOrProvider()\"\n >Back</ion-button\n >\n <ion-button [disabled]=\"busy()\" (click)=\"verifyDomain()\">\n @if (busy()) {\n <ion-spinner name=\"lines-small\" slot=\"start\" />\n }\n Check DNS record\n </ion-button>\n </ion-card-content>\n </ion-card>\n } @else if (step() === 3) {\n <ion-card>\n <ion-card-content>\n <h2>3. Connect {{ protocol().toUpperCase() }}</h2>\n @if (isOIDC()) {\n <p>\n Register <strong>{{ oidcRedirectURL }}</strong>\n as the provider redirect URI.\n </p>\n <ion-item>\n <ion-label position=\"stacked\">OIDC issuer</ion-label>\n <ion-input\n name=\"issuer\"\n type=\"url\"\n placeholder=\"https://login.microsoftonline.com/tenant-id/v2.0\"\n [ngModel]=\"issuer()\"\n (ngModelChange)=\"issuer.set($event)\"\n [disabled]=\"busy()\"\n />\n </ion-item>\n <ion-item>\n <ion-label position=\"stacked\">Client ID</ion-label>\n <ion-input\n name=\"client-id\"\n autocomplete=\"off\"\n [ngModel]=\"clientID()\"\n (ngModelChange)=\"clientID.set($event)\"\n [disabled]=\"busy()\"\n />\n </ion-item>\n <ion-item>\n <ion-label position=\"stacked\">Client secret</ion-label>\n <ion-input\n name=\"client-secret\"\n type=\"password\"\n autocomplete=\"new-password\"\n [placeholder]=\"\n config()?.hasClientSecret\n ? 'Leave blank to keep it, or enter a replacement'\n : 'Required'\n \"\n [ngModel]=\"clientSecret()\"\n (ngModelChange)=\"clientSecret.set($event)\"\n [disabled]=\"busy()\"\n />\n </ion-item>\n } @else {\n <p>\n Give your IdP the DataTug service-provider metadata URL, then\n paste the IdP metadata XML below.\n </p>\n <ion-item>\n <ion-label position=\"stacked\">SP metadata URL</ion-label>\n <ion-input\n name=\"saml-sp-metadata-url\"\n readonly\n [value]=\"samlMetadataURL\"\n />\n </ion-item>\n <ion-item>\n <ion-label position=\"stacked\">IdP metadata XML</ion-label>\n <ion-textarea\n name=\"saml-idp-metadata\"\n autoGrow=\"true\"\n rows=\"8\"\n [placeholder]=\"\n config()?.hasSamlMetadata\n ? 'Paste replacement metadata, or leave blank to keep it'\n : '<EntityDescriptor …>'\n \"\n [ngModel]=\"samlMetadata()\"\n (ngModelChange)=\"samlMetadata.set($event)\"\n [disabled]=\"busy()\"\n />\n </ion-item>\n }\n\n <ion-item>\n <ion-label position=\"stacked\"\n >Company login host (optional)</ion-label\n >\n <ion-input\n name=\"login-host\"\n placeholder=\"acme.datatug.app\"\n [ngModel]=\"loginHost()\"\n (ngModelChange)=\"loginHost.set($event)\"\n [disabled]=\"busy()\"\n />\n </ion-item>\n <p>\n <ion-text color=\"medium\"\n >A company host fixes the login page to this email domain. Only\n approved Sneat-owned host suffixes can be claimed.</ion-text\n >\n </p>\n <ion-button fill=\"clear\" (click)=\"changeDomainOrProvider()\"\n >Back</ion-button\n >\n <ion-button\n [disabled]=\"!connectionValid() || busy()\"\n (click)=\"save()\"\n >\n @if (busy()) {\n <ion-spinner name=\"lines-small\" slot=\"start\" />\n }\n Save and continue\n </ion-button>\n </ion-card-content>\n </ion-card>\n } @else {\n <ion-card>\n <ion-card-content>\n <h2>4. Test and manage SSO</h2>\n <p>\n Saving does not activate SSO. Activation requires a complete,\n validated sign-in through your configured provider.\n </p>\n <ion-button [disabled]=\"busy()\" (click)=\"testAndActivate()\">\n @if (busy()) {\n <ion-spinner name=\"lines-small\" slot=\"start\" />\n }\n {{\n config()?.status === 'active'\n ? 'Test SSO again'\n : 'Test & Activate SSO'\n }}\n </ion-button>\n <ion-button\n fill=\"outline\"\n [disabled]=\"busy()\"\n (click)=\"editConnection()\"\n >\n Edit or rotate credentials\n </ion-button>\n @if (config()?.status === 'active') {\n <ion-button\n color=\"warning\"\n fill=\"outline\"\n [disabled]=\"busy()\"\n (click)=\"disable()\"\n >\n Disable SSO\n </ion-button>\n }\n <ion-button\n color=\"danger\"\n fill=\"clear\"\n [disabled]=\"busy()\"\n (click)=\"deleteConfiguration()\"\n >\n Delete configuration\n </ion-button>\n </ion-card-content>\n </ion-card>\n }\n\n @if (error()) {\n <ion-card color=\"danger\">\n <ion-card-content>{{ error() }}</ion-card-content>\n </ion-card>\n }\n @if (success()) {\n <ion-card color=\"success\">\n <ion-card-content>{{ success() }}</ion-card-content>\n </ion-card>\n }\n }\n</ion-content>\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export const ssoBrowserBindingStorageKey = 'sneat.sso.browser-binding.v1';
|
|
2
|
+
export function applicationBaseURL() {
|
|
3
|
+
return document.baseURI.replace(/\/+$/, '');
|
|
4
|
+
}
|
|
5
|
+
export function emailDomain(email) {
|
|
6
|
+
const normalized = email.trim().toLowerCase();
|
|
7
|
+
if (normalized.split('@').length !== 2) {
|
|
8
|
+
return undefined;
|
|
9
|
+
}
|
|
10
|
+
const separator = normalized.lastIndexOf('@');
|
|
11
|
+
if (separator <= 0 || separator === normalized.length - 1) {
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
const domain = normalized.slice(separator + 1);
|
|
15
|
+
return domain.includes('.') && !/[\s/@]/.test(domain) ? domain : undefined;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=sso.models.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sso.models.js","sourceRoot":"","sources":["../../../../../../../libs/auth/ui/src/lib/sso/sso.models.ts"],"names":[],"mappings":"AA0EA,MAAM,CAAC,MAAM,2BAA2B,GAAG,8BAA8B,CAAC;AAE1E,MAAM,UAAU,kBAAkB;IAChC,OAAO,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAa;IACvC,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC9C,IAAI,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvC,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,SAAS,GAAG,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAC9C,IAAI,SAAS,IAAI,CAAC,IAAI,SAAS,KAAK,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1D,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC;IAC/C,OAAO,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AAC7E,CAAC","sourcesContent":["export interface SsoDiscovery {\n readonly domain: string;\n readonly configured: boolean;\n readonly fixedDomain: boolean;\n}\n\nexport type SsoProtocol = 'oidc' | 'saml';\n\nexport type SsoProviderPreset =\n | 'entra'\n | 'okta'\n | 'keycloak'\n | 'generic_oidc'\n | 'generic_saml';\n\nexport interface SsoConfigRequest {\n readonly spaceID: string;\n readonly protocol: SsoProtocol;\n readonly providerPreset: SsoProviderPreset;\n readonly emailDomain: string;\n readonly issuer?: string;\n readonly clientID?: string;\n readonly clientSecret?: string;\n readonly loginHost?: string;\n readonly samlIdpMetadataXML?: string;\n}\n\nexport interface SsoConfig {\n readonly spaceID: string;\n readonly protocol: SsoProtocol;\n readonly providerPreset?: SsoProviderPreset;\n readonly status:\n | 'draft'\n | 'configured'\n | 'verification_pending'\n | 'active'\n | 'disabled';\n readonly emailDomains: readonly string[];\n readonly issuer: string;\n readonly clientID: string;\n readonly hasClientSecret: boolean;\n readonly loginHosts?: readonly string[];\n readonly samlIdpEntityID?: string;\n readonly hasSamlMetadata: boolean;\n readonly domainVerification?: SsoDomainVerification;\n readonly verifiedAt?: string;\n readonly verifiedByUserID?: string;\n readonly disabledAt?: string;\n}\n\nexport interface SsoDomainVerification {\n readonly recordName: string;\n readonly recordValue: string;\n readonly verifiedAt?: string;\n}\n\nexport interface SsoDomainChallengeRequest {\n readonly spaceID: string;\n readonly emailDomain: string;\n readonly protocol: SsoProtocol;\n readonly providerPreset: SsoProviderPreset;\n}\n\nexport interface SsoStart {\n readonly authorizationURL: string;\n readonly browserBinding: string;\n}\n\nexport interface SsoExchange {\n readonly firebaseCustomToken: string;\n readonly userID: string;\n readonly spaceID: string;\n}\n\nexport const ssoBrowserBindingStorageKey = 'sneat.sso.browser-binding.v1';\n\nexport function applicationBaseURL(): string {\n return document.baseURI.replace(/\\/+$/, '');\n}\n\nexport function emailDomain(email: string): string | undefined {\n const normalized = email.trim().toLowerCase();\n if (normalized.split('@').length !== 2) {\n return undefined;\n }\n const separator = normalized.lastIndexOf('@');\n if (separator <= 0 || separator === normalized.length - 1) {\n return undefined;\n }\n const domain = normalized.slice(separator + 1);\n return domain.includes('.') && !/[\\s/@]/.test(domain) ? domain : undefined;\n}\n"]}
|
package/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Routes } from '@angular/router';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
import * as i1 from "@angular/router";
|
|
4
|
+
export declare const ssoRoutes: Routes;
|
|
4
5
|
export declare const authRoutes: Routes;
|
|
5
6
|
export declare class SneatAuthRoutingModule {
|
|
6
7
|
static ɵfac: i0.ɵɵFactoryDeclaration<SneatAuthRoutingModule, never>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { SsoConfig, SsoConfigRequest, SsoDomainChallengeRequest, SsoDiscovery, SsoExchange, SsoStart } from './sso.models';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class SsoApiService {
|
|
5
|
+
private readonly api;
|
|
6
|
+
private readonly apiBaseURL;
|
|
7
|
+
discover(email: string, loginHost?: string): Observable<SsoDiscovery>;
|
|
8
|
+
getConfig(spaceID: string): Observable<SsoConfig>;
|
|
9
|
+
saveConfig(request: SsoConfigRequest): Observable<SsoConfig>;
|
|
10
|
+
prepareDomain(request: SsoDomainChallengeRequest): Observable<SsoConfig>;
|
|
11
|
+
verifyDomain(spaceID: string): Observable<SsoConfig>;
|
|
12
|
+
disable(spaceID: string): Observable<SsoConfig>;
|
|
13
|
+
delete(spaceID: string): Observable<{
|
|
14
|
+
readonly deleted: boolean;
|
|
15
|
+
}>;
|
|
16
|
+
samlMetadataURL(): string;
|
|
17
|
+
startActivation(spaceID: string, applicationBaseURL: string): Observable<SsoStart>;
|
|
18
|
+
startLogin(email: string, applicationBaseURL: string, loginHost?: string): Observable<SsoStart>;
|
|
19
|
+
exchange(code: string, browserBinding: string): Observable<SsoExchange>;
|
|
20
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SsoApiService, never>;
|
|
21
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<SsoApiService>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class SsoCallbackPageComponent implements OnInit {
|
|
4
|
+
private readonly route;
|
|
5
|
+
private readonly router;
|
|
6
|
+
private readonly sso;
|
|
7
|
+
private readonly auth;
|
|
8
|
+
protected readonly error: import("@angular/core").WritableSignal<string | undefined>;
|
|
9
|
+
ngOnInit(): void;
|
|
10
|
+
private finishSignIn;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SsoCallbackPageComponent, never>;
|
|
12
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SsoCallbackPageComponent, "sneat-sso-callback-page", never, {}, {}, never, never, true, never>;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ssoErrorMessage(error: unknown): string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class SsoLoginPageComponent implements OnInit {
|
|
4
|
+
private readonly sso;
|
|
5
|
+
protected readonly workEmail: import("@angular/core").WritableSignal<string>;
|
|
6
|
+
protected readonly fixedDomain: import("@angular/core").WritableSignal<string | undefined>;
|
|
7
|
+
protected readonly unknownDomain: import("@angular/core").WritableSignal<string | undefined>;
|
|
8
|
+
protected readonly busy: import("@angular/core").WritableSignal<boolean>;
|
|
9
|
+
protected readonly error: import("@angular/core").WritableSignal<string | undefined>;
|
|
10
|
+
protected readonly validEmail: import("@angular/core").Signal<boolean>;
|
|
11
|
+
protected readonly regularLoginURL: import("@angular/core").Signal<string>;
|
|
12
|
+
ngOnInit(): void;
|
|
13
|
+
protected continueWithRegularLogin(): void;
|
|
14
|
+
protected continue(): Promise<void>;
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SsoLoginPageComponent, never>;
|
|
16
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SsoLoginPageComponent, "sneat-sso-login-page", never, {}, {}, never, never, true, never>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IUserSpaceBrief } from '@sneat/auth-models';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class SsoOnboardingPageComponent {
|
|
4
|
+
private readonly route;
|
|
5
|
+
private readonly router;
|
|
6
|
+
private readonly spacesService;
|
|
7
|
+
private readonly userState;
|
|
8
|
+
protected readonly domain: string;
|
|
9
|
+
protected readonly companyName: import("@angular/core").WritableSignal<string>;
|
|
10
|
+
protected readonly busy: import("@angular/core").WritableSignal<boolean>;
|
|
11
|
+
protected readonly error: import("@angular/core").WritableSignal<string | undefined>;
|
|
12
|
+
protected readonly manageableSpaces: import("@angular/core").Signal<[string, IUserSpaceBrief][]>;
|
|
13
|
+
protected createSpace(): Promise<void>;
|
|
14
|
+
protected spaceTitle(space: IUserSpaceBrief): string;
|
|
15
|
+
protected selectSpace(spaceID: string): void;
|
|
16
|
+
private goToSettings;
|
|
17
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SsoOnboardingPageComponent, never>;
|
|
18
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SsoOnboardingPageComponent, "sneat-sso-onboarding-page", never, {}, {}, never, never, true, never>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { SsoConfig, SsoProtocol, SsoProviderPreset } from './sso.models';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class SsoSettingsPageComponent implements OnInit {
|
|
5
|
+
private readonly route;
|
|
6
|
+
private readonly sso;
|
|
7
|
+
private readonly userState;
|
|
8
|
+
protected readonly spaceID: string;
|
|
9
|
+
protected readonly spaceHomeURL: string;
|
|
10
|
+
protected readonly step: import("@angular/core").WritableSignal<number>;
|
|
11
|
+
protected readonly protocol: import("@angular/core").WritableSignal<SsoProtocol>;
|
|
12
|
+
protected readonly providerPreset: import("@angular/core").WritableSignal<SsoProviderPreset>;
|
|
13
|
+
protected readonly domain: import("@angular/core").WritableSignal<string>;
|
|
14
|
+
protected readonly issuer: import("@angular/core").WritableSignal<string>;
|
|
15
|
+
protected readonly clientID: import("@angular/core").WritableSignal<string>;
|
|
16
|
+
protected readonly clientSecret: import("@angular/core").WritableSignal<string>;
|
|
17
|
+
protected readonly loginHost: import("@angular/core").WritableSignal<string>;
|
|
18
|
+
protected readonly samlMetadata: import("@angular/core").WritableSignal<string>;
|
|
19
|
+
protected readonly config: import("@angular/core").WritableSignal<SsoConfig | undefined>;
|
|
20
|
+
protected readonly loading: import("@angular/core").WritableSignal<boolean>;
|
|
21
|
+
protected readonly busy: import("@angular/core").WritableSignal<boolean>;
|
|
22
|
+
protected readonly error: import("@angular/core").WritableSignal<string | undefined>;
|
|
23
|
+
protected readonly success: import("@angular/core").WritableSignal<string | undefined>;
|
|
24
|
+
protected readonly isAdmin: import("@angular/core").Signal<boolean>;
|
|
25
|
+
protected readonly userRecordLoaded: import("@angular/core").Signal<boolean>;
|
|
26
|
+
protected readonly isOIDC: import("@angular/core").Signal<boolean>;
|
|
27
|
+
protected readonly domainValid: import("@angular/core").Signal<boolean>;
|
|
28
|
+
protected readonly domainVerified: import("@angular/core").Signal<boolean>;
|
|
29
|
+
protected readonly connectionValid: import("@angular/core").Signal<boolean>;
|
|
30
|
+
protected readonly samlMetadataURL: string;
|
|
31
|
+
protected readonly oidcRedirectURL: string;
|
|
32
|
+
ngOnInit(): void;
|
|
33
|
+
protected chooseProvider(preset: SsoProviderPreset): void;
|
|
34
|
+
protected prepareDomain(): Promise<void>;
|
|
35
|
+
protected verifyDomain(): Promise<void>;
|
|
36
|
+
protected save(): Promise<void>;
|
|
37
|
+
protected testAndActivate(): Promise<void>;
|
|
38
|
+
protected editConnection(): void;
|
|
39
|
+
protected changeDomainOrProvider(): void;
|
|
40
|
+
protected disable(): Promise<void>;
|
|
41
|
+
protected deleteConfiguration(): Promise<void>;
|
|
42
|
+
private beginOperation;
|
|
43
|
+
private clearMessages;
|
|
44
|
+
private load;
|
|
45
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SsoSettingsPageComponent, never>;
|
|
46
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SsoSettingsPageComponent, "sneat-sso-settings-page", never, {}, {}, never, never, true, never>;
|
|
47
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export interface SsoDiscovery {
|
|
2
|
+
readonly domain: string;
|
|
3
|
+
readonly configured: boolean;
|
|
4
|
+
readonly fixedDomain: boolean;
|
|
5
|
+
}
|
|
6
|
+
export type SsoProtocol = 'oidc' | 'saml';
|
|
7
|
+
export type SsoProviderPreset = 'entra' | 'okta' | 'keycloak' | 'generic_oidc' | 'generic_saml';
|
|
8
|
+
export interface SsoConfigRequest {
|
|
9
|
+
readonly spaceID: string;
|
|
10
|
+
readonly protocol: SsoProtocol;
|
|
11
|
+
readonly providerPreset: SsoProviderPreset;
|
|
12
|
+
readonly emailDomain: string;
|
|
13
|
+
readonly issuer?: string;
|
|
14
|
+
readonly clientID?: string;
|
|
15
|
+
readonly clientSecret?: string;
|
|
16
|
+
readonly loginHost?: string;
|
|
17
|
+
readonly samlIdpMetadataXML?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface SsoConfig {
|
|
20
|
+
readonly spaceID: string;
|
|
21
|
+
readonly protocol: SsoProtocol;
|
|
22
|
+
readonly providerPreset?: SsoProviderPreset;
|
|
23
|
+
readonly status: 'draft' | 'configured' | 'verification_pending' | 'active' | 'disabled';
|
|
24
|
+
readonly emailDomains: readonly string[];
|
|
25
|
+
readonly issuer: string;
|
|
26
|
+
readonly clientID: string;
|
|
27
|
+
readonly hasClientSecret: boolean;
|
|
28
|
+
readonly loginHosts?: readonly string[];
|
|
29
|
+
readonly samlIdpEntityID?: string;
|
|
30
|
+
readonly hasSamlMetadata: boolean;
|
|
31
|
+
readonly domainVerification?: SsoDomainVerification;
|
|
32
|
+
readonly verifiedAt?: string;
|
|
33
|
+
readonly verifiedByUserID?: string;
|
|
34
|
+
readonly disabledAt?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface SsoDomainVerification {
|
|
37
|
+
readonly recordName: string;
|
|
38
|
+
readonly recordValue: string;
|
|
39
|
+
readonly verifiedAt?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface SsoDomainChallengeRequest {
|
|
42
|
+
readonly spaceID: string;
|
|
43
|
+
readonly emailDomain: string;
|
|
44
|
+
readonly protocol: SsoProtocol;
|
|
45
|
+
readonly providerPreset: SsoProviderPreset;
|
|
46
|
+
}
|
|
47
|
+
export interface SsoStart {
|
|
48
|
+
readonly authorizationURL: string;
|
|
49
|
+
readonly browserBinding: string;
|
|
50
|
+
}
|
|
51
|
+
export interface SsoExchange {
|
|
52
|
+
readonly firebaseCustomToken: string;
|
|
53
|
+
readonly userID: string;
|
|
54
|
+
readonly spaceID: string;
|
|
55
|
+
}
|
|
56
|
+
export declare const ssoBrowserBindingStorageKey = "sneat.sso.browser-binding.v1";
|
|
57
|
+
export declare function applicationBaseURL(): string;
|
|
58
|
+
export declare function emailDomain(email: string): string | undefined;
|
package/package.json
CHANGED
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sneat/auth-ui",
|
|
3
|
-
"version": "0.27.
|
|
3
|
+
"version": "0.27.20",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
7
|
"peerDependencies": {
|
|
8
8
|
"@angular/common": ">=22.0.0 <23.0.0",
|
|
9
9
|
"@angular/core": ">=22.0.0 <23.0.0",
|
|
10
|
+
"@angular/forms": ">=22.0.0 <23.0.0",
|
|
11
|
+
"@angular/router": ">=22.0.0 <23.0.0",
|
|
10
12
|
"@ionic/angular": ">=9.0.0 <10.0.0",
|
|
11
13
|
"firebase": "*",
|
|
14
|
+
"@sneat/api": "^0.27.0",
|
|
15
|
+
"@sneat/auth-core": "^0.27.0",
|
|
16
|
+
"@sneat/auth-models": "^0.27.0",
|
|
12
17
|
"@sneat/core": "^0.27.0",
|
|
13
|
-
"@sneat/random": "*"
|
|
18
|
+
"@sneat/random": "*",
|
|
19
|
+
"@sneat/space-services": "^0.27.0"
|
|
14
20
|
},
|
|
15
21
|
"dependencies": {
|
|
16
22
|
"tslib": "2.8.1"
|