@rxap/oauth 15.0.0 → 16.0.0-dev.1
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/lib/container/container.component.mjs +39 -0
- package/esm2022/lib/container/container.component.module.mjs +21 -0
- package/esm2022/lib/get-o-auth-profile.method.mjs +41 -0
- package/esm2022/lib/loading/loading.component.mjs +13 -0
- package/esm2022/lib/loading/loading.component.module.mjs +25 -0
- package/esm2022/lib/o-auth-extract.guard.mjs +56 -0
- package/esm2022/lib/o-auth-redirect.guard.mjs +32 -0
- package/esm2022/lib/o-auth-routing.module.mjs +26 -0
- package/esm2022/lib/o-auth.method.mjs +117 -0
- package/esm2022/lib/o-auth.module.mjs +28 -0
- package/esm2022/lib/o-auth.service.mjs +321 -0
- package/esm2022/lib/profile.resolve.mjs +38 -0
- package/esm2022/lib/sign-in-with-redirect/sign-in-with-redirect.component.mjs +48 -0
- package/esm2022/lib/sign-in-with-redirect/sign-in-with-redirect.component.module.mjs +37 -0
- package/{esm2020 → esm2022}/single-sign-on/lib/continue/continue.component.mjs +15 -14
- package/esm2022/single-sign-on/lib/continue/continue.component.module.mjs +41 -0
- package/esm2022/single-sign-on/lib/error/error.component.mjs +45 -0
- package/esm2022/single-sign-on/lib/error/error.component.module.mjs +29 -0
- package/esm2022/single-sign-on/lib/o-auth-single-sign-on-routing.module.mjs +51 -0
- package/esm2022/single-sign-on/lib/o-auth-single-sign-on.guard.mjs +70 -0
- package/esm2022/single-sign-on/lib/o-auth-single-sign-on.service.mjs +78 -0
- package/{fesm2020 → fesm2022}/rxap-oauth-single-sign-on.mjs +60 -61
- package/fesm2022/rxap-oauth-single-sign-on.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/rxap-oauth.mjs +96 -97
- package/fesm2022/rxap-oauth.mjs.map +1 -0
- package/lib/o-auth-extract.guard.d.ts +2 -2
- package/lib/o-auth-redirect.guard.d.ts +2 -2
- package/lib/o-auth.method.d.ts +1 -1
- package/lib/profile.resolve.d.ts +2 -2
- package/package.json +27 -35
- package/single-sign-on/lib/o-auth-single-sign-on.guard.d.ts +2 -2
- package/esm2020/lib/container/container.component.mjs +0 -38
- package/esm2020/lib/container/container.component.module.mjs +0 -20
- package/esm2020/lib/get-o-auth-profile.method.mjs +0 -40
- package/esm2020/lib/loading/loading.component.mjs +0 -12
- package/esm2020/lib/loading/loading.component.module.mjs +0 -24
- package/esm2020/lib/o-auth-extract.guard.mjs +0 -55
- package/esm2020/lib/o-auth-redirect.guard.mjs +0 -31
- package/esm2020/lib/o-auth-routing.module.mjs +0 -25
- package/esm2020/lib/o-auth.method.mjs +0 -116
- package/esm2020/lib/o-auth.module.mjs +0 -27
- package/esm2020/lib/o-auth.service.mjs +0 -320
- package/esm2020/lib/profile.resolve.mjs +0 -37
- package/esm2020/lib/sign-in-with-redirect/sign-in-with-redirect.component.mjs +0 -47
- package/esm2020/lib/sign-in-with-redirect/sign-in-with-redirect.component.module.mjs +0 -36
- package/esm2020/single-sign-on/lib/continue/continue.component.module.mjs +0 -40
- package/esm2020/single-sign-on/lib/error/error.component.mjs +0 -44
- package/esm2020/single-sign-on/lib/error/error.component.module.mjs +0 -28
- package/esm2020/single-sign-on/lib/o-auth-single-sign-on-routing.module.mjs +0 -50
- package/esm2020/single-sign-on/lib/o-auth-single-sign-on.guard.mjs +0 -69
- package/esm2020/single-sign-on/lib/o-auth-single-sign-on.service.mjs +0 -77
- package/fesm2015/rxap-oauth-single-sign-on.mjs +0 -405
- package/fesm2015/rxap-oauth-single-sign-on.mjs.map +0 -1
- package/fesm2015/rxap-oauth.mjs +0 -853
- package/fesm2015/rxap-oauth.mjs.map +0 -1
- package/fesm2020/rxap-oauth-single-sign-on.mjs.map +0 -1
- package/fesm2020/rxap-oauth.mjs.map +0 -1
- /package/{esm2020 → esm2022}/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/routes.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/tokens.mjs +0 -0
- /package/{esm2020 → esm2022}/rxap-oauth.mjs +0 -0
- /package/{esm2020 → esm2022}/single-sign-on/lib/routes.mjs +0 -0
- /package/{esm2020 → esm2022}/single-sign-on/lib/tokens.mjs +0 -0
- /package/{esm2020 → esm2022}/single-sign-on/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/single-sign-on/rxap-oauth-single-sign-on.mjs +0 -0
|
@@ -1,405 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, Inject, Optional, Component, ChangeDetectionStrategy, NgModule, InjectionToken } from '@angular/core';
|
|
3
|
-
import { trigger, state, style, transition, animate } from '@angular/animations';
|
|
4
|
-
import * as i5 from '@angular/router';
|
|
5
|
-
import { Router, ActivatedRoute } from '@angular/router';
|
|
6
|
-
import { take, map } from 'rxjs/operators';
|
|
7
|
-
import * as i1 from '@rxap/oauth';
|
|
8
|
-
import { OAuthService, OAuthMethod, GetOAuthProfileMethod, PROFILE_AUTH_ENDPOINT, OAUTH_AUTH_ENDPOINT, OAUTH_SECRET, OAUTH_SSO_URL, RXAP_O_AUTH_REDIRECT_SIGN_OUT, RXAP_O_AUTH_REDIRECT_URL, RXAP_O_AUTH_REDIRECT_SIGN_IN, LoadingComponentModule, ContainerComponentModule, ContainerComponent, ProfileResolve, LoadingComponent } from '@rxap/oauth';
|
|
9
|
-
import * as i1$1 from '@angular/flex-layout/flex';
|
|
10
|
-
import * as i2 from '@angular/material/legacy-button';
|
|
11
|
-
import { MatLegacyButtonModule } from '@angular/material/legacy-button';
|
|
12
|
-
import * as i3 from '@angular/common';
|
|
13
|
-
import { CommonModule } from '@angular/common';
|
|
14
|
-
import * as i4 from '@rxap/directives';
|
|
15
|
-
import { AvatarBackgroundImageDirectiveModule } from '@rxap/directives';
|
|
16
|
-
import { __awaiter } from 'tslib';
|
|
17
|
-
import { FlexLayoutModule } from '@angular/flex-layout';
|
|
18
|
-
import { MatIconModule } from '@angular/material/icon';
|
|
19
|
-
|
|
20
|
-
class OAuthSingleSignOnService extends OAuthService {
|
|
21
|
-
// It is required to define the constructor with the injection
|
|
22
|
-
// definition. If not defined the constructor will be created by
|
|
23
|
-
// typescript without an parameters, bc the payload and redirect
|
|
24
|
-
// initialization is done in the constructor.
|
|
25
|
-
constructor(oAuthMethod, getOAuthProfileMethod, router, profileEndpoint = null, authEndpoint = null, secret = null, ssoUrl = null, redirectSignOut = null, redirectUrl = null) {
|
|
26
|
-
super(oAuthMethod, getOAuthProfileMethod, router, profileEndpoint, authEndpoint, secret, ssoUrl, redirectSignOut, redirectUrl);
|
|
27
|
-
this.payload = null;
|
|
28
|
-
this.redirect = null;
|
|
29
|
-
}
|
|
30
|
-
signInWithEmailAndPassword(email, password, remember) {
|
|
31
|
-
const _super = Object.create(null, {
|
|
32
|
-
signInWithEmailAndPassword: { get: () => super.signInWithEmailAndPassword }
|
|
33
|
-
});
|
|
34
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
-
const response = yield _super.signInWithEmailAndPassword.call(this, email, password, remember);
|
|
36
|
-
this.redirectToClient();
|
|
37
|
-
return response;
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
redirectToClient() {
|
|
41
|
-
window.location.replace(`${this.redirect}?accessToken=${this.accessToken}&refreshToken=${this.refreshToken}&expiresIn=${this.expiresIn}&payload=${this.payload}`);
|
|
42
|
-
}
|
|
43
|
-
signOut() {
|
|
44
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
-
this.clearStorage();
|
|
46
|
-
this.accessToken = null;
|
|
47
|
-
this.refreshToken = null;
|
|
48
|
-
this.expiresAt = null;
|
|
49
|
-
this._isAuthenticated = false;
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
OAuthSingleSignOnService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: OAuthSingleSignOnService, deps: [{ token: OAuthMethod }, { token: GetOAuthProfileMethod }, { token: Router }, { token: PROFILE_AUTH_ENDPOINT, optional: true }, { token: OAUTH_AUTH_ENDPOINT, optional: true }, { token: OAUTH_SECRET, optional: true }, { token: OAUTH_SSO_URL, optional: true }, { token: RXAP_O_AUTH_REDIRECT_SIGN_OUT, optional: true }, { token: RXAP_O_AUTH_REDIRECT_URL, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
54
|
-
OAuthSingleSignOnService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: OAuthSingleSignOnService });
|
|
55
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: OAuthSingleSignOnService, decorators: [{
|
|
56
|
-
type: Injectable
|
|
57
|
-
}], ctorParameters: function () {
|
|
58
|
-
return [{ type: i1.OAuthMethod, decorators: [{
|
|
59
|
-
type: Inject,
|
|
60
|
-
args: [OAuthMethod]
|
|
61
|
-
}] }, { type: i1.GetOAuthProfileMethod, decorators: [{
|
|
62
|
-
type: Inject,
|
|
63
|
-
args: [GetOAuthProfileMethod]
|
|
64
|
-
}] }, { type: i5.Router, decorators: [{
|
|
65
|
-
type: Inject,
|
|
66
|
-
args: [Router]
|
|
67
|
-
}] }, { type: undefined, decorators: [{
|
|
68
|
-
type: Optional
|
|
69
|
-
}, {
|
|
70
|
-
type: Inject,
|
|
71
|
-
args: [PROFILE_AUTH_ENDPOINT]
|
|
72
|
-
}] }, { type: undefined, decorators: [{
|
|
73
|
-
type: Optional
|
|
74
|
-
}, {
|
|
75
|
-
type: Inject,
|
|
76
|
-
args: [OAUTH_AUTH_ENDPOINT]
|
|
77
|
-
}] }, { type: undefined, decorators: [{
|
|
78
|
-
type: Optional
|
|
79
|
-
}, {
|
|
80
|
-
type: Inject,
|
|
81
|
-
args: [OAUTH_SECRET]
|
|
82
|
-
}] }, { type: undefined, decorators: [{
|
|
83
|
-
type: Optional
|
|
84
|
-
}, {
|
|
85
|
-
type: Inject,
|
|
86
|
-
args: [OAUTH_SSO_URL]
|
|
87
|
-
}] }, { type: undefined, decorators: [{
|
|
88
|
-
type: Optional
|
|
89
|
-
}, {
|
|
90
|
-
type: Inject,
|
|
91
|
-
args: [RXAP_O_AUTH_REDIRECT_SIGN_OUT]
|
|
92
|
-
}] }, { type: undefined, decorators: [{
|
|
93
|
-
type: Optional
|
|
94
|
-
}, {
|
|
95
|
-
type: Inject,
|
|
96
|
-
args: [RXAP_O_AUTH_REDIRECT_URL]
|
|
97
|
-
}] }];
|
|
98
|
-
} });
|
|
99
|
-
|
|
100
|
-
class ContinueComponent {
|
|
101
|
-
constructor(route, router, oAuthService, redirectLogin) {
|
|
102
|
-
this.route = route;
|
|
103
|
-
this.router = router;
|
|
104
|
-
this.oAuthService = oAuthService;
|
|
105
|
-
this.redirectLogin = redirectLogin;
|
|
106
|
-
}
|
|
107
|
-
ngOnInit() {
|
|
108
|
-
this.profile = this.route.data
|
|
109
|
-
.pipe(take(1), map((data) => data.profile))
|
|
110
|
-
.toPromise();
|
|
111
|
-
}
|
|
112
|
-
signOut() {
|
|
113
|
-
this.oAuthService.signOut();
|
|
114
|
-
return this.router.navigate(this.redirectLogin);
|
|
115
|
-
}
|
|
116
|
-
redirect() {
|
|
117
|
-
this.oAuthService.redirectToClient();
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
ContinueComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: ContinueComponent, deps: [{ token: ActivatedRoute }, { token: Router }, { token: OAuthService }, { token: RXAP_O_AUTH_REDIRECT_SIGN_IN }], target: i0.ɵɵFactoryTarget.Component });
|
|
121
|
-
ContinueComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: ContinueComponent, selector: "rxap-continue", host: { classAttribute: "rxap-continue" }, ngImport: i0, template: "<div [@fadeAnimation]=\"'in'\" class=\"inner mat-elevation-z5\" fxLayout=\"column\" fxLayoutAlign=\"center center\"\n fxLayoutGap=\"32px\">\n\n <div class=\"header\" fxFlex=\"nogrow\" fxLayout=\"column\" fxLayoutAlign=\"center center\">\n\n <div *ngIf=\"profile | async as p\" [name]=\"p.username\" [rxapAvatarBackgroundImage]=\"p.username\"\n class=\"avatar-icon\"></div>\n\n </div>\n\n <div class=\"content\" fxLayout=\"column\" fxLayoutGap=\"32px\">\n\n <div fxLayout=\"column\">\n\n <p><span i18n>Currently Sign In as:</span> <span class=\"username\"><br>{{(profile | async)?.username}}</span></p>\n\n </div>\n\n <div fxFlex=\"nogrow\" fxLayout=\"column\" fxLayoutAlign=\"center center\" fxLayoutGap=\"8px\">\n\n <div fxFlex=\"nogrow\">\n <button (click)=\"redirect()\" color=\"primary\" i18n mat-raised-button>Continue</button>\n </div>\n\n <div fxFlex=\"nogrow\">\n <button (click)=\"signOut()\" color=\"accent\" i18n mat-stroked-button>Change Account</button>\n </div>\n\n </div>\n\n </div>\n\n</div>\n", styles: [".inner{padding:64px;position:relative}.inner .header .avatar-icon{width:100px;height:100px;font-size:100px;border-radius:100%}.inner .content .email-input,.inner .content .password-input{width:320px}.inner .content .email-input .prefix-icon,.inner .content .password-input .prefix-icon{width:24px;height:24px;display:flex;justify-content:center;align-items:center}.inner .content .email-input ::ng-deep .mat-form-field-prefix,.inner .content .password-input ::ng-deep .mat-form-field-prefix{align-self:flex-end;margin:4px}.inner .content [type=submit]{width:128px;text-transform:uppercase}.inner .loading-bar{position:absolute;inset:auto 0 0}\n"], dependencies: [{ kind: "directive", type: i1$1.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i1$1.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i1$1.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "directive", type: i1$1.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { kind: "component", type: i2.MatLegacyButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.AvatarBackgroundImageDirective, selector: "[rxapAvatarBackgroundImage]", inputs: ["name", "rxapAvatarBackgroundImage"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }], animations: [
|
|
122
|
-
trigger('fadeAnimation', [
|
|
123
|
-
// the "in" style determines the "resting" state of the element when it is visible.
|
|
124
|
-
state('in', style({ opacity: 1 })),
|
|
125
|
-
// fade in when created. this could also be written as transition('void => *')
|
|
126
|
-
transition(':enter', [style({ opacity: 0 }), animate(300)]),
|
|
127
|
-
// fade out when destroyed. this could also be written as transition('void => *')
|
|
128
|
-
transition(':leave', animate(300, style({ opacity: 0 }))),
|
|
129
|
-
]),
|
|
130
|
-
], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
131
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: ContinueComponent, decorators: [{
|
|
132
|
-
type: Component,
|
|
133
|
-
args: [{ selector: 'rxap-continue', changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'rxap-continue' }, animations: [
|
|
134
|
-
trigger('fadeAnimation', [
|
|
135
|
-
// the "in" style determines the "resting" state of the element when it is visible.
|
|
136
|
-
state('in', style({ opacity: 1 })),
|
|
137
|
-
// fade in when created. this could also be written as transition('void => *')
|
|
138
|
-
transition(':enter', [style({ opacity: 0 }), animate(300)]),
|
|
139
|
-
// fade out when destroyed. this could also be written as transition('void => *')
|
|
140
|
-
transition(':leave', animate(300, style({ opacity: 0 }))),
|
|
141
|
-
]),
|
|
142
|
-
], template: "<div [@fadeAnimation]=\"'in'\" class=\"inner mat-elevation-z5\" fxLayout=\"column\" fxLayoutAlign=\"center center\"\n fxLayoutGap=\"32px\">\n\n <div class=\"header\" fxFlex=\"nogrow\" fxLayout=\"column\" fxLayoutAlign=\"center center\">\n\n <div *ngIf=\"profile | async as p\" [name]=\"p.username\" [rxapAvatarBackgroundImage]=\"p.username\"\n class=\"avatar-icon\"></div>\n\n </div>\n\n <div class=\"content\" fxLayout=\"column\" fxLayoutGap=\"32px\">\n\n <div fxLayout=\"column\">\n\n <p><span i18n>Currently Sign In as:</span> <span class=\"username\"><br>{{(profile | async)?.username}}</span></p>\n\n </div>\n\n <div fxFlex=\"nogrow\" fxLayout=\"column\" fxLayoutAlign=\"center center\" fxLayoutGap=\"8px\">\n\n <div fxFlex=\"nogrow\">\n <button (click)=\"redirect()\" color=\"primary\" i18n mat-raised-button>Continue</button>\n </div>\n\n <div fxFlex=\"nogrow\">\n <button (click)=\"signOut()\" color=\"accent\" i18n mat-stroked-button>Change Account</button>\n </div>\n\n </div>\n\n </div>\n\n</div>\n", styles: [".inner{padding:64px;position:relative}.inner .header .avatar-icon{width:100px;height:100px;font-size:100px;border-radius:100%}.inner .content .email-input,.inner .content .password-input{width:320px}.inner .content .email-input .prefix-icon,.inner .content .password-input .prefix-icon{width:24px;height:24px;display:flex;justify-content:center;align-items:center}.inner .content .email-input ::ng-deep .mat-form-field-prefix,.inner .content .password-input ::ng-deep .mat-form-field-prefix{align-self:flex-end;margin:4px}.inner .content [type=submit]{width:128px;text-transform:uppercase}.inner .loading-bar{position:absolute;inset:auto 0 0}\n"] }]
|
|
143
|
-
}], ctorParameters: function () {
|
|
144
|
-
return [{ type: i5.ActivatedRoute, decorators: [{
|
|
145
|
-
type: Inject,
|
|
146
|
-
args: [ActivatedRoute]
|
|
147
|
-
}] }, { type: i5.Router, decorators: [{
|
|
148
|
-
type: Inject,
|
|
149
|
-
args: [Router]
|
|
150
|
-
}] }, { type: OAuthSingleSignOnService, decorators: [{
|
|
151
|
-
type: Inject,
|
|
152
|
-
args: [OAuthService]
|
|
153
|
-
}] }, { type: undefined, decorators: [{
|
|
154
|
-
type: Inject,
|
|
155
|
-
args: [RXAP_O_AUTH_REDIRECT_SIGN_IN]
|
|
156
|
-
}] }];
|
|
157
|
-
} });
|
|
158
|
-
|
|
159
|
-
class ContinueComponentModule {
|
|
160
|
-
}
|
|
161
|
-
ContinueComponentModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: ContinueComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
162
|
-
ContinueComponentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.3", ngImport: i0, type: ContinueComponentModule, declarations: [ContinueComponent], imports: [FlexLayoutModule,
|
|
163
|
-
MatIconModule,
|
|
164
|
-
MatLegacyButtonModule,
|
|
165
|
-
CommonModule,
|
|
166
|
-
AvatarBackgroundImageDirectiveModule], exports: [ContinueComponent] });
|
|
167
|
-
ContinueComponentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: ContinueComponentModule, imports: [FlexLayoutModule,
|
|
168
|
-
MatIconModule,
|
|
169
|
-
MatLegacyButtonModule,
|
|
170
|
-
CommonModule,
|
|
171
|
-
AvatarBackgroundImageDirectiveModule] });
|
|
172
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: ContinueComponentModule, decorators: [{
|
|
173
|
-
type: NgModule,
|
|
174
|
-
args: [{
|
|
175
|
-
declarations: [
|
|
176
|
-
ContinueComponent
|
|
177
|
-
],
|
|
178
|
-
imports: [
|
|
179
|
-
FlexLayoutModule,
|
|
180
|
-
MatIconModule,
|
|
181
|
-
MatLegacyButtonModule,
|
|
182
|
-
CommonModule,
|
|
183
|
-
AvatarBackgroundImageDirectiveModule
|
|
184
|
-
],
|
|
185
|
-
exports: [
|
|
186
|
-
ContinueComponent
|
|
187
|
-
]
|
|
188
|
-
}]
|
|
189
|
-
}] });
|
|
190
|
-
|
|
191
|
-
function DefaultRedirectContinueFactory() {
|
|
192
|
-
return ['/', 'continue'];
|
|
193
|
-
}
|
|
194
|
-
const RXAP_O_AUTH_SINGLE_SIGN_ON_REDIRECT_CONTINUE = new InjectionToken('rxap/o-auth/single-sign-on/redirect-continue', {
|
|
195
|
-
providedIn: 'root',
|
|
196
|
-
factory: DefaultRedirectContinueFactory
|
|
197
|
-
});
|
|
198
|
-
const RXAP_O_AUTH_SSO_REDIRECT_CONTINUE_DISABLED = new InjectionToken('rxap/o-auth/single-sign-on/redirect-continue-disabled');
|
|
199
|
-
|
|
200
|
-
class OAuthSingleSignOnGuard {
|
|
201
|
-
constructor(authentication, router, redirectContinue, redirectLogin, redirectContinueDisabled) {
|
|
202
|
-
this.authentication = authentication;
|
|
203
|
-
this.router = router;
|
|
204
|
-
this.redirectContinue = redirectContinue;
|
|
205
|
-
this.redirectLogin = redirectLogin;
|
|
206
|
-
this.redirectContinueDisabled = redirectContinueDisabled;
|
|
207
|
-
}
|
|
208
|
-
canActivate(route) {
|
|
209
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
210
|
-
const redirect = route.queryParamMap.get('redirect');
|
|
211
|
-
const secret = route.queryParamMap.get('secret');
|
|
212
|
-
const payload = route.queryParamMap.get('payload');
|
|
213
|
-
const action = route.queryParamMap.get('action');
|
|
214
|
-
if (!redirect || !secret) {
|
|
215
|
-
console.warn(`The query params 'redirect' or 'secret' is not defined!`);
|
|
216
|
-
return this.router.createUrlTree(['error']);
|
|
217
|
-
}
|
|
218
|
-
this.authentication.redirect = atob(redirect);
|
|
219
|
-
this.authentication.payload = payload;
|
|
220
|
-
this.authentication.secret = secret;
|
|
221
|
-
if (action) {
|
|
222
|
-
if (action === 'signOut') {
|
|
223
|
-
yield this.authentication.signOut();
|
|
224
|
-
return this.router.createUrlTree(this.redirectLogin);
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
const isAuthenticated = yield this.authentication.isAuthenticated();
|
|
228
|
-
console.log('isAuthenticated', isAuthenticated);
|
|
229
|
-
if (isAuthenticated) {
|
|
230
|
-
if (this.redirectContinueDisabled) {
|
|
231
|
-
this.authentication.redirectToClient();
|
|
232
|
-
return true;
|
|
233
|
-
}
|
|
234
|
-
return this.router.createUrlTree(this.redirectContinue);
|
|
235
|
-
}
|
|
236
|
-
return this.router.createUrlTree(this.redirectLogin);
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
OAuthSingleSignOnGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: OAuthSingleSignOnGuard, deps: [{ token: OAuthService }, { token: Router }, { token: RXAP_O_AUTH_SINGLE_SIGN_ON_REDIRECT_CONTINUE }, { token: RXAP_O_AUTH_REDIRECT_SIGN_IN }, { token: RXAP_O_AUTH_SSO_REDIRECT_CONTINUE_DISABLED, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
241
|
-
OAuthSingleSignOnGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: OAuthSingleSignOnGuard });
|
|
242
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: OAuthSingleSignOnGuard, decorators: [{
|
|
243
|
-
type: Injectable
|
|
244
|
-
}], ctorParameters: function () {
|
|
245
|
-
return [{ type: OAuthSingleSignOnService, decorators: [{
|
|
246
|
-
type: Inject,
|
|
247
|
-
args: [OAuthService]
|
|
248
|
-
}] }, { type: i5.Router, decorators: [{
|
|
249
|
-
type: Inject,
|
|
250
|
-
args: [Router]
|
|
251
|
-
}] }, { type: undefined, decorators: [{
|
|
252
|
-
type: Inject,
|
|
253
|
-
args: [RXAP_O_AUTH_SINGLE_SIGN_ON_REDIRECT_CONTINUE]
|
|
254
|
-
}] }, { type: undefined, decorators: [{
|
|
255
|
-
type: Inject,
|
|
256
|
-
args: [RXAP_O_AUTH_REDIRECT_SIGN_IN]
|
|
257
|
-
}] }, { type: undefined, decorators: [{
|
|
258
|
-
type: Optional
|
|
259
|
-
}, {
|
|
260
|
-
type: Inject,
|
|
261
|
-
args: [RXAP_O_AUTH_SSO_REDIRECT_CONTINUE_DISABLED]
|
|
262
|
-
}] }];
|
|
263
|
-
} });
|
|
264
|
-
|
|
265
|
-
class ErrorComponent {
|
|
266
|
-
get topLevelDomain() {
|
|
267
|
-
const match = location.hostname.match(/([^.]+\.[^.]+$)/);
|
|
268
|
-
if (match) {
|
|
269
|
-
return match[0];
|
|
270
|
-
}
|
|
271
|
-
else {
|
|
272
|
-
return location.hostname;
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
get mainApplicationUrl() {
|
|
276
|
-
return `${location.protocol}//${this.topLevelDomain}`;
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
ErrorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: ErrorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
280
|
-
ErrorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: ErrorComponent, selector: "rxap-error", host: { classAttribute: "rxap-error" }, ngImport: i0, template: "<div [@fadeAnimation]=\"'in'\" class=\"inner mat-elevation-z5\" fxLayout=\"column\" fxLayoutAlign=\"center center\"\n fxLayoutGap=\"32px\">\n\n <div class=\"content\" fxLayout=\"column\" fxLayoutGap=\"32px\">\n\n <div fxLayout=\"column\" fxLayoutGap=\"8px\">\n\n <h2 i18n>Error</h2>\n <p i18n>Please open the main application again.</p>\n <a [href]=\"mainApplicationUrl\" color=\"primary\" mat-raised-button>\n <ng-container i18n>Navigate to main application</ng-container>\n </a>\n\n </div>\n\n </div>\n\n</div>\n", styles: [".inner{padding:64px;position:relative}\n"], dependencies: [{ kind: "directive", type: i1$1.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i1$1.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }, { kind: "directive", type: i1$1.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { kind: "component", type: i2.MatLegacyAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-icon-button], a[mat-fab], a[mat-mini-fab], a[mat-stroked-button], a[mat-flat-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }], animations: [
|
|
281
|
-
trigger('fadeAnimation', [
|
|
282
|
-
// the "in" style determines the "resting" state of the element when it is visible.
|
|
283
|
-
state('in', style({ opacity: 1 })),
|
|
284
|
-
// fade in when created. this could also be written as transition('void => *')
|
|
285
|
-
transition(':enter', [style({ opacity: 0 }), animate(300)]),
|
|
286
|
-
// fade out when destroyed. this could also be written as transition('void => *')
|
|
287
|
-
transition(':leave', animate(300, style({ opacity: 0 })))
|
|
288
|
-
])
|
|
289
|
-
], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
290
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: ErrorComponent, decorators: [{
|
|
291
|
-
type: Component,
|
|
292
|
-
args: [{ selector: 'rxap-error', changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'rxap-error' }, animations: [
|
|
293
|
-
trigger('fadeAnimation', [
|
|
294
|
-
// the "in" style determines the "resting" state of the element when it is visible.
|
|
295
|
-
state('in', style({ opacity: 1 })),
|
|
296
|
-
// fade in when created. this could also be written as transition('void => *')
|
|
297
|
-
transition(':enter', [style({ opacity: 0 }), animate(300)]),
|
|
298
|
-
// fade out when destroyed. this could also be written as transition('void => *')
|
|
299
|
-
transition(':leave', animate(300, style({ opacity: 0 })))
|
|
300
|
-
])
|
|
301
|
-
], template: "<div [@fadeAnimation]=\"'in'\" class=\"inner mat-elevation-z5\" fxLayout=\"column\" fxLayoutAlign=\"center center\"\n fxLayoutGap=\"32px\">\n\n <div class=\"content\" fxLayout=\"column\" fxLayoutGap=\"32px\">\n\n <div fxLayout=\"column\" fxLayoutGap=\"8px\">\n\n <h2 i18n>Error</h2>\n <p i18n>Please open the main application again.</p>\n <a [href]=\"mainApplicationUrl\" color=\"primary\" mat-raised-button>\n <ng-container i18n>Navigate to main application</ng-container>\n </a>\n\n </div>\n\n </div>\n\n</div>\n", styles: [".inner{padding:64px;position:relative}\n"] }]
|
|
302
|
-
}] });
|
|
303
|
-
|
|
304
|
-
class ErrorComponentModule {
|
|
305
|
-
}
|
|
306
|
-
ErrorComponentModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: ErrorComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
307
|
-
ErrorComponentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.3", ngImport: i0, type: ErrorComponentModule, declarations: [ErrorComponent], imports: [FlexLayoutModule,
|
|
308
|
-
MatLegacyButtonModule], exports: [ErrorComponent] });
|
|
309
|
-
ErrorComponentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: ErrorComponentModule, imports: [FlexLayoutModule,
|
|
310
|
-
MatLegacyButtonModule] });
|
|
311
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: ErrorComponentModule, decorators: [{
|
|
312
|
-
type: NgModule,
|
|
313
|
-
args: [{
|
|
314
|
-
declarations: [
|
|
315
|
-
ErrorComponent
|
|
316
|
-
],
|
|
317
|
-
imports: [
|
|
318
|
-
FlexLayoutModule,
|
|
319
|
-
MatLegacyButtonModule
|
|
320
|
-
],
|
|
321
|
-
exports: [
|
|
322
|
-
ErrorComponent
|
|
323
|
-
]
|
|
324
|
-
}]
|
|
325
|
-
}] });
|
|
326
|
-
|
|
327
|
-
class OAuthSingleSignOnRoutingModule {
|
|
328
|
-
static forRouting(options = {}) {
|
|
329
|
-
const providers = [
|
|
330
|
-
OAuthSingleSignOnGuard
|
|
331
|
-
];
|
|
332
|
-
if (options.redirectContinueDisabled) {
|
|
333
|
-
providers.push({
|
|
334
|
-
provide: RXAP_O_AUTH_SSO_REDIRECT_CONTINUE_DISABLED,
|
|
335
|
-
useValue: options.redirectContinueDisabled
|
|
336
|
-
});
|
|
337
|
-
}
|
|
338
|
-
return {
|
|
339
|
-
ngModule: OAuthSingleSignOnRoutingModule,
|
|
340
|
-
providers
|
|
341
|
-
};
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
OAuthSingleSignOnRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: OAuthSingleSignOnRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
345
|
-
OAuthSingleSignOnRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.3", ngImport: i0, type: OAuthSingleSignOnRoutingModule, exports: [ContinueComponentModule,
|
|
346
|
-
LoadingComponentModule,
|
|
347
|
-
ContainerComponentModule,
|
|
348
|
-
ErrorComponentModule] });
|
|
349
|
-
OAuthSingleSignOnRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: OAuthSingleSignOnRoutingModule, providers: [
|
|
350
|
-
OAuthSingleSignOnGuard
|
|
351
|
-
], imports: [ContinueComponentModule,
|
|
352
|
-
LoadingComponentModule,
|
|
353
|
-
ContainerComponentModule,
|
|
354
|
-
ErrorComponentModule] });
|
|
355
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: OAuthSingleSignOnRoutingModule, decorators: [{
|
|
356
|
-
type: NgModule,
|
|
357
|
-
args: [{
|
|
358
|
-
exports: [
|
|
359
|
-
ContinueComponentModule,
|
|
360
|
-
LoadingComponentModule,
|
|
361
|
-
ContainerComponentModule,
|
|
362
|
-
ErrorComponentModule
|
|
363
|
-
],
|
|
364
|
-
providers: [
|
|
365
|
-
OAuthSingleSignOnGuard
|
|
366
|
-
]
|
|
367
|
-
}]
|
|
368
|
-
}] });
|
|
369
|
-
|
|
370
|
-
const RXAP_O_AUTH_SINGLE_SIGN_ON_ROUTES = [
|
|
371
|
-
{
|
|
372
|
-
path: '',
|
|
373
|
-
component: ContainerComponent,
|
|
374
|
-
children: [
|
|
375
|
-
{
|
|
376
|
-
path: 'continue',
|
|
377
|
-
component: ContinueComponent,
|
|
378
|
-
resolve: {
|
|
379
|
-
profile: ProfileResolve
|
|
380
|
-
}
|
|
381
|
-
},
|
|
382
|
-
{
|
|
383
|
-
path: 'error',
|
|
384
|
-
component: ErrorComponent
|
|
385
|
-
},
|
|
386
|
-
{
|
|
387
|
-
path: '',
|
|
388
|
-
canActivate: [OAuthSingleSignOnGuard],
|
|
389
|
-
component: LoadingComponent
|
|
390
|
-
},
|
|
391
|
-
{
|
|
392
|
-
path: '**',
|
|
393
|
-
redirectTo: ''
|
|
394
|
-
}
|
|
395
|
-
]
|
|
396
|
-
}
|
|
397
|
-
];
|
|
398
|
-
|
|
399
|
-
/**
|
|
400
|
-
* Generated bundle index. Do not edit.
|
|
401
|
-
*/
|
|
402
|
-
|
|
403
|
-
export { ContinueComponent, ContinueComponentModule, DefaultRedirectContinueFactory, ErrorComponent, ErrorComponentModule, OAuthSingleSignOnGuard, OAuthSingleSignOnRoutingModule, OAuthSingleSignOnService, RXAP_O_AUTH_SINGLE_SIGN_ON_REDIRECT_CONTINUE, RXAP_O_AUTH_SINGLE_SIGN_ON_ROUTES, RXAP_O_AUTH_SSO_REDIRECT_CONTINUE_DISABLED };
|
|
404
|
-
//# sourceMappingURL=rxap-oauth-single-sign-on.mjs.map
|
|
405
|
-
//# sourceMappingURL=rxap-oauth-single-sign-on.mjs.map
|