diff --git a/console/src/app/pages/projects/apps/app-detail/app-detail.component.html b/console/src/app/pages/projects/apps/app-detail/app-detail.component.html index 52971da7d..0f795200b 100644 --- a/console/src/app/pages/projects/apps/app-detail/app-detail.component.html +++ b/console/src/app/pages/projects/apps/app-detail/app-detail.component.html @@ -422,19 +422,21 @@ - + - - + + + + - - - + + + diff --git a/console/src/app/pages/projects/apps/app-detail/app-detail.component.scss b/console/src/app/pages/projects/apps/app-detail/app-detail.component.scss index 6097028e6..0cde533b8 100644 --- a/console/src/app/pages/projects/apps/app-detail/app-detail.component.scss +++ b/console/src/app/pages/projects/apps/app-detail/app-detail.component.scss @@ -304,8 +304,9 @@ text-decoration: none; color: inherit; font-family: inherit; + text-decoration: underline; +} - &:hover { - text-decoration: underline; - } +.download-button { + margin-left: 1rem; } diff --git a/console/src/app/pages/projects/apps/app-detail/app-detail.component.ts b/console/src/app/pages/projects/apps/app-detail/app-detail.component.ts index 5d8170c0c..638a1e56b 100644 --- a/console/src/app/pages/projects/apps/app-detail/app-detail.component.ts +++ b/console/src/app/pages/projects/apps/app-detail/app-detail.component.ts @@ -8,7 +8,7 @@ import { ActivatedRoute, Router } from '@angular/router'; import { TranslateService } from '@ngx-translate/core'; import { Buffer } from 'buffer'; import { Duration } from 'google-protobuf/google/protobuf/duration_pb'; -import { Subject, Subscription } from 'rxjs'; +import { mergeMap, Subject, Subscription } from 'rxjs'; import { map, take } from 'rxjs/operators'; import { RadioItemAuthType } from 'src/app/modules/app-radio/app-auth-method-radio/app-auth-method-radio.component'; import { ChangeType } from 'src/app/modules/changes/changes.component'; @@ -80,30 +80,27 @@ export class AppDetailComponent implements OnInit, OnDestroy { public appId: string = ''; public app?: App.AsObject; - public environmentMap$ = this.envSvc.env.pipe( - map((env) => { - return { - issuer: env.issuer, - adminServiceUrl: `${env.api}/admin/v1`, - mgmtServiceUrl: `${env.api}/management/v1`, - authServiceUrl: `${env.api}/auth/v1`, - samlCertificateURL: `${env.issuer}/saml/v2/certificate`, - samlSSO: `${env.issuer}/saml/v2/SSO`, - samlSLO: `${env.issuer}/saml/v2/SLO`, - }; - }), + public apiURLs$ = this.envSvc.env.pipe( + mergeMap((env) => + this.wellknownURLs$.pipe( + map((wellknown) => { + return [ + ['Issuer', env.issuer], + ['Admin Service URL', `${env.api}/admin/v1`], + ['Management Service URL', `${env.api}/management/v1`], + ['Auth Service URL', `${env.api}/auth/v1`], + ...wellknown.filter( + ([k, v]) => k === 'Revocation Endpoint' || k === 'JKWS URI' || k === 'Introspection Endpoint', + ), + ]; + }), + ), + ), ); - public apiMap$ = this.envSvc.env.pipe( - map((env) => { - return { - issuer: env.issuer, - adminServiceUrl: `${env.api}/admin/v1`, - mgmtServiceUrl: `${env.api}/management/v1`, - authServiceUrl: `${env.api}/auth/v1`, - }; - }), - ); - public samlMap$ = this.envSvc.env.pipe( + + public issuer$ = this.apiURLs$.pipe(map((urls) => urls.find(([k, v]) => k === 'Issuer')?.[1])); + + public samlURLs$ = this.envSvc.env.pipe( map((env) => { return { samlCertificateURL: `${env.issuer}/saml/v2/certificate`, @@ -112,7 +109,21 @@ export class AppDetailComponent implements OnInit, OnDestroy { }; }), ); - public wellknownMap$ = this.envSvc.wellknown; + + public wellknownURLs$ = this.envSvc.wellknown.pipe( + map((wellknown) => { + return [ + ['Authorization Endpoint', wellknown.authorization_endpoint], + ['Device Authorization Endpoint', wellknown.device_authorization_endpoint], + ['End Session Endpoint', wellknown.end_session_endpoint], + ['Introspection Endpoint', wellknown.introspection_endpoint], + ['JKWS URI', wellknown.jwks_uri], + ['Revocation Endpoint', wellknown.revocation_endpoint], + ['Token Endpoint', wellknown.token_endpoint], + ['Userinfo Endpoint', wellknown.userinfo_endpoint], + ]; + }), + ); public oidcResponseTypes: OIDCResponseType[] = [ OIDCResponseType.OIDC_RESPONSE_TYPE_CODE, @@ -217,9 +228,6 @@ export class AppDetailComponent implements OnInit, OnDestroy { if (!this.app) { this.app = new App().toObject(); } - if (!this.app.samlConfig) { - this.app.samlConfig = new SAMLConfig().toObject(); - } let minimalMetadata = this.entityId?.value && this.acsURL?.value @@ -231,6 +239,14 @@ export class AppDetailComponent implements OnInit, OnDestroy { ` : ''; + if (!minimalMetadata && !this.metadataUrl?.value) { + return; + } + + if (!this.app.samlConfig) { + this.app.samlConfig = new SAMLConfig().toObject(); + } + if (minimalMetadata) { const base64 = Buffer.from(minimalMetadata, 'utf-8').toString('base64'); this.app.samlConfig.metadataXml = base64; diff --git a/console/src/app/services/environment.service.ts b/console/src/app/services/environment.service.ts index 22048d93e..b3e75a173 100644 --- a/console/src/app/services/environment.service.ts +++ b/console/src/app/services/environment.service.ts @@ -18,10 +18,13 @@ export interface Environment { interface WellKnown { authorization_endpoint: string; + device_authorization_endpoint: string; end_session_endpoint: string; introspection_endpoint: string; token_endpoint: string; userinfo_endpoint: string; + jwks_uri: string; + revocation_endpoint: string; } @Injectable({ providedIn: 'root',