@rxap/oauth 12.0.11 → 12.1.0

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.
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common/http'), require('@angular/router'), require('@angular/animations'), require('@angular/material/progress-bar'), require('@angular/material/icon'), require('@angular/material/button'), require('@angular/flex-layout/flex'), require('@angular/common'), require('@angular/material/card'), require('@angular/flex-layout')) :
3
- typeof define === 'function' && define.amd ? define('@rxap/oauth', ['exports', '@angular/core', '@angular/common/http', '@angular/router', '@angular/animations', '@angular/material/progress-bar', '@angular/material/icon', '@angular/material/button', '@angular/flex-layout/flex', '@angular/common', '@angular/material/card', '@angular/flex-layout'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.rxap = global.rxap || {}, global.rxap.oauth = {}), global.ng.core, global.ng.common.http, global.ng.router, global.ng.animations, global.ng.material.progressBar, global.ng.material.icon, global.ng.material.button, global.ng.flexLayout.flex, global.ng.common, global.ng.material.card, global.ng.flexLayout));
5
- })(this, (function (exports, i0, i1, i1$1, animations, i1$2, i2, i3, i4, common, card, flexLayout) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common/http'), require('@angular/router'), require('rxjs'), require('@rxap/authentication'), require('@angular/animations'), require('@angular/material/progress-bar'), require('@angular/material/icon'), require('@angular/material/button'), require('@angular/flex-layout/flex'), require('@angular/common'), require('@angular/material/card'), require('@angular/flex-layout')) :
3
+ typeof define === 'function' && define.amd ? define('@rxap/oauth', ['exports', '@angular/core', '@angular/common/http', '@angular/router', 'rxjs', '@rxap/authentication', '@angular/animations', '@angular/material/progress-bar', '@angular/material/icon', '@angular/material/button', '@angular/flex-layout/flex', '@angular/common', '@angular/material/card', '@angular/flex-layout'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.rxap = global.rxap || {}, global.rxap.oauth = {}), global.ng.core, global.ng.common.http, global.ng.router, global.rxjs, global.authentication, global.ng.animations, global.ng.material.progressBar, global.ng.material.icon, global.ng.material.button, global.ng.flexLayout.flex, global.ng.common, global.ng.material.card, global.ng.flexLayout));
5
+ })(this, (function (exports, i0, i1, i1$1, rxjs, authentication, animations, i1$2, i2, i3, i4, common, card, flexLayout) { 'use strict';
6
6
 
7
7
  function _interopNamespace(e) {
8
8
  if (e && e.__esModule) return e;
@@ -552,6 +552,7 @@
552
552
  this.redirectSignOut = redirectSignOut;
553
553
  this.redirectUrl = redirectUrl;
554
554
  this.clientId = clientId;
555
+ this.events$ = new rxjs.ReplaySubject();
555
556
  this._isAuthenticated = null;
556
557
  }
557
558
  Object.defineProperty(OAuthService.prototype, "expiresAt", {
@@ -712,6 +713,7 @@
712
713
  var _a;
713
714
  return __awaiter(this, void 0, void 0, function () {
714
715
  var response;
716
+ var _this = this;
715
717
  return __generator(this, function (_c) {
716
718
  switch (_c.label) {
717
719
  case 0:
@@ -727,6 +729,9 @@
727
729
  authEndpoint: this.authEndpoint,
728
730
  secret: this.secret,
729
731
  clientId: (_a = this.clientId) !== null && _a !== void 0 ? _a : undefined
732
+ }).catch(function (e) {
733
+ _this.events$.next({ type: authentication.AuthenticationEventType.OnAuthError });
734
+ throw e;
730
735
  })];
731
736
  case 1:
732
737
  response = _c.sent();
@@ -791,7 +796,9 @@
791
796
  }
792
797
  location.replace(this.ssoUrl + "?redirect=" + btoa(this.redirectUrl) + "&secret=" + this.secret + "&action=signOut");
793
798
  _c.label = 3;
794
- case 3: return [2 /*return*/];
799
+ case 3:
800
+ this.events$.next({ type: authentication.AuthenticationEventType.OnLogout });
801
+ return [2 /*return*/];
795
802
  }
796
803
  });
797
804
  });
@@ -824,6 +831,7 @@
824
831
  this.removeItem(EXPIRES_AT_LOCAL_STORAGE_KEY);
825
832
  }
826
833
  this._isAuthenticated = true;
834
+ this.events$.next({ type: authentication.AuthenticationEventType.OnAuthSuccess });
827
835
  };
828
836
  OAuthService.prototype.getKey = function (key) {
829
837
  return [this.secret, key].join('__');
@@ -1 +1 @@
1
- {"version":3,"file":"rxap-oauth.umd.js","sources":["../../../../libs/oauth/src/lib/get-o-auth-profile.method.ts","../../../../node_modules/tslib/tslib.es6.js","../../../../libs/oauth/src/lib/o-auth.method.ts","../../../../libs/oauth/src/lib/tokens.ts","../../../../libs/oauth/src/lib/o-auth.service.ts","../../../../libs/oauth/src/lib/o-auth-extract.guard.ts","../../../../libs/oauth/src/lib/o-auth-redirect.guard.ts","../../../../libs/oauth/src/lib/o-auth.module.ts","../../../../libs/oauth/src/lib/container/container.component.ts","../../../../libs/oauth/src/lib/container/container.component.html","../../../../libs/oauth/src/lib/loading/loading.component.ts","../../../../libs/oauth/src/lib/loading/loading.component.html","../../../../libs/oauth/src/lib/sign-in-with-redirect/sign-in-with-redirect.component.ts","../../../../libs/oauth/src/lib/sign-in-with-redirect/sign-in-with-redirect.component.html","../../../../libs/oauth/src/lib/routes.ts","../../../../libs/oauth/src/lib/profile.resolve.ts","../../../../libs/oauth/src/lib/container/container.component.module.ts","../../../../libs/oauth/src/lib/loading/loading.component.module.ts","../../../../libs/oauth/src/lib/sign-in-with-redirect/sign-in-with-redirect.component.module.ts","../../../../libs/oauth/src/lib/o-auth-routing.module.ts","../../../../libs/oauth/src/rxap-oauth.ts"],"sourcesContent":["import {\n Inject,\n Injectable,\n InjectionToken,\n Optional\n} from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport { Method } from '@rxap/utilities/rxjs';\n\nexport const PROFILE_AUTH_ENDPOINT = new InjectionToken(\n 'PROFILE_AUTH_ENDPOINT'\n);\n\nexport interface GetOAuthProfileMethodParameters {\n accessToken: string;\n profileEndpoint?: string | null;\n withCredentials?: boolean;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class GetOAuthProfileMethod<T = any>\n implements Method<T, GetOAuthProfileMethodParameters>\n{\n constructor(\n @Inject(HttpClient)\n private readonly http: HttpClient,\n @Optional()\n @Inject(PROFILE_AUTH_ENDPOINT)\n public profileEndpoint: string | null = null\n ) {}\n\n public call(parameters: GetOAuthProfileMethodParameters): Promise<T> {\n const profileEndpoint = parameters.profileEndpoint ?? this.profileEndpoint;\n\n if (!profileEndpoint) {\n throw new Error('The profile endpoint is not defined');\n }\n\n return this.http\n .get<T>(profileEndpoint, {\n headers: {\n Authorization: `Bearer ${parameters.accessToken}`,\n },\n withCredentials: parameters.withCredentials ?? true,\n })\n .toPromise();\n }\n}\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from) {\r\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\r\n to[j] = from[i];\r\n return to;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","import {\n Injectable,\n Inject\n} from '@angular/core';\nimport {\n HttpClient,\n HttpHeaders\n} from '@angular/common/http';\nimport { Method } from '@rxap/utilities/rxjs';\n\nexport interface OAuthMethodWithUsernamePasswordParameters {\n grantType?: string;\n username: string;\n password: string;\n secret: string;\n clientId?: string;\n authEndpoint: string;\n}\n\nexport interface OAuthMethodWithRefreshTokenParameters {\n grantType?: string;\n refreshToken: string;\n secret: string;\n clientId?: string;\n authEndpoint: string;\n}\n\nexport type OAuthMethodParameters = (\n | OAuthMethodWithUsernamePasswordParameters\n | OAuthMethodWithRefreshTokenParameters\n) & { withCredentials?: boolean };\n\nexport function IsOAuthMethodWithRefreshTokenParameters(\n parameters: OAuthMethodParameters\n): parameters is OAuthMethodWithRefreshTokenParameters {\n // eslint-disable-next-line no-prototype-builtins\n return parameters.hasOwnProperty('refreshToken');\n}\n\nexport function IsOAuthMethodWithUsernamePasswordParameters(\n parameters: OAuthMethodParameters\n): parameters is OAuthMethodWithUsernamePasswordParameters {\n // eslint-disable-next-line no-prototype-builtins\n return (\n parameters.hasOwnProperty('username') &&\n parameters.hasOwnProperty('password')\n );\n}\n\nexport function AssertOAuthMethodWithUsernamePasswordParameters(\n parameters: OAuthMethodParameters\n): asserts parameters is OAuthMethodWithUsernamePasswordParameters {\n if (!IsOAuthMethodWithUsernamePasswordParameters(parameters)) {\n throw new Error(\n 'The grant type password requires the parameters username and password'\n );\n }\n}\n\nexport function AssertOAuthMethodWithRefreshTokenParameters(\n parameters: OAuthMethodParameters\n): asserts parameters is OAuthMethodWithRefreshTokenParameters {\n if (!IsOAuthMethodWithRefreshTokenParameters(parameters)) {\n throw new Error(\n 'The grant type refresh token requires the parameters refreshToken'\n );\n }\n}\n\nexport function AssertOAuthMethodParameters(\n parameters: any\n): asserts parameters is OAuthMethodParameters {\n if (!parameters.authEndpoint) {\n throw new Error('The authEndpoint parameter must be defined');\n }\n if (!parameters.secret) {\n throw new Error('The secret parameter must be defined');\n }\n if (parameters.grantType) {\n switch (parameters.grantType) {\n case 'password':\n AssertOAuthMethodWithUsernamePasswordParameters(parameters);\n break;\n\n case 'refresh_token':\n AssertOAuthMethodWithRefreshTokenParameters(parameters);\n break;\n\n default:\n throw new Error(\n `The grant type '${parameters.grantType}' is not supported`\n );\n }\n } else {\n if (\n !IsOAuthMethodWithRefreshTokenParameters(parameters) &&\n !IsOAuthMethodWithUsernamePasswordParameters(parameters)\n ) {\n throw new Error(\n 'Either the refresh token or the username and password must be defined'\n );\n }\n }\n}\n\nexport interface OAuthResponse {\n access_token: string;\n refresh_token: string;\n expires_in: number;\n}\n\nexport interface OAuthMethodResponse {\n accessToken: string;\n refreshToken: string;\n expiresIn: number;\n expiresAt: Date;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class OAuthMethod\n implements Method<OAuthMethodResponse, OAuthMethodParameters>\n{\n constructor(\n @Inject(HttpClient)\n private readonly http: HttpClient\n ) {}\n\n public async call(\n parameters: OAuthMethodParameters\n ): Promise<OAuthMethodResponse> {\n AssertOAuthMethodParameters(parameters);\n\n const params = new URLSearchParams();\n const grantType = this.getGrantType(parameters);\n params.append('grant_type', grantType);\n switch (grantType) {\n case 'password':\n AssertOAuthMethodWithUsernamePasswordParameters(parameters);\n params.append('username', parameters.username);\n params.append('password', parameters.password);\n break;\n\n case 'refresh_token':\n AssertOAuthMethodWithRefreshTokenParameters(parameters);\n params.append('refresh_token', parameters.refreshToken);\n break;\n\n default:\n throw new Error('Not supported grant type');\n }\n\n let headers = new HttpHeaders();\n\n headers = headers.append('Content-type', 'application/x-www-form-urlencoded; charset=utf-8');\n\n if (parameters.secret && parameters.clientId) {\n params.append('client_id', parameters.clientId);\n params.append('client_secret', parameters.secret);\n } else {\n headers = headers.append('Authorization', `Basic ${parameters.secret}`);\n }\n\n const response = await this.http\n .post<OAuthResponse>(parameters.authEndpoint, params.toString(), {\n headers,\n withCredentials: parameters.withCredentials ?? true,\n })\n .toPromise();\n\n return {\n accessToken: response.access_token,\n refreshToken: response.refresh_token,\n expiresIn: response.expires_in,\n expiresAt: new Date(Date.now() + response.expires_in * 1000),\n };\n }\n\n private getGrantType(parameters: OAuthMethodParameters) {\n if (parameters.grantType) {\n return parameters.grantType;\n }\n\n if (IsOAuthMethodWithRefreshTokenParameters(parameters)) {\n return 'refresh_token';\n }\n\n if (IsOAuthMethodWithUsernamePasswordParameters(parameters)) {\n return 'password';\n }\n\n throw new Error('Could not guess the grant type');\n }\n}\n","import { InjectionToken } from '@angular/core';\n\nexport function DefaultRedirectSignInFactory(): string[] {\n return [ '/', 'authentication', 'login' ];\n}\n\nexport const RXAP_O_AUTH_REDIRECT_SIGN_IN = new InjectionToken('rxap/o-auth/redirect-sign-in', {\n providedIn: 'root',\n factory: DefaultRedirectSignInFactory\n});\n\nexport const RXAP_O_AUTH_REDIRECT_SIGN_OUT = new InjectionToken('rxap/o-auth/redirect-sign-out');\n\nexport function DefaultRedirectUrl(): string {\n return location.origin + '/oauth';\n}\n\nexport const RXAP_O_AUTH_REDIRECT_URL = new InjectionToken('rxap/o-auth/redirect-url', {\n providedIn: 'root',\n factory: DefaultRedirectUrl\n});\n","import {\n Inject,\n Injectable,\n InjectionToken,\n Optional\n} from '@angular/core';\nimport {\n GetOAuthProfileMethod,\n PROFILE_AUTH_ENDPOINT\n} from './get-o-auth-profile.method';\nimport {\n OAuthMethod,\n OAuthMethodResponse\n} from './o-auth.method';\nimport {\n RXAP_O_AUTH_REDIRECT_SIGN_OUT,\n RXAP_O_AUTH_REDIRECT_URL\n} from './tokens';\nimport { Router } from '@angular/router';\n\nexport const OAUTH_SECRET = new InjectionToken('OAUTH_SECRET');\nexport const OAUTH_AUTH_ENDPOINT = new InjectionToken('OAUTH_AUTH_ENDPOINT');\nexport const OAUTH_SSO_URL = new InjectionToken('OAUTH_SSO_URL');\nexport const OAUTH_CLIENT_ID = new InjectionToken('OAUTH_CLIENT_ID');\n\nexport const ACCESS_TOKEN_LOCAL_STORAGE_KEY = 'access_token';\nexport const REFRESH_TOKEN_LOCAL_STORAGE_KEY = 'refresh_token';\nexport const EXPIRES_AT_LOCAL_STORAGE_KEY = 'expires_at';\nexport const REMEMBER_LOCAL_STORAGE_KEY = 'remember';\n\nexport interface OAuthStatus {\n accessToken: string;\n refreshToken?: string | null;\n expiresIn: number;\n expiresAt: Date;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class OAuthService<Profile = any> {\n get expiresAt(): Date | null {\n const expiresAt = this.getItem(EXPIRES_AT_LOCAL_STORAGE_KEY);\n if (expiresAt) {\n return new Date(\n parseInt(this.getItem(EXPIRES_AT_LOCAL_STORAGE_KEY)!, 10)\n );\n }\n return null;\n }\n\n set expiresAt(value: Date | null) {\n if (value) {\n this.setItem(EXPIRES_AT_LOCAL_STORAGE_KEY, value.getTime().toFixed(0));\n } else {\n this.removeItem(EXPIRES_AT_LOCAL_STORAGE_KEY);\n }\n }\n\n get refreshToken(): string | null {\n return this.getItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY);\n }\n\n set refreshToken(value: string | null) {\n if (value) {\n this.setItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY, value);\n } else {\n this.removeItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY);\n }\n }\n\n get accessToken(): string | null {\n return this.getItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY);\n }\n\n set accessToken(value: string | null) {\n if (value) {\n this.setItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY, value);\n } else {\n this.removeItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY);\n }\n }\n\n /**\n * The time until the access token expires in seconds\n */\n public get expiresIn(): number | null {\n const expiresAt = this.expiresAt;\n if (expiresAt) {\n return Math.round(\n (expiresAt.getTime() - Date.now()) / 1000\n );\n }\n return null;\n }\n\n public get remember(): boolean {\n return !!this.getItem(REMEMBER_LOCAL_STORAGE_KEY);\n }\n\n public set remember(value: boolean) {\n if (value) {\n this.setItem(REMEMBER_LOCAL_STORAGE_KEY, 'true');\n } else {\n this.removeItem(REMEMBER_LOCAL_STORAGE_KEY);\n }\n }\n\n private _profile?: Profile | null;\n\n protected _isAuthenticated: boolean | null = null;\n\n public get profile(): Profile | null | undefined {\n return this._profile;\n }\n\n constructor(\n @Inject(OAuthMethod)\n public readonly oAuthMethod: OAuthMethod,\n @Inject(GetOAuthProfileMethod)\n public readonly getOAuthProfileMethod: GetOAuthProfileMethod,\n @Inject(Router)\n private readonly router: Router,\n @Optional()\n @Inject(PROFILE_AUTH_ENDPOINT)\n public profileEndpoint: string | null = null,\n @Optional()\n @Inject(OAUTH_AUTH_ENDPOINT)\n public authEndpoint: string | null = null,\n @Optional()\n @Inject(OAUTH_SECRET)\n public secret: string | null = null,\n @Optional()\n @Inject(OAUTH_SSO_URL)\n private readonly ssoUrl: string | null = null,\n @Optional()\n @Inject(RXAP_O_AUTH_REDIRECT_SIGN_OUT)\n private readonly redirectSignOut: string[] | null = null,\n @Optional()\n @Inject(RXAP_O_AUTH_REDIRECT_URL)\n private readonly redirectUrl: string | null = null,\n @Optional()\n @Inject(OAUTH_CLIENT_ID)\n public clientId: string | null = null,\n ) {}\n\n public signInWithRedirect(lastUrl?: string): void {\n if (!this.redirectUrl) {\n throw new Error('Redirect url is not defined');\n }\n location.replace(\n `${this.ssoUrl}?redirect=${btoa(this.redirectUrl)}&secret=${\n this.secret\n }&payload=${btoa(JSON.stringify({ lastUrl }))}`\n );\n }\n\n public async isAuthenticated(): Promise<boolean> {\n if (!this.secret) {\n throw new Error('The oauth secret is not defined');\n }\n\n if (!this.authEndpoint) {\n throw new Error('The oauth auth endpoint is not defined');\n }\n\n if (this._isAuthenticated !== null) {\n return this._isAuthenticated;\n }\n\n if (this.accessToken) {\n console.debug('Access token is defined: ' + this.accessToken);\n if (this.expiresIn && this.expiresIn > 60) {\n const profile = await this.getProfile();\n\n if (!profile) {\n console.log('profile is not defined');\n return (this._isAuthenticated = false);\n }\n\n this.authenticated(\n {\n refreshToken: this.refreshToken,\n accessToken: this.accessToken,\n expiresAt: this.expiresAt ?? new Date(Date.now() + 60 * 1000),\n expiresIn: this.expiresIn,\n },\n this.remember\n );\n\n return (this._isAuthenticated = true);\n } else {\n this.accessToken = null;\n this.expiresAt = null;\n console.warn(\n 'The access token expires soon. Use refresh token instead.'\n );\n }\n }\n if (this.refreshToken) {\n console.debug('Refresh token is defined: ' + this.refreshToken);\n try {\n await this.signInWithRefreshToken(this.refreshToken);\n return (this._isAuthenticated = true);\n } catch (e) {\n if (![401, 403, 400].includes(e.status)) {\n console.error('Could not sign in with refresh token', e.message);\n throw e;\n }\n console.warn('Refresh token is expired');\n }\n }\n\n console.warn('Unauthenticated');\n\n return (this._isAuthenticated = false);\n }\n\n public async signInWithEmailAndPassword(\n email: string,\n password: string,\n remember: boolean\n ): Promise<OAuthMethodResponse> {\n if (!this.secret) {\n throw new Error('The oauth secret is not defined');\n }\n\n if (!this.authEndpoint) {\n throw new Error('The oauth auth endpoint is not defined');\n }\n\n const response = await this.oAuthMethod.call({\n username: email,\n password: password,\n authEndpoint: this.authEndpoint,\n secret: this.secret,\n clientId: this.clientId ?? undefined\n });\n\n this.authenticated(response, remember);\n\n return response;\n }\n\n public async getProfile<T extends Profile = Profile>(): Promise<T | null> {\n let profile: T | null = null;\n\n if (!this.accessToken) {\n throw new Error('The access token is not defined');\n }\n\n if (this.profileEndpoint) {\n try {\n profile = await this.getOAuthProfileMethod.call({\n accessToken: this.accessToken,\n profileEndpoint: this.profileEndpoint,\n });\n } catch (e) {\n console.error('Could not request the user profile', e.message);\n }\n } else {\n console.warn('The profile endpoint is not defined!');\n }\n\n return (this._profile = profile);\n }\n\n public async signOut() {\n this.clearStorage();\n this.accessToken = null;\n this.refreshToken = null;\n this.expiresAt = null;\n this._isAuthenticated = false;\n if (this.redirectSignOut) {\n await this.router.navigate(this.redirectSignOut);\n } else {\n if (!this.redirectUrl) {\n throw new Error('Redirect url is not defined');\n }\n location.replace(\n `${this.ssoUrl}?redirect=${btoa(this.redirectUrl)}&secret=${this.secret}&action=signOut`\n );\n }\n }\n\n public authenticated(\n response: OAuthStatus,\n remember: boolean = this.remember ?? false\n ): void {\n this.accessToken = response.accessToken;\n this.refreshToken = response.refreshToken ?? null;\n this.expiresAt = response.expiresAt;\n\n console.log(`Authenticated until ${this.expiresAt.toISOString()}`);\n\n this.remember = remember;\n\n if (remember) {\n this.setItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY, response.accessToken);\n if (response.refreshToken) {\n this.setItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY, response.refreshToken);\n }\n this.setItem(REMEMBER_LOCAL_STORAGE_KEY, 'true');\n if (response.expiresAt) {\n console.log(`Authenticated until ${response.expiresAt.toISOString()}`);\n this.setItem(\n EXPIRES_AT_LOCAL_STORAGE_KEY,\n response.expiresAt.getTime().toFixed(0)\n );\n }\n } else {\n this.removeItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY);\n this.removeItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY);\n this.removeItem(REMEMBER_LOCAL_STORAGE_KEY);\n this.removeItem(EXPIRES_AT_LOCAL_STORAGE_KEY);\n }\n\n this._isAuthenticated = true;\n }\n\n private getKey(key: string): string {\n return [this.secret, key].join('__');\n }\n\n private getItem(key: string): string | null {\n return localStorage.getItem(this.getKey(key));\n }\n\n private setItem(key: string, value: string): void {\n localStorage.setItem(this.getKey(key), value);\n }\n\n private removeItem(key: string): void {\n localStorage.removeItem(this.getKey(key));\n }\n\n protected clearStorage() {\n this.removeItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY);\n this.removeItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY);\n this.removeItem(REMEMBER_LOCAL_STORAGE_KEY);\n this.removeItem(EXPIRES_AT_LOCAL_STORAGE_KEY);\n }\n\n private async signInWithRefreshToken(\n refreshToken: string\n ): Promise<OAuthMethodResponse> {\n if (!this.secret) {\n throw new Error('The oauth secret is not defined');\n }\n\n if (!this.authEndpoint) {\n throw new Error('The oauth auth endpoint is not defined');\n }\n\n const response = await this.oAuthMethod.call({\n refreshToken,\n authEndpoint: this.authEndpoint,\n secret: this.secret,\n clientId: this.clientId ?? undefined,\n });\n\n this.authenticated(response);\n\n return response;\n }\n}\n","import {\n ActivatedRouteSnapshot,\n CanActivate,\n UrlTree,\n Router\n} from '@angular/router';\nimport { Injectable } from '@angular/core';\nimport { OAuthService } from './o-auth.service';\n\n@Injectable({ providedIn: 'root' })\nexport class OAuthExtractGuard implements CanActivate {\n\n constructor(\n private readonly router: Router,\n private readonly oAuthService: OAuthService\n ) {}\n\n public canActivate(route: ActivatedRouteSnapshot): UrlTree {\n\n if (route.queryParamMap.has('accessToken') && route.queryParamMap.has('refreshToken') && route.queryParamMap.has('expiresIn')) {\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const accessToken = route.queryParamMap.get('accessToken')!;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const refreshToken = route.queryParamMap.get('refreshToken')!;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const expiresIn = parseInt(route.queryParamMap.get('expiresIn')!, 10);\n const payloadBase64 = route.queryParamMap.get('payload');\n\n const expiresAt = new Date(Date.now() + expiresIn * 1000);\n\n this.oAuthService.authenticated({\n accessToken,\n refreshToken,\n expiresIn,\n expiresAt\n }, true);\n\n let redirectUrl = '/';\n\n if (payloadBase64) {\n try {\n const payload = JSON.parse(atob(payloadBase64));\n console.debug('sso redirect payload', payload);\n if (payload.lastUrl) {\n redirectUrl = payload.lastUrl;\n }\n } catch (e) {\n console.error('Could not parse redirect payload', e.message);\n }\n }\n\n return this.router.createUrlTree([ redirectUrl ]);\n\n } else {\n console.warn('Not every query parameter is defined!');\n }\n\n return this.router.createUrlTree([ ...route.url.map(url => url.path), 'redirect' ]);\n }\n\n\n}\n","import {\n ActivatedRouteSnapshot,\n CanActivate,\n CanActivateChild,\n RouterStateSnapshot,\n UrlTree\n} from '@angular/router';\nimport {\n Injectable,\n Inject,\n isDevMode\n} from '@angular/core';\nimport { OAuthService } from './o-auth.service';\n\n@Injectable({ providedIn: 'root' })\nexport class OAuthRedirectGuard implements CanActivate, CanActivateChild {\n\n constructor(\n @Inject(OAuthService)\n private readonly oAuthService: OAuthService\n ) {\n }\n\n public async canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean | UrlTree> {\n\n const isAuthenticated = await this.oAuthService.isAuthenticated();\n\n console.log(`isAuthenticated: ${isAuthenticated}`);\n\n if (isAuthenticated) {\n return true;\n }\n\n this.oAuthService.signInWithRedirect(state.url);\n\n return false;\n\n }\n\n public canActivateChild(childRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean | UrlTree> {\n return this.canActivate(childRoute, state);\n }\n\n}\n","import {\n NgModule,\n ModuleWithProviders\n} from '@angular/core';\nimport {\n RXAP_O_AUTH_REDIRECT_SIGN_IN,\n RXAP_O_AUTH_REDIRECT_SIGN_OUT\n} from './tokens';\n\nexport interface OAuthModuleOptions {\n signInPath?: string[]\n signOutPath?: string[]\n}\n\n@NgModule()\nexport class OAuthModule {\n\n public static forRoot(options: OAuthModuleOptions = {}): ModuleWithProviders<OAuthModule> {\n return {\n ngModule: OAuthModule,\n providers: [\n {\n provide: RXAP_O_AUTH_REDIRECT_SIGN_IN,\n useValue: options.signInPath ?? [ '/', 'oauth', 'redirect' ]\n },\n {\n provide: RXAP_O_AUTH_REDIRECT_SIGN_OUT,\n useValue: options.signOutPath ?? null\n }\n ]\n };\n }\n\n}\n","import {\n Component,\n ChangeDetectionStrategy\n} from '@angular/core';\nimport { RouterOutlet } from '@angular/router';\nimport {\n trigger,\n transition,\n style,\n animate\n} from '@angular/animations';\n\n@Component({\n selector: 'rxap-container',\n templateUrl: './container.component.html',\n styleUrls: [ './container.component.scss' ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'rxap-container' },\n animations: [\n trigger('routeAnimations', [\n transition(\n ':enter',\n [\n style({ opacity: 0 }),\n animate('512ms', style({ opacity: 1 }))\n ]\n ),\n transition(\n ':leave',\n [\n style({ opacity: 1 }),\n animate('512ms', style({ opacity: 0 }))\n ]\n )\n ])\n ]\n})\nexport class ContainerComponent {\n\n public prepareRoute(outlet: RouterOutlet) {\n return outlet.isActivated ? outlet.activatedRoute : 'true';\n }\n\n}\n","<div [@routeAnimations]=\"prepareRoute(outlet)\" class=\"container\">\n\n <div class=\"split mat-elevation-z3\"></div>\n\n <router-outlet #outlet=\"outlet\"></router-outlet>\n\n</div>\n","import {\n ChangeDetectionStrategy,\n Component\n} from '@angular/core';\n\n@Component({\n selector: 'rxap-loading',\n templateUrl: './loading.component.html',\n styleUrls: [ './loading.component.scss' ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'rxap-loading' }\n})\nexport class LoadingComponent {\n}\n","<mat-progress-bar class=\"loading-bar\" mode=\"indeterminate\"></mat-progress-bar>\n","import {\n Component,\n ChangeDetectionStrategy\n} from '@angular/core';\nimport { OAuthService } from '../o-auth.service';\nimport {\n trigger,\n state,\n style,\n transition,\n animate\n} from '@angular/animations';\n\n@Component({\n selector: 'rxap-sign-in-with-redirect',\n templateUrl: './sign-in-with-redirect.component.html',\n styleUrls: [ './sign-in-with-redirect.component.scss' ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'rxap-sign-in-with-redirect' },\n animations: [\n trigger('fadeAnimation', [\n\n // the \"in\" style determines the \"resting\" state of the element when it is visible.\n state('in', style({ opacity: 1 })),\n\n // fade in when created. this could also be written as transition('void => *')\n transition(':enter', [\n style({ opacity: 0 }),\n animate(300)\n ]),\n\n // fade out when destroyed. this could also be written as transition('void => *')\n transition(\n ':leave',\n animate(300, style({ opacity: 0 }))\n )\n ])\n ]\n})\nexport class SignInWithRedirectComponent {\n\n constructor(\n private readonly authService: OAuthService\n ) {}\n\n public signIn() {\n this.authService.signInWithRedirect();\n }\n\n}\n","<div [@fadeAnimation]=\"'in'\" class=\"inner mat-elevation-z5\" fxLayout=\"column\" fxLayoutAlign=\"center center\" fxLayoutGap=\"32px\">\n\n <div class=\"header\" fxFlex=\"nogrow\" fxLayout=\"column\" fxLayoutAlign=\"center center\">\n\n <mat-icon class=\"avatar-icon\" color=\"primary\" fxFlex=\"nogrow\">account_circle</mat-icon>\n\n </div>\n\n <div fxFlex=\"nogrow\" fxLayout=\"row\" fxLayoutAlign=\"center center\">\n\n <div fxFlex=\"nogrow\">\n <button (click)=\"signIn()\" color=\"primary\" fxFlex=\"nogrow\" mat-raised-button>\n <span fxLayout=\"row\" fxLayoutAlign=\"start center\" fxLayoutGap=\"16px\">\n <mat-icon fxFlex=\"nogrow\">login</mat-icon>\n <span fxFlex=\"nogrow\">Sign In</span>\n </span>\n </button>\n </div>\n\n </div>\n\n</div>\n\n","import { Routes } from '@angular/router';\nimport {\n ContainerComponent\n} from './container/container.component';\nimport { LoadingComponent } from './loading/loading.component';\nimport { SignInWithRedirectComponent } from './sign-in-with-redirect/sign-in-with-redirect.component';\nimport { OAuthExtractGuard } from './o-auth-extract.guard';\n\nexport const RXAP_O_AUTH_ROUTES: Routes = [\n {\n path: 'oauth',\n component: ContainerComponent,\n children: [\n {\n path: 'redirect',\n component: SignInWithRedirectComponent\n },\n {\n canActivate: [ OAuthExtractGuard ],\n path: '',\n component: LoadingComponent\n },\n {\n path: '**',\n redirectTo: ''\n }\n ]\n }\n];\n","import {\n Resolve,\n Router\n} from '@angular/router';\nimport {\n Inject,\n Injectable\n} from '@angular/core';\nimport { OAuthService } from './o-auth.service';\nimport { RXAP_O_AUTH_REDIRECT_SIGN_IN } from './tokens';\n\n@Injectable({ providedIn: 'root' })\nexport class ProfileResolve<T = Record<string, any>> implements Resolve<T> {\n\n constructor(\n @Inject(OAuthService)\n private readonly oAuthService: OAuthService,\n @Inject(Router)\n private readonly router: Router,\n @Inject(RXAP_O_AUTH_REDIRECT_SIGN_IN)\n private readonly redirectLogin: string[]\n ) {\n }\n\n public async resolve(): Promise<T> {\n const profile = await this.oAuthService.getProfile();\n\n if (!profile) {\n await this.router.navigate(this.redirectLogin);\n }\n\n return profile;\n }\n\n}\n","import { NgModule } from '@angular/core';\nimport { ContainerComponent } from './container.component';\nimport { RouterModule } from '@angular/router';\n\n\n@NgModule({\n declarations: [ ContainerComponent ],\n imports: [\n RouterModule\n ],\n exports: [ ContainerComponent ]\n})\nexport class ContainerComponentModule {}\n","import { NgModule } from '@angular/core';\nimport { LoadingComponent } from './loading.component';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\n\n\n@NgModule({\n declarations: [\n LoadingComponent\n ],\n imports: [\n MatProgressBarModule\n ],\n exports: [\n LoadingComponent\n ]\n})\nexport class LoadingComponentModule {\n}\n","import { NgModule } from '@angular/core';\nimport { SignInWithRedirectComponent } from './sign-in-with-redirect.component';\nimport { MatIconModule } from '@angular/material/icon';\nimport { CommonModule } from '@angular/common';\nimport { MatCardModule } from '@angular/material/card';\nimport { FlexLayoutModule } from '@angular/flex-layout';\nimport { MatButtonModule } from '@angular/material/button';\n\n\n@NgModule({\n declarations: [ SignInWithRedirectComponent ],\n imports: [\n MatCardModule,\n MatButtonModule,\n FlexLayoutModule,\n MatIconModule,\n CommonModule\n ],\n exports: [ SignInWithRedirectComponent ]\n})\nexport class SignInWithRedirectComponentModule {}\n","import { NgModule } from '@angular/core';\nimport { ContainerComponentModule } from './container/container.component.module';\nimport { LoadingComponentModule } from './loading/loading.component.module';\nimport {\n SignInWithRedirectComponentModule\n} from './sign-in-with-redirect/sign-in-with-redirect.component.module';\n\n@NgModule({\n exports: [\n ContainerComponentModule,\n LoadingComponentModule,\n SignInWithRedirectComponentModule\n ]\n})\nexport class OAuthRoutingModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["InjectionToken","HttpClient","Injectable","Inject","Optional","HttpHeaders","Router","NgModule","trigger","transition","style","animate","Component","ChangeDetectionStrategy","state","RouterModule","MatProgressBarModule","MatCardModule","MatButtonModule","FlexLayoutModule","MatIconModule","CommonModule"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QASa,qBAAqB,GAAG,IAAIA,iBAAc,CACrD,uBAAuB,EACvB;;QAYA,+BAEmB,IAAgB,EAG1B,eAAqC;YAArC,gCAAA,EAAA,sBAAqC;YAH3B,SAAI,GAAJ,IAAI,CAAY;YAG1B,oBAAe,GAAf,eAAe,CAAsB;SAC1C;QAEG,oCAAI,GAAJ,UAAK,UAA2C;;YACrD,IAAM,eAAe,GAAG,MAAA,UAAU,CAAC,eAAe,mCAAI,IAAI,CAAC,eAAe,CAAC;YA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A2B,aAEzCC,kBAAa;YACbC,kBAAe;YACfC,2BAAgB;YAChBC,gBAAa;YACbC,mBAAY,aAEE,2BAA2B;0JAEhC,iCAAiC,YAT9B;gBACZJ,kBAAa;gBACbC,kBAAe;gBACfC,2BAAgB;gBAChBC,gBAAa;gBACbC,mBAAY;aACb;sHAGU,iCAAiC;sBAX7Cd,WAAQ;uBAAC;wBACR,YAAY,EAAE,CAAE,2BAA2B,CAAE;wBAC7C,OAAO,EAAO;4BACZU,kBAAa;4BACbC,kBAAe;4BACfC,2BAAgB;4BAChBC,gBAAa;4BACbC,mBAAY;yBACb;wBACD,OAAO,EAAO,CAAE,2BAA2B,CAAE;qBAC9C;;;;QCLD;;;;0IAAa,kBAAkB;2IAAlB,kBAAkB,YAL3B,wBAAwB;YACxB,sBAAsB;YACtB,iCAAiC;2IAGxB,kBAAkB,YAL3B,wBAAwB;YACxB,sBAAsB;YACtB,iCAAiC;sHAGxB,kBAAkB;sBAP9Bd,WAAQ;uBAAC;wBACR,OAAO,EAAE;4BACP,wBAAwB;4BACxB,sBAAsB;4BACtB,iCAAiC;yBAClC;qBACF;;;ICbD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"rxap-oauth.umd.js","sources":["../../../../libs/oauth/src/lib/get-o-auth-profile.method.ts","../../../../node_modules/tslib/tslib.es6.js","../../../../libs/oauth/src/lib/o-auth.method.ts","../../../../libs/oauth/src/lib/tokens.ts","../../../../libs/oauth/src/lib/o-auth.service.ts","../../../../libs/oauth/src/lib/o-auth-extract.guard.ts","../../../../libs/oauth/src/lib/o-auth-redirect.guard.ts","../../../../libs/oauth/src/lib/o-auth.module.ts","../../../../libs/oauth/src/lib/container/container.component.ts","../../../../libs/oauth/src/lib/container/container.component.html","../../../../libs/oauth/src/lib/loading/loading.component.ts","../../../../libs/oauth/src/lib/loading/loading.component.html","../../../../libs/oauth/src/lib/sign-in-with-redirect/sign-in-with-redirect.component.ts","../../../../libs/oauth/src/lib/sign-in-with-redirect/sign-in-with-redirect.component.html","../../../../libs/oauth/src/lib/routes.ts","../../../../libs/oauth/src/lib/profile.resolve.ts","../../../../libs/oauth/src/lib/container/container.component.module.ts","../../../../libs/oauth/src/lib/loading/loading.component.module.ts","../../../../libs/oauth/src/lib/sign-in-with-redirect/sign-in-with-redirect.component.module.ts","../../../../libs/oauth/src/lib/o-auth-routing.module.ts","../../../../libs/oauth/src/rxap-oauth.ts"],"sourcesContent":["import {\n Inject,\n Injectable,\n InjectionToken,\n Optional\n} from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport { Method } from '@rxap/utilities/rxjs';\n\nexport const PROFILE_AUTH_ENDPOINT = new InjectionToken(\n 'PROFILE_AUTH_ENDPOINT'\n);\n\nexport interface GetOAuthProfileMethodParameters {\n accessToken: string;\n profileEndpoint?: string | null;\n withCredentials?: boolean;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class GetOAuthProfileMethod<T = any>\n implements Method<T, GetOAuthProfileMethodParameters>\n{\n constructor(\n @Inject(HttpClient)\n private readonly http: HttpClient,\n @Optional()\n @Inject(PROFILE_AUTH_ENDPOINT)\n public profileEndpoint: string | null = null\n ) {}\n\n public call(parameters: GetOAuthProfileMethodParameters): Promise<T> {\n const profileEndpoint = parameters.profileEndpoint ?? this.profileEndpoint;\n\n if (!profileEndpoint) {\n throw new Error('The profile endpoint is not defined');\n }\n\n return this.http\n .get<T>(profileEndpoint, {\n headers: {\n Authorization: `Bearer ${parameters.accessToken}`,\n },\n withCredentials: parameters.withCredentials ?? true,\n })\n .toPromise();\n }\n}\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from) {\r\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\r\n to[j] = from[i];\r\n return to;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","import {\n Injectable,\n Inject\n} from '@angular/core';\nimport {\n HttpClient,\n HttpHeaders\n} from '@angular/common/http';\nimport { Method } from '@rxap/utilities/rxjs';\n\nexport interface OAuthMethodWithUsernamePasswordParameters {\n grantType?: string;\n username: string;\n password: string;\n secret: string;\n clientId?: string;\n authEndpoint: string;\n}\n\nexport interface OAuthMethodWithRefreshTokenParameters {\n grantType?: string;\n refreshToken: string;\n secret: string;\n clientId?: string;\n authEndpoint: string;\n}\n\nexport type OAuthMethodParameters = (\n | OAuthMethodWithUsernamePasswordParameters\n | OAuthMethodWithRefreshTokenParameters\n) & { withCredentials?: boolean };\n\nexport function IsOAuthMethodWithRefreshTokenParameters(\n parameters: OAuthMethodParameters\n): parameters is OAuthMethodWithRefreshTokenParameters {\n // eslint-disable-next-line no-prototype-builtins\n return parameters.hasOwnProperty('refreshToken');\n}\n\nexport function IsOAuthMethodWithUsernamePasswordParameters(\n parameters: OAuthMethodParameters\n): parameters is OAuthMethodWithUsernamePasswordParameters {\n // eslint-disable-next-line no-prototype-builtins\n return (\n parameters.hasOwnProperty('username') &&\n parameters.hasOwnProperty('password')\n );\n}\n\nexport function AssertOAuthMethodWithUsernamePasswordParameters(\n parameters: OAuthMethodParameters\n): asserts parameters is OAuthMethodWithUsernamePasswordParameters {\n if (!IsOAuthMethodWithUsernamePasswordParameters(parameters)) {\n throw new Error(\n 'The grant type password requires the parameters username and password'\n );\n }\n}\n\nexport function AssertOAuthMethodWithRefreshTokenParameters(\n parameters: OAuthMethodParameters\n): asserts parameters is OAuthMethodWithRefreshTokenParameters {\n if (!IsOAuthMethodWithRefreshTokenParameters(parameters)) {\n throw new Error(\n 'The grant type refresh token requires the parameters refreshToken'\n );\n }\n}\n\nexport function AssertOAuthMethodParameters(\n parameters: any\n): asserts parameters is OAuthMethodParameters {\n if (!parameters.authEndpoint) {\n throw new Error('The authEndpoint parameter must be defined');\n }\n if (!parameters.secret) {\n throw new Error('The secret parameter must be defined');\n }\n if (parameters.grantType) {\n switch (parameters.grantType) {\n case 'password':\n AssertOAuthMethodWithUsernamePasswordParameters(parameters);\n break;\n\n case 'refresh_token':\n AssertOAuthMethodWithRefreshTokenParameters(parameters);\n break;\n\n default:\n throw new Error(\n `The grant type '${parameters.grantType}' is not supported`\n );\n }\n } else {\n if (\n !IsOAuthMethodWithRefreshTokenParameters(parameters) &&\n !IsOAuthMethodWithUsernamePasswordParameters(parameters)\n ) {\n throw new Error(\n 'Either the refresh token or the username and password must be defined'\n );\n }\n }\n}\n\nexport interface OAuthResponse {\n access_token: string;\n refresh_token: string;\n expires_in: number;\n}\n\nexport interface OAuthMethodResponse {\n accessToken: string;\n refreshToken: string;\n expiresIn: number;\n expiresAt: Date;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class OAuthMethod\n implements Method<OAuthMethodResponse, OAuthMethodParameters>\n{\n constructor(\n @Inject(HttpClient)\n private readonly http: HttpClient\n ) {}\n\n public async call(\n parameters: OAuthMethodParameters\n ): Promise<OAuthMethodResponse> {\n AssertOAuthMethodParameters(parameters);\n\n const params = new URLSearchParams();\n const grantType = this.getGrantType(parameters);\n params.append('grant_type', grantType);\n switch (grantType) {\n case 'password':\n AssertOAuthMethodWithUsernamePasswordParameters(parameters);\n params.append('username', parameters.username);\n params.append('password', parameters.password);\n break;\n\n case 'refresh_token':\n AssertOAuthMethodWithRefreshTokenParameters(parameters);\n params.append('refresh_token', parameters.refreshToken);\n break;\n\n default:\n throw new Error('Not supported grant type');\n }\n\n let headers = new HttpHeaders();\n\n headers = headers.append('Content-type', 'application/x-www-form-urlencoded; charset=utf-8');\n\n if (parameters.secret && parameters.clientId) {\n params.append('client_id', parameters.clientId);\n params.append('client_secret', parameters.secret);\n } else {\n headers = headers.append('Authorization', `Basic ${parameters.secret}`);\n }\n\n const response = await this.http\n .post<OAuthResponse>(parameters.authEndpoint, params.toString(), {\n headers,\n withCredentials: parameters.withCredentials ?? true,\n })\n .toPromise();\n\n return {\n accessToken: response.access_token,\n refreshToken: response.refresh_token,\n expiresIn: response.expires_in,\n expiresAt: new Date(Date.now() + response.expires_in * 1000),\n };\n }\n\n private getGrantType(parameters: OAuthMethodParameters) {\n if (parameters.grantType) {\n return parameters.grantType;\n }\n\n if (IsOAuthMethodWithRefreshTokenParameters(parameters)) {\n return 'refresh_token';\n }\n\n if (IsOAuthMethodWithUsernamePasswordParameters(parameters)) {\n return 'password';\n }\n\n throw new Error('Could not guess the grant type');\n }\n}\n","import { InjectionToken } from '@angular/core';\n\nexport function DefaultRedirectSignInFactory(): string[] {\n return [ '/', 'authentication', 'login' ];\n}\n\nexport const RXAP_O_AUTH_REDIRECT_SIGN_IN = new InjectionToken('rxap/o-auth/redirect-sign-in', {\n providedIn: 'root',\n factory: DefaultRedirectSignInFactory\n});\n\nexport const RXAP_O_AUTH_REDIRECT_SIGN_OUT = new InjectionToken('rxap/o-auth/redirect-sign-out');\n\nexport function DefaultRedirectUrl(): string {\n return location.origin + '/oauth';\n}\n\nexport const RXAP_O_AUTH_REDIRECT_URL = new InjectionToken('rxap/o-auth/redirect-url', {\n providedIn: 'root',\n factory: DefaultRedirectUrl\n});\n","import {\n Inject,\n Injectable,\n InjectionToken,\n Optional\n} from '@angular/core';\nimport {\n GetOAuthProfileMethod,\n PROFILE_AUTH_ENDPOINT\n} from './get-o-auth-profile.method';\nimport {\n OAuthMethod,\n OAuthMethodResponse\n} from './o-auth.method';\nimport {\n RXAP_O_AUTH_REDIRECT_SIGN_OUT,\n RXAP_O_AUTH_REDIRECT_URL\n} from './tokens';\nimport { Router } from '@angular/router';\nimport { ReplaySubject, Subject } from 'rxjs';\nimport { AuthenticationEvent, AuthenticationEventType } from '@rxap/authentication';\n\nexport const OAUTH_SECRET = new InjectionToken('OAUTH_SECRET');\nexport const OAUTH_AUTH_ENDPOINT = new InjectionToken('OAUTH_AUTH_ENDPOINT');\nexport const OAUTH_SSO_URL = new InjectionToken('OAUTH_SSO_URL');\nexport const OAUTH_CLIENT_ID = new InjectionToken('OAUTH_CLIENT_ID');\n\nexport const ACCESS_TOKEN_LOCAL_STORAGE_KEY = 'access_token';\nexport const REFRESH_TOKEN_LOCAL_STORAGE_KEY = 'refresh_token';\nexport const EXPIRES_AT_LOCAL_STORAGE_KEY = 'expires_at';\nexport const REMEMBER_LOCAL_STORAGE_KEY = 'remember';\n\nexport interface OAuthStatus {\n accessToken: string;\n refreshToken?: string | null;\n expiresIn: number;\n expiresAt: Date;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class OAuthService<Profile = any> {\n\n public readonly events$ = new ReplaySubject<AuthenticationEvent>();\n\n get expiresAt(): Date | null {\n const expiresAt = this.getItem(EXPIRES_AT_LOCAL_STORAGE_KEY);\n if (expiresAt) {\n return new Date(\n parseInt(this.getItem(EXPIRES_AT_LOCAL_STORAGE_KEY)!, 10)\n );\n }\n return null;\n }\n\n set expiresAt(value: Date | null) {\n if (value) {\n this.setItem(EXPIRES_AT_LOCAL_STORAGE_KEY, value.getTime().toFixed(0));\n } else {\n this.removeItem(EXPIRES_AT_LOCAL_STORAGE_KEY);\n }\n }\n\n get refreshToken(): string | null {\n return this.getItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY);\n }\n\n set refreshToken(value: string | null) {\n if (value) {\n this.setItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY, value);\n } else {\n this.removeItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY);\n }\n }\n\n get accessToken(): string | null {\n return this.getItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY);\n }\n\n set accessToken(value: string | null) {\n if (value) {\n this.setItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY, value);\n } else {\n this.removeItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY);\n }\n }\n\n /**\n * The time until the access token expires in seconds\n */\n public get expiresIn(): number | null {\n const expiresAt = this.expiresAt;\n if (expiresAt) {\n return Math.round(\n (expiresAt.getTime() - Date.now()) / 1000\n );\n }\n return null;\n }\n\n public get remember(): boolean {\n return !!this.getItem(REMEMBER_LOCAL_STORAGE_KEY);\n }\n\n public set remember(value: boolean) {\n if (value) {\n this.setItem(REMEMBER_LOCAL_STORAGE_KEY, 'true');\n } else {\n this.removeItem(REMEMBER_LOCAL_STORAGE_KEY);\n }\n }\n\n private _profile?: Profile | null;\n\n protected _isAuthenticated: boolean | null = null;\n\n public get profile(): Profile | null | undefined {\n return this._profile;\n }\n\n constructor(\n @Inject(OAuthMethod)\n public readonly oAuthMethod: OAuthMethod,\n @Inject(GetOAuthProfileMethod)\n public readonly getOAuthProfileMethod: GetOAuthProfileMethod,\n @Inject(Router)\n private readonly router: Router,\n @Optional()\n @Inject(PROFILE_AUTH_ENDPOINT)\n public profileEndpoint: string | null = null,\n @Optional()\n @Inject(OAUTH_AUTH_ENDPOINT)\n public authEndpoint: string | null = null,\n @Optional()\n @Inject(OAUTH_SECRET)\n public secret: string | null = null,\n @Optional()\n @Inject(OAUTH_SSO_URL)\n private readonly ssoUrl: string | null = null,\n @Optional()\n @Inject(RXAP_O_AUTH_REDIRECT_SIGN_OUT)\n private readonly redirectSignOut: string[] | null = null,\n @Optional()\n @Inject(RXAP_O_AUTH_REDIRECT_URL)\n private readonly redirectUrl: string | null = null,\n @Optional()\n @Inject(OAUTH_CLIENT_ID)\n public clientId: string | null = null,\n ) {}\n\n public signInWithRedirect(lastUrl?: string): void {\n if (!this.redirectUrl) {\n throw new Error('Redirect url is not defined');\n }\n location.replace(\n `${this.ssoUrl}?redirect=${btoa(this.redirectUrl)}&secret=${\n this.secret\n }&payload=${btoa(JSON.stringify({ lastUrl }))}`\n );\n }\n\n public async isAuthenticated(): Promise<boolean> {\n if (!this.secret) {\n throw new Error('The oauth secret is not defined');\n }\n\n if (!this.authEndpoint) {\n throw new Error('The oauth auth endpoint is not defined');\n }\n\n if (this._isAuthenticated !== null) {\n return this._isAuthenticated;\n }\n\n if (this.accessToken) {\n console.debug('Access token is defined: ' + this.accessToken);\n if (this.expiresIn && this.expiresIn > 60) {\n const profile = await this.getProfile();\n\n if (!profile) {\n console.log('profile is not defined');\n return (this._isAuthenticated = false);\n }\n\n this.authenticated(\n {\n refreshToken: this.refreshToken,\n accessToken: this.accessToken,\n expiresAt: this.expiresAt ?? new Date(Date.now() + 60 * 1000),\n expiresIn: this.expiresIn,\n },\n this.remember\n );\n\n return (this._isAuthenticated = true);\n } else {\n this.accessToken = null;\n this.expiresAt = null;\n console.warn(\n 'The access token expires soon. Use refresh token instead.'\n );\n }\n }\n if (this.refreshToken) {\n console.debug('Refresh token is defined: ' + this.refreshToken);\n try {\n await this.signInWithRefreshToken(this.refreshToken);\n return (this._isAuthenticated = true);\n } catch (e) {\n if (![401, 403, 400].includes(e.status)) {\n console.error('Could not sign in with refresh token', e.message);\n throw e;\n }\n console.warn('Refresh token is expired');\n }\n }\n\n console.warn('Unauthenticated');\n\n return (this._isAuthenticated = false);\n }\n\n public async signInWithEmailAndPassword(\n email: string,\n password: string,\n remember: boolean\n ): Promise<OAuthMethodResponse> {\n if (!this.secret) {\n throw new Error('The oauth secret is not defined');\n }\n\n if (!this.authEndpoint) {\n throw new Error('The oauth auth endpoint is not defined');\n }\n\n const response = await this.oAuthMethod.call({\n username: email,\n password: password,\n authEndpoint: this.authEndpoint,\n secret: this.secret,\n clientId: this.clientId ?? undefined\n }).catch(e => {\n this.events$.next({ type: AuthenticationEventType.OnAuthError });\n throw e;\n });\n\n this.authenticated(response, remember);\n\n return response;\n }\n\n public async getProfile<T extends Profile = Profile>(): Promise<T | null> {\n let profile: T | null = null;\n\n if (!this.accessToken) {\n throw new Error('The access token is not defined');\n }\n\n if (this.profileEndpoint) {\n try {\n profile = await this.getOAuthProfileMethod.call({\n accessToken: this.accessToken,\n profileEndpoint: this.profileEndpoint,\n });\n } catch (e) {\n console.error('Could not request the user profile', e.message);\n }\n } else {\n console.warn('The profile endpoint is not defined!');\n }\n\n return (this._profile = profile);\n }\n\n public async signOut() {\n this.clearStorage();\n this.accessToken = null;\n this.refreshToken = null;\n this.expiresAt = null;\n this._isAuthenticated = false;\n if (this.redirectSignOut) {\n await this.router.navigate(this.redirectSignOut);\n } else {\n if (!this.redirectUrl) {\n throw new Error('Redirect url is not defined');\n }\n location.replace(\n `${this.ssoUrl}?redirect=${btoa(this.redirectUrl)}&secret=${this.secret}&action=signOut`\n );\n }\n this.events$.next({ type: AuthenticationEventType.OnLogout });\n }\n\n public authenticated(\n response: OAuthStatus,\n remember: boolean = this.remember ?? false\n ): void {\n this.accessToken = response.accessToken;\n this.refreshToken = response.refreshToken ?? null;\n this.expiresAt = response.expiresAt;\n\n console.log(`Authenticated until ${this.expiresAt.toISOString()}`);\n\n this.remember = remember;\n\n if (remember) {\n this.setItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY, response.accessToken);\n if (response.refreshToken) {\n this.setItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY, response.refreshToken);\n }\n this.setItem(REMEMBER_LOCAL_STORAGE_KEY, 'true');\n if (response.expiresAt) {\n console.log(`Authenticated until ${response.expiresAt.toISOString()}`);\n this.setItem(\n EXPIRES_AT_LOCAL_STORAGE_KEY,\n response.expiresAt.getTime().toFixed(0)\n );\n }\n } else {\n this.removeItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY);\n this.removeItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY);\n this.removeItem(REMEMBER_LOCAL_STORAGE_KEY);\n this.removeItem(EXPIRES_AT_LOCAL_STORAGE_KEY);\n }\n\n this._isAuthenticated = true;\n this.events$.next({ type: AuthenticationEventType.OnAuthSuccess });\n }\n\n private getKey(key: string): string {\n return [this.secret, key].join('__');\n }\n\n private getItem(key: string): string | null {\n return localStorage.getItem(this.getKey(key));\n }\n\n private setItem(key: string, value: string): void {\n localStorage.setItem(this.getKey(key), value);\n }\n\n private removeItem(key: string): void {\n localStorage.removeItem(this.getKey(key));\n }\n\n protected clearStorage() {\n this.removeItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY);\n this.removeItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY);\n this.removeItem(REMEMBER_LOCAL_STORAGE_KEY);\n this.removeItem(EXPIRES_AT_LOCAL_STORAGE_KEY);\n }\n\n private async signInWithRefreshToken(\n refreshToken: string\n ): Promise<OAuthMethodResponse> {\n if (!this.secret) {\n throw new Error('The oauth secret is not defined');\n }\n\n if (!this.authEndpoint) {\n throw new Error('The oauth auth endpoint is not defined');\n }\n\n const response = await this.oAuthMethod.call({\n refreshToken,\n authEndpoint: this.authEndpoint,\n secret: this.secret,\n clientId: this.clientId ?? undefined,\n });\n\n this.authenticated(response);\n\n return response;\n }\n}\n","import {\n ActivatedRouteSnapshot,\n CanActivate,\n UrlTree,\n Router\n} from '@angular/router';\nimport { Injectable } from '@angular/core';\nimport { OAuthService } from './o-auth.service';\n\n@Injectable({ providedIn: 'root' })\nexport class OAuthExtractGuard implements CanActivate {\n\n constructor(\n private readonly router: Router,\n private readonly oAuthService: OAuthService\n ) {}\n\n public canActivate(route: ActivatedRouteSnapshot): UrlTree {\n\n if (route.queryParamMap.has('accessToken') && route.queryParamMap.has('refreshToken') && route.queryParamMap.has('expiresIn')) {\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const accessToken = route.queryParamMap.get('accessToken')!;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const refreshToken = route.queryParamMap.get('refreshToken')!;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const expiresIn = parseInt(route.queryParamMap.get('expiresIn')!, 10);\n const payloadBase64 = route.queryParamMap.get('payload');\n\n const expiresAt = new Date(Date.now() + expiresIn * 1000);\n\n this.oAuthService.authenticated({\n accessToken,\n refreshToken,\n expiresIn,\n expiresAt\n }, true);\n\n let redirectUrl = '/';\n\n if (payloadBase64) {\n try {\n const payload = JSON.parse(atob(payloadBase64));\n console.debug('sso redirect payload', payload);\n if (payload.lastUrl) {\n redirectUrl = payload.lastUrl;\n }\n } catch (e) {\n console.error('Could not parse redirect payload', e.message);\n }\n }\n\n return this.router.createUrlTree([ redirectUrl ]);\n\n } else {\n console.warn('Not every query parameter is defined!');\n }\n\n return this.router.createUrlTree([ ...route.url.map(url => url.path), 'redirect' ]);\n }\n\n\n}\n","import {\n ActivatedRouteSnapshot,\n CanActivate,\n CanActivateChild,\n RouterStateSnapshot,\n UrlTree\n} from '@angular/router';\nimport {\n Injectable,\n Inject,\n isDevMode\n} from '@angular/core';\nimport { OAuthService } from './o-auth.service';\n\n@Injectable({ providedIn: 'root' })\nexport class OAuthRedirectGuard implements CanActivate, CanActivateChild {\n\n constructor(\n @Inject(OAuthService)\n private readonly oAuthService: OAuthService\n ) {\n }\n\n public async canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean | UrlTree> {\n\n const isAuthenticated = await this.oAuthService.isAuthenticated();\n\n console.log(`isAuthenticated: ${isAuthenticated}`);\n\n if (isAuthenticated) {\n return true;\n }\n\n this.oAuthService.signInWithRedirect(state.url);\n\n return false;\n\n }\n\n public canActivateChild(childRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean | UrlTree> {\n return this.canActivate(childRoute, state);\n }\n\n}\n","import {\n NgModule,\n ModuleWithProviders\n} from '@angular/core';\nimport {\n RXAP_O_AUTH_REDIRECT_SIGN_IN,\n RXAP_O_AUTH_REDIRECT_SIGN_OUT\n} from './tokens';\n\nexport interface OAuthModuleOptions {\n signInPath?: string[]\n signOutPath?: string[]\n}\n\n@NgModule()\nexport class OAuthModule {\n\n public static forRoot(options: OAuthModuleOptions = {}): ModuleWithProviders<OAuthModule> {\n return {\n ngModule: OAuthModule,\n providers: [\n {\n provide: RXAP_O_AUTH_REDIRECT_SIGN_IN,\n useValue: options.signInPath ?? [ '/', 'oauth', 'redirect' ]\n },\n {\n provide: RXAP_O_AUTH_REDIRECT_SIGN_OUT,\n useValue: options.signOutPath ?? null\n }\n ]\n };\n }\n\n}\n","import {\n Component,\n ChangeDetectionStrategy\n} from '@angular/core';\nimport { RouterOutlet } from '@angular/router';\nimport {\n trigger,\n transition,\n style,\n animate\n} from '@angular/animations';\n\n@Component({\n selector: 'rxap-container',\n templateUrl: './container.component.html',\n styleUrls: [ './container.component.scss' ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'rxap-container' },\n animations: [\n trigger('routeAnimations', [\n transition(\n ':enter',\n [\n style({ opacity: 0 }),\n animate('512ms', style({ opacity: 1 }))\n ]\n ),\n transition(\n ':leave',\n [\n style({ opacity: 1 }),\n animate('512ms', style({ opacity: 0 }))\n ]\n )\n ])\n ]\n})\nexport class ContainerComponent {\n\n public prepareRoute(outlet: RouterOutlet) {\n return outlet.isActivated ? outlet.activatedRoute : 'true';\n }\n\n}\n","<div [@routeAnimations]=\"prepareRoute(outlet)\" class=\"container\">\n\n <div class=\"split mat-elevation-z3\"></div>\n\n <router-outlet #outlet=\"outlet\"></router-outlet>\n\n</div>\n","import {\n ChangeDetectionStrategy,\n Component\n} from '@angular/core';\n\n@Component({\n selector: 'rxap-loading',\n templateUrl: './loading.component.html',\n styleUrls: [ './loading.component.scss' ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'rxap-loading' }\n})\nexport class LoadingComponent {\n}\n","<mat-progress-bar class=\"loading-bar\" mode=\"indeterminate\"></mat-progress-bar>\n","import {\n Component,\n ChangeDetectionStrategy\n} from '@angular/core';\nimport { OAuthService } from '../o-auth.service';\nimport {\n trigger,\n state,\n style,\n transition,\n animate\n} from '@angular/animations';\n\n@Component({\n selector: 'rxap-sign-in-with-redirect',\n templateUrl: './sign-in-with-redirect.component.html',\n styleUrls: [ './sign-in-with-redirect.component.scss' ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'rxap-sign-in-with-redirect' },\n animations: [\n trigger('fadeAnimation', [\n\n // the \"in\" style determines the \"resting\" state of the element when it is visible.\n state('in', style({ opacity: 1 })),\n\n // fade in when created. this could also be written as transition('void => *')\n transition(':enter', [\n style({ opacity: 0 }),\n animate(300)\n ]),\n\n // fade out when destroyed. this could also be written as transition('void => *')\n transition(\n ':leave',\n animate(300, style({ opacity: 0 }))\n )\n ])\n ]\n})\nexport class SignInWithRedirectComponent {\n\n constructor(\n private readonly authService: OAuthService\n ) {}\n\n public signIn() {\n this.authService.signInWithRedirect();\n }\n\n}\n","<div [@fadeAnimation]=\"'in'\" class=\"inner mat-elevation-z5\" fxLayout=\"column\" fxLayoutAlign=\"center center\" fxLayoutGap=\"32px\">\n\n <div class=\"header\" fxFlex=\"nogrow\" fxLayout=\"column\" fxLayoutAlign=\"center center\">\n\n <mat-icon class=\"avatar-icon\" color=\"primary\" fxFlex=\"nogrow\">account_circle</mat-icon>\n\n </div>\n\n <div fxFlex=\"nogrow\" fxLayout=\"row\" fxLayoutAlign=\"center center\">\n\n <div fxFlex=\"nogrow\">\n <button (click)=\"signIn()\" color=\"primary\" fxFlex=\"nogrow\" mat-raised-button>\n <span fxLayout=\"row\" fxLayoutAlign=\"start center\" fxLayoutGap=\"16px\">\n <mat-icon fxFlex=\"nogrow\">login</mat-icon>\n <span fxFlex=\"nogrow\">Sign In</span>\n </span>\n </button>\n </div>\n\n </div>\n\n</div>\n\n","import { Routes } from '@angular/router';\nimport {\n ContainerComponent\n} from './container/container.component';\nimport { LoadingComponent } from './loading/loading.component';\nimport { SignInWithRedirectComponent } from './sign-in-with-redirect/sign-in-with-redirect.component';\nimport { OAuthExtractGuard } from './o-auth-extract.guard';\n\nexport const RXAP_O_AUTH_ROUTES: Routes = [\n {\n path: 'oauth',\n component: ContainerComponent,\n children: [\n {\n path: 'redirect',\n component: SignInWithRedirectComponent\n },\n {\n canActivate: [ OAuthExtractGuard ],\n path: '',\n component: LoadingComponent\n },\n {\n path: '**',\n redirectTo: ''\n }\n ]\n }\n];\n","import {\n Resolve,\n Router\n} from '@angular/router';\nimport {\n Inject,\n Injectable\n} from '@angular/core';\nimport { OAuthService } from './o-auth.service';\nimport { RXAP_O_AUTH_REDIRECT_SIGN_IN } from './tokens';\n\n@Injectable({ providedIn: 'root' })\nexport class ProfileResolve<T = Record<string, any>> implements Resolve<T> {\n\n constructor(\n @Inject(OAuthService)\n private readonly oAuthService: OAuthService,\n @Inject(Router)\n private readonly router: Router,\n @Inject(RXAP_O_AUTH_REDIRECT_SIGN_IN)\n private readonly redirectLogin: string[]\n ) {\n }\n\n public async resolve(): Promise<T> {\n const profile = await this.oAuthService.getProfile();\n\n if (!profile) {\n await this.router.navigate(this.redirectLogin);\n }\n\n return profile;\n }\n\n}\n","import { NgModule } from '@angular/core';\nimport { ContainerComponent } from './container.component';\nimport { RouterModule } from '@angular/router';\n\n\n@NgModule({\n declarations: [ ContainerComponent ],\n imports: [\n RouterModule\n ],\n exports: [ ContainerComponent ]\n})\nexport class ContainerComponentModule {}\n","import { NgModule } from '@angular/core';\nimport { LoadingComponent } from './loading.component';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\n\n\n@NgModule({\n declarations: [\n LoadingComponent\n ],\n imports: [\n MatProgressBarModule\n ],\n exports: [\n LoadingComponent\n ]\n})\nexport class LoadingComponentModule {\n}\n","import { NgModule } from '@angular/core';\nimport { SignInWithRedirectComponent } from './sign-in-with-redirect.component';\nimport { MatIconModule } from '@angular/material/icon';\nimport { CommonModule } from '@angular/common';\nimport { MatCardModule } from '@angular/material/card';\nimport { FlexLayoutModule } from '@angular/flex-layout';\nimport { MatButtonModule } from '@angular/material/button';\n\n\n@NgModule({\n declarations: [ SignInWithRedirectComponent ],\n imports: [\n MatCardModule,\n MatButtonModule,\n FlexLayoutModule,\n MatIconModule,\n CommonModule\n ],\n exports: [ SignInWithRedirectComponent ]\n})\nexport class SignInWithRedirectComponentModule {}\n","import { NgModule } from '@angular/core';\nimport { ContainerComponentModule } from './container/container.component.module';\nimport { LoadingComponentModule } from './loading/loading.component.module';\nimport {\n SignInWithRedirectComponentModule\n} from './sign-in-with-redirect/sign-in-with-redirect.component.module';\n\n@NgModule({\n exports: [\n ContainerComponentModule,\n LoadingComponentModule,\n SignInWithRedirectComponentModule\n ]\n})\nexport class OAuthRoutingModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["InjectionToken","HttpClient","Injectable","Inject","Optional","HttpHeaders","ReplaySubject","AuthenticationEventType","Router","NgModule","trigger","transition","style","animate","Component","ChangeDetectionStrategy","state","RouterModule","MatProgressBarModule","MatCardModule","MatButtonModule","FlexLayoutModule","MatIconModule","CommonModule"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QASa,qBAAqB,GAAG,IAAIA,iBAAc,CACrD,uBAAuB,EACvB;;QAYA,+BAEmB,IAAgB,EAG1B,eAAqC;YAArC,gCAAA,EAAA,sBAAqC;YAH3B,SAAI,GAAJ,IAAI,CAAY;YAG1B,oBAAe,GAAf,eAAe,CAAsB;SAC1C;QAEG,oCAAI,GAAJ,UAAK,UAA2C;;YACrD,IAAM,eAAe,GAAG,MAAA,UAAU,CAAC,eAAe,mCAAI,IAAI,CAAC,eAAe,CAAC;YAE3E,IAAI,CAAC,eAAe,EAAE;gBACpB,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;aACxD;YAED,OAAO,IAAI,CAAC,IAAI;iBACb,GAAG,CAAI,eAAe,EAAE;gBACvB,OAAO,EAAE;oBACP,aAAa,EAAE,YAAU,UAAU,CAAC,WAAa;iBAClD;gBACD,eAAe,EAAE,MAAA,UAAU,CAAC,eAAe,mCAAI,IAAI;aACpD,CAAC;iBACD,SAAS,EAAE,CAAC;SAChB;;;6IA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BACD,OAAO,EAAO;4BACZ,gBAAgB;yBACjB;qBACF;;;;QCKD;;;;yJAAa,iCAAiC;0JAAjC,iCAAiC,iBAV5B,2BAA2B,aAEzCC,kBAAa;YACbC,kBAAe;YACfC,2BAAgB;YAChBC,gBAAa;YACbC,mBAAY,aAEE,2BAA2B;0JAEhC,iCAAiC,YAT9B;gBACZJ,kBAAa;gBACbC,kBAAe;gBACfC,2BAAgB;gBAChBC,gBAAa;gBACbC,mBAAY;aACb;sHAGU,iCAAiC;sBAX7Cd,WAAQ;uBAAC;wBACR,YAAY,EAAE,CAAE,2BAA2B,CAAE;wBAC7C,OAAO,EAAO;4BACZU,kBAAa;4BACbC,kBAAe;4BACfC,2BAAgB;4BAChBC,gBAAa;4BACbC,mBAAY;yBACb;wBACD,OAAO,EAAO,CAAE,2BAA2B,CAAE;qBAC9C;;;;QCLD;;;;0IAAa,kBAAkB;2IAAlB,kBAAkB,YAL3B,wBAAwB;YACxB,sBAAsB;YACtB,iCAAiC;2IAGxB,kBAAkB,YAL3B,wBAAwB;YACxB,sBAAsB;YACtB,iCAAiC;sHAGxB,kBAAkB;sBAP9Bd,WAAQ;uBAAC;wBACR,OAAO,EAAE;4BACP,wBAAwB;4BACxB,sBAAsB;4BACtB,iCAAiC;yBAClC;qBACF;;;ICbD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -4,6 +4,8 @@ import { GetOAuthProfileMethod, PROFILE_AUTH_ENDPOINT } from './get-o-auth-profi
4
4
  import { OAuthMethod } from './o-auth.method';
5
5
  import { RXAP_O_AUTH_REDIRECT_SIGN_OUT, RXAP_O_AUTH_REDIRECT_URL } from './tokens';
6
6
  import { Router } from '@angular/router';
7
+ import { ReplaySubject } from 'rxjs';
8
+ import { AuthenticationEventType } from '@rxap/authentication';
7
9
  import * as i0 from "@angular/core";
8
10
  import * as i1 from "./o-auth.method";
9
11
  import * as i2 from "./get-o-auth-profile.method";
@@ -28,6 +30,7 @@ export class OAuthService {
28
30
  this.redirectSignOut = redirectSignOut;
29
31
  this.redirectUrl = redirectUrl;
30
32
  this.clientId = clientId;
33
+ this.events$ = new ReplaySubject();
31
34
  this._isAuthenticated = null;
32
35
  }
33
36
  get expiresAt() {
@@ -164,6 +167,9 @@ export class OAuthService {
164
167
  authEndpoint: this.authEndpoint,
165
168
  secret: this.secret,
166
169
  clientId: (_a = this.clientId) !== null && _a !== void 0 ? _a : undefined
170
+ }).catch(e => {
171
+ this.events$.next({ type: AuthenticationEventType.OnAuthError });
172
+ throw e;
167
173
  });
168
174
  this.authenticated(response, remember);
169
175
  return response;
@@ -208,6 +214,7 @@ export class OAuthService {
208
214
  }
209
215
  location.replace(`${this.ssoUrl}?redirect=${btoa(this.redirectUrl)}&secret=${this.secret}&action=signOut`);
210
216
  }
217
+ this.events$.next({ type: AuthenticationEventType.OnLogout });
211
218
  });
212
219
  }
213
220
  authenticated(response, remember) {
@@ -236,6 +243,7 @@ export class OAuthService {
236
243
  this.removeItem(EXPIRES_AT_LOCAL_STORAGE_KEY);
237
244
  }
238
245
  this._isAuthenticated = true;
246
+ this.events$.next({ type: AuthenticationEventType.OnAuthSuccess });
239
247
  }
240
248
  getKey(key) {
241
249
  return [this.secret, key].join('__');
@@ -1 +1 @@
1
- {"version":3,"file":"o-auth.service.js","sourceRoot":"","sources":["../../../../../libs/oauth/src/lib/o-auth.service.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,MAAM,EACN,UAAU,EACV,cAAc,EACd,QAAQ,EACT,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,WAAW,EAEZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,6BAA6B,EAC7B,wBAAwB,EACzB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;;;;;AAEzC,MAAM,CAAC,MAAM,YAAY,GAAG,IAA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AAmB;;0BAE1B,QAAQ;;0BACR,MAAM;2BAAC,YAAY;;0BAEnB,QAAQ;;0BACR,MAAM;2BAAC,aAAa;;0BAEpB,QAAQ;;0BACR,MAAM;2BAAC,6BAA6B;;0BAEpC,QAAQ;;0BACR,MAAM;2BAAC,wBAAwB;;0BAE/B,QAAQ;;0BACR,MAAM;2BAAC,eAAe","sourcesContent":["import {\n Inject,\n Injectable,\n InjectionToken,\n Optional\n} from '@angular/core';\nimport {\n GetOAuthProfileMethod,\n PROFILE_AUTH_ENDPOINT\n} from './get-o-auth-profile.method';\nimport {\n OAuthMethod,\n OAuthMethodResponse\n} from './o-auth.method';\nimport {\n RXAP_O_AUTH_REDIRECT_SIGN_OUT,\n RXAP_O_AUTH_REDIRECT_URL\n} from './tokens';\nimport { Router } from '@angular/router';\n\nexport const OAUTH_SECRET = new InjectionToken('OAUTH_SECRET');\nexport const OAUTH_AUTH_ENDPOINT = new InjectionToken('OAUTH_AUTH_ENDPOINT');\nexport const OAUTH_SSO_URL = new InjectionToken('OAUTH_SSO_URL');\nexport const OAUTH_CLIENT_ID = new InjectionToken('OAUTH_CLIENT_ID');\n\nexport const ACCESS_TOKEN_LOCAL_STORAGE_KEY = 'access_token';\nexport const REFRESH_TOKEN_LOCAL_STORAGE_KEY = 'refresh_token';\nexport const EXPIRES_AT_LOCAL_STORAGE_KEY = 'expires_at';\nexport const REMEMBER_LOCAL_STORAGE_KEY = 'remember';\n\nexport interface OAuthStatus {\n accessToken: string;\n refreshToken?: string | null;\n expiresIn: number;\n expiresAt: Date;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class OAuthService<Profile = any> {\n get expiresAt(): Date | null {\n const expiresAt = this.getItem(EXPIRES_AT_LOCAL_STORAGE_KEY);\n if (expiresAt) {\n return new Date(\n parseInt(this.getItem(EXPIRES_AT_LOCAL_STORAGE_KEY)!, 10)\n );\n }\n return null;\n }\n\n set expiresAt(value: Date | null) {\n if (value) {\n this.setItem(EXPIRES_AT_LOCAL_STORAGE_KEY, value.getTime().toFixed(0));\n } else {\n this.removeItem(EXPIRES_AT_LOCAL_STORAGE_KEY);\n }\n }\n\n get refreshToken(): string | null {\n return this.getItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY);\n }\n\n set refreshToken(value: string | null) {\n if (value) {\n this.setItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY, value);\n } else {\n this.removeItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY);\n }\n }\n\n get accessToken(): string | null {\n return this.getItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY);\n }\n\n set accessToken(value: string | null) {\n if (value) {\n this.setItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY, value);\n } else {\n this.removeItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY);\n }\n }\n\n /**\n * The time until the access token expires in seconds\n */\n public get expiresIn(): number | null {\n const expiresAt = this.expiresAt;\n if (expiresAt) {\n return Math.round(\n (expiresAt.getTime() - Date.now()) / 1000\n );\n }\n return null;\n }\n\n public get remember(): boolean {\n return !!this.getItem(REMEMBER_LOCAL_STORAGE_KEY);\n }\n\n public set remember(value: boolean) {\n if (value) {\n this.setItem(REMEMBER_LOCAL_STORAGE_KEY, 'true');\n } else {\n this.removeItem(REMEMBER_LOCAL_STORAGE_KEY);\n }\n }\n\n private _profile?: Profile | null;\n\n protected _isAuthenticated: boolean | null = null;\n\n public get profile(): Profile | null | undefined {\n return this._profile;\n }\n\n constructor(\n @Inject(OAuthMethod)\n public readonly oAuthMethod: OAuthMethod,\n @Inject(GetOAuthProfileMethod)\n public readonly getOAuthProfileMethod: GetOAuthProfileMethod,\n @Inject(Router)\n private readonly router: Router,\n @Optional()\n @Inject(PROFILE_AUTH_ENDPOINT)\n public profileEndpoint: string | null = null,\n @Optional()\n @Inject(OAUTH_AUTH_ENDPOINT)\n public authEndpoint: string | null = null,\n @Optional()\n @Inject(OAUTH_SECRET)\n public secret: string | null = null,\n @Optional()\n @Inject(OAUTH_SSO_URL)\n private readonly ssoUrl: string | null = null,\n @Optional()\n @Inject(RXAP_O_AUTH_REDIRECT_SIGN_OUT)\n private readonly redirectSignOut: string[] | null = null,\n @Optional()\n @Inject(RXAP_O_AUTH_REDIRECT_URL)\n private readonly redirectUrl: string | null = null,\n @Optional()\n @Inject(OAUTH_CLIENT_ID)\n public clientId: string | null = null,\n ) {}\n\n public signInWithRedirect(lastUrl?: string): void {\n if (!this.redirectUrl) {\n throw new Error('Redirect url is not defined');\n }\n location.replace(\n `${this.ssoUrl}?redirect=${btoa(this.redirectUrl)}&secret=${\n this.secret\n }&payload=${btoa(JSON.stringify({ lastUrl }))}`\n );\n }\n\n public async isAuthenticated(): Promise<boolean> {\n if (!this.secret) {\n throw new Error('The oauth secret is not defined');\n }\n\n if (!this.authEndpoint) {\n throw new Error('The oauth auth endpoint is not defined');\n }\n\n if (this._isAuthenticated !== null) {\n return this._isAuthenticated;\n }\n\n if (this.accessToken) {\n console.debug('Access token is defined: ' + this.accessToken);\n if (this.expiresIn && this.expiresIn > 60) {\n const profile = await this.getProfile();\n\n if (!profile) {\n console.log('profile is not defined');\n return (this._isAuthenticated = false);\n }\n\n this.authenticated(\n {\n refreshToken: this.refreshToken,\n accessToken: this.accessToken,\n expiresAt: this.expiresAt ?? new Date(Date.now() + 60 * 1000),\n expiresIn: this.expiresIn,\n },\n this.remember\n );\n\n return (this._isAuthenticated = true);\n } else {\n this.accessToken = null;\n this.expiresAt = null;\n console.warn(\n 'The access token expires soon. Use refresh token instead.'\n );\n }\n }\n if (this.refreshToken) {\n console.debug('Refresh token is defined: ' + this.refreshToken);\n try {\n await this.signInWithRefreshToken(this.refreshToken);\n return (this._isAuthenticated = true);\n } catch (e) {\n if (![401, 403, 400].includes(e.status)) {\n console.error('Could not sign in with refresh token', e.message);\n throw e;\n }\n console.warn('Refresh token is expired');\n }\n }\n\n console.warn('Unauthenticated');\n\n return (this._isAuthenticated = false);\n }\n\n public async signInWithEmailAndPassword(\n email: string,\n password: string,\n remember: boolean\n ): Promise<OAuthMethodResponse> {\n if (!this.secret) {\n throw new Error('The oauth secret is not defined');\n }\n\n if (!this.authEndpoint) {\n throw new Error('The oauth auth endpoint is not defined');\n }\n\n const response = await this.oAuthMethod.call({\n username: email,\n password: password,\n authEndpoint: this.authEndpoint,\n secret: this.secret,\n clientId: this.clientId ?? undefined\n });\n\n this.authenticated(response, remember);\n\n return response;\n }\n\n public async getProfile<T extends Profile = Profile>(): Promise<T | null> {\n let profile: T | null = null;\n\n if (!this.accessToken) {\n throw new Error('The access token is not defined');\n }\n\n if (this.profileEndpoint) {\n try {\n profile = await this.getOAuthProfileMethod.call({\n accessToken: this.accessToken,\n profileEndpoint: this.profileEndpoint,\n });\n } catch (e) {\n console.error('Could not request the user profile', e.message);\n }\n } else {\n console.warn('The profile endpoint is not defined!');\n }\n\n return (this._profile = profile);\n }\n\n public async signOut() {\n this.clearStorage();\n this.accessToken = null;\n this.refreshToken = null;\n this.expiresAt = null;\n this._isAuthenticated = false;\n if (this.redirectSignOut) {\n await this.router.navigate(this.redirectSignOut);\n } else {\n if (!this.redirectUrl) {\n throw new Error('Redirect url is not defined');\n }\n location.replace(\n `${this.ssoUrl}?redirect=${btoa(this.redirectUrl)}&secret=${this.secret}&action=signOut`\n );\n }\n }\n\n public authenticated(\n response: OAuthStatus,\n remember: boolean = this.remember ?? false\n ): void {\n this.accessToken = response.accessToken;\n this.refreshToken = response.refreshToken ?? null;\n this.expiresAt = response.expiresAt;\n\n console.log(`Authenticated until ${this.expiresAt.toISOString()}`);\n\n this.remember = remember;\n\n if (remember) {\n this.setItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY, response.accessToken);\n if (response.refreshToken) {\n this.setItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY, response.refreshToken);\n }\n this.setItem(REMEMBER_LOCAL_STORAGE_KEY, 'true');\n if (response.expiresAt) {\n console.log(`Authenticated until ${response.expiresAt.toISOString()}`);\n this.setItem(\n EXPIRES_AT_LOCAL_STORAGE_KEY,\n response.expiresAt.getTime().toFixed(0)\n );\n }\n } else {\n this.removeItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY);\n this.removeItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY);\n this.removeItem(REMEMBER_LOCAL_STORAGE_KEY);\n this.removeItem(EXPIRES_AT_LOCAL_STORAGE_KEY);\n }\n\n this._isAuthenticated = true;\n }\n\n private getKey(key: string): string {\n return [this.secret, key].join('__');\n }\n\n private getItem(key: string): string | null {\n return localStorage.getItem(this.getKey(key));\n }\n\n private setItem(key: string, value: string): void {\n localStorage.setItem(this.getKey(key), value);\n }\n\n private removeItem(key: string): void {\n localStorage.removeItem(this.getKey(key));\n }\n\n protected clearStorage() {\n this.removeItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY);\n this.removeItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY);\n this.removeItem(REMEMBER_LOCAL_STORAGE_KEY);\n this.removeItem(EXPIRES_AT_LOCAL_STORAGE_KEY);\n }\n\n private async signInWithRefreshToken(\n refreshToken: string\n ): Promise<OAuthMethodResponse> {\n if (!this.secret) {\n throw new Error('The oauth secret is not defined');\n }\n\n if (!this.authEndpoint) {\n throw new Error('The oauth auth endpoint is not defined');\n }\n\n const response = await this.oAuthMethod.call({\n refreshToken,\n authEndpoint: this.authEndpoint,\n secret: this.secret,\n clientId: this.clientId ?? undefined,\n });\n\n this.authenticated(response);\n\n return response;\n }\n}\n"]}
1
+ {"version":3,"file":"o-auth.service.js","sourceRoot":"","sources":["../../../../../libs/oauth/src/lib/o-auth.service.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,MAAM,EACN,UAAU,EACV,cAAc,EACd,QAAQ,EACT,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,WAAW,EAEZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,6BAA6B,EAC7B,wBAAwB,EACzB,MAAM,UAAU,CAAC;AA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B,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,QAAQ,EAAE,MAAA,IAAI,CAAC,QAAQ,mCAAI,SAAS;aACrC,CAAC,CAAC;YAEH,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;YAE7B,OAAO,QAAQ,CAAC;;KACjB;;0GA5UU,YAAY,kBAgFb,WAAW,aAEX,qBAAqB,aAErB,MAAM,aAGN,qBAAqB,6BAGrB,mBAAmB,6BAGnB,YAAY,6BAGZ,aAAa,6BAGb,6BAA6B,6BAG7B,wBAAwB,6BAGxB,eAAe;8GAzGd,YAAY,cADC,MAAM;4FACnB,YAAY;kBADxB,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;0BAiF7B,MAAM;2BAAC,WAAW;;0BAElB,MAAM;2BAAC,qBAAqB;;0BAE5B,MAAM;2BAAC,MAAM;;0BAEb,QAAQ;;0BACR,MAAM;2BAAC,qBAAqB;;0BAE5B,QAAQ;;0BACR,MAAM;2BAAC,mBAAmB;;0BAE1B,QAAQ;;0BACR,MAAM;2BAAC,YAAY;;0BAEnB,QAAQ;;0BACR,MAAM;2BAAC,aAAa;;0BAEpB,QAAQ;;0BACR,MAAM;2BAAC,6BAA6B;;0BAEpC,QAAQ;;0BACR,MAAM;2BAAC,wBAAwB;;0BAE/B,QAAQ;;0BACR,MAAM;2BAAC,eAAe","sourcesContent":["import {\n Inject,\n Injectable,\n InjectionToken,\n Optional\n} from '@angular/core';\nimport {\n GetOAuthProfileMethod,\n PROFILE_AUTH_ENDPOINT\n} from './get-o-auth-profile.method';\nimport {\n OAuthMethod,\n OAuthMethodResponse\n} from './o-auth.method';\nimport {\n RXAP_O_AUTH_REDIRECT_SIGN_OUT,\n RXAP_O_AUTH_REDIRECT_URL\n} from './tokens';\nimport { Router } from '@angular/router';\nimport { ReplaySubject, Subject } from 'rxjs';\nimport { AuthenticationEvent, AuthenticationEventType } from '@rxap/authentication';\n\nexport const OAUTH_SECRET = new InjectionToken('OAUTH_SECRET');\nexport const OAUTH_AUTH_ENDPOINT = new InjectionToken('OAUTH_AUTH_ENDPOINT');\nexport const OAUTH_SSO_URL = new InjectionToken('OAUTH_SSO_URL');\nexport const OAUTH_CLIENT_ID = new InjectionToken('OAUTH_CLIENT_ID');\n\nexport const ACCESS_TOKEN_LOCAL_STORAGE_KEY = 'access_token';\nexport const REFRESH_TOKEN_LOCAL_STORAGE_KEY = 'refresh_token';\nexport const EXPIRES_AT_LOCAL_STORAGE_KEY = 'expires_at';\nexport const REMEMBER_LOCAL_STORAGE_KEY = 'remember';\n\nexport interface OAuthStatus {\n accessToken: string;\n refreshToken?: string | null;\n expiresIn: number;\n expiresAt: Date;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class OAuthService<Profile = any> {\n\n public readonly events$ = new ReplaySubject<AuthenticationEvent>();\n\n get expiresAt(): Date | null {\n const expiresAt = this.getItem(EXPIRES_AT_LOCAL_STORAGE_KEY);\n if (expiresAt) {\n return new Date(\n parseInt(this.getItem(EXPIRES_AT_LOCAL_STORAGE_KEY)!, 10)\n );\n }\n return null;\n }\n\n set expiresAt(value: Date | null) {\n if (value) {\n this.setItem(EXPIRES_AT_LOCAL_STORAGE_KEY, value.getTime().toFixed(0));\n } else {\n this.removeItem(EXPIRES_AT_LOCAL_STORAGE_KEY);\n }\n }\n\n get refreshToken(): string | null {\n return this.getItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY);\n }\n\n set refreshToken(value: string | null) {\n if (value) {\n this.setItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY, value);\n } else {\n this.removeItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY);\n }\n }\n\n get accessToken(): string | null {\n return this.getItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY);\n }\n\n set accessToken(value: string | null) {\n if (value) {\n this.setItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY, value);\n } else {\n this.removeItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY);\n }\n }\n\n /**\n * The time until the access token expires in seconds\n */\n public get expiresIn(): number | null {\n const expiresAt = this.expiresAt;\n if (expiresAt) {\n return Math.round(\n (expiresAt.getTime() - Date.now()) / 1000\n );\n }\n return null;\n }\n\n public get remember(): boolean {\n return !!this.getItem(REMEMBER_LOCAL_STORAGE_KEY);\n }\n\n public set remember(value: boolean) {\n if (value) {\n this.setItem(REMEMBER_LOCAL_STORAGE_KEY, 'true');\n } else {\n this.removeItem(REMEMBER_LOCAL_STORAGE_KEY);\n }\n }\n\n private _profile?: Profile | null;\n\n protected _isAuthenticated: boolean | null = null;\n\n public get profile(): Profile | null | undefined {\n return this._profile;\n }\n\n constructor(\n @Inject(OAuthMethod)\n public readonly oAuthMethod: OAuthMethod,\n @Inject(GetOAuthProfileMethod)\n public readonly getOAuthProfileMethod: GetOAuthProfileMethod,\n @Inject(Router)\n private readonly router: Router,\n @Optional()\n @Inject(PROFILE_AUTH_ENDPOINT)\n public profileEndpoint: string | null = null,\n @Optional()\n @Inject(OAUTH_AUTH_ENDPOINT)\n public authEndpoint: string | null = null,\n @Optional()\n @Inject(OAUTH_SECRET)\n public secret: string | null = null,\n @Optional()\n @Inject(OAUTH_SSO_URL)\n private readonly ssoUrl: string | null = null,\n @Optional()\n @Inject(RXAP_O_AUTH_REDIRECT_SIGN_OUT)\n private readonly redirectSignOut: string[] | null = null,\n @Optional()\n @Inject(RXAP_O_AUTH_REDIRECT_URL)\n private readonly redirectUrl: string | null = null,\n @Optional()\n @Inject(OAUTH_CLIENT_ID)\n public clientId: string | null = null,\n ) {}\n\n public signInWithRedirect(lastUrl?: string): void {\n if (!this.redirectUrl) {\n throw new Error('Redirect url is not defined');\n }\n location.replace(\n `${this.ssoUrl}?redirect=${btoa(this.redirectUrl)}&secret=${\n this.secret\n }&payload=${btoa(JSON.stringify({ lastUrl }))}`\n );\n }\n\n public async isAuthenticated(): Promise<boolean> {\n if (!this.secret) {\n throw new Error('The oauth secret is not defined');\n }\n\n if (!this.authEndpoint) {\n throw new Error('The oauth auth endpoint is not defined');\n }\n\n if (this._isAuthenticated !== null) {\n return this._isAuthenticated;\n }\n\n if (this.accessToken) {\n console.debug('Access token is defined: ' + this.accessToken);\n if (this.expiresIn && this.expiresIn > 60) {\n const profile = await this.getProfile();\n\n if (!profile) {\n console.log('profile is not defined');\n return (this._isAuthenticated = false);\n }\n\n this.authenticated(\n {\n refreshToken: this.refreshToken,\n accessToken: this.accessToken,\n expiresAt: this.expiresAt ?? new Date(Date.now() + 60 * 1000),\n expiresIn: this.expiresIn,\n },\n this.remember\n );\n\n return (this._isAuthenticated = true);\n } else {\n this.accessToken = null;\n this.expiresAt = null;\n console.warn(\n 'The access token expires soon. Use refresh token instead.'\n );\n }\n }\n if (this.refreshToken) {\n console.debug('Refresh token is defined: ' + this.refreshToken);\n try {\n await this.signInWithRefreshToken(this.refreshToken);\n return (this._isAuthenticated = true);\n } catch (e) {\n if (![401, 403, 400].includes(e.status)) {\n console.error('Could not sign in with refresh token', e.message);\n throw e;\n }\n console.warn('Refresh token is expired');\n }\n }\n\n console.warn('Unauthenticated');\n\n return (this._isAuthenticated = false);\n }\n\n public async signInWithEmailAndPassword(\n email: string,\n password: string,\n remember: boolean\n ): Promise<OAuthMethodResponse> {\n if (!this.secret) {\n throw new Error('The oauth secret is not defined');\n }\n\n if (!this.authEndpoint) {\n throw new Error('The oauth auth endpoint is not defined');\n }\n\n const response = await this.oAuthMethod.call({\n username: email,\n password: password,\n authEndpoint: this.authEndpoint,\n secret: this.secret,\n clientId: this.clientId ?? undefined\n }).catch(e => {\n this.events$.next({ type: AuthenticationEventType.OnAuthError });\n throw e;\n });\n\n this.authenticated(response, remember);\n\n return response;\n }\n\n public async getProfile<T extends Profile = Profile>(): Promise<T | null> {\n let profile: T | null = null;\n\n if (!this.accessToken) {\n throw new Error('The access token is not defined');\n }\n\n if (this.profileEndpoint) {\n try {\n profile = await this.getOAuthProfileMethod.call({\n accessToken: this.accessToken,\n profileEndpoint: this.profileEndpoint,\n });\n } catch (e) {\n console.error('Could not request the user profile', e.message);\n }\n } else {\n console.warn('The profile endpoint is not defined!');\n }\n\n return (this._profile = profile);\n }\n\n public async signOut() {\n this.clearStorage();\n this.accessToken = null;\n this.refreshToken = null;\n this.expiresAt = null;\n this._isAuthenticated = false;\n if (this.redirectSignOut) {\n await this.router.navigate(this.redirectSignOut);\n } else {\n if (!this.redirectUrl) {\n throw new Error('Redirect url is not defined');\n }\n location.replace(\n `${this.ssoUrl}?redirect=${btoa(this.redirectUrl)}&secret=${this.secret}&action=signOut`\n );\n }\n this.events$.next({ type: AuthenticationEventType.OnLogout });\n }\n\n public authenticated(\n response: OAuthStatus,\n remember: boolean = this.remember ?? false\n ): void {\n this.accessToken = response.accessToken;\n this.refreshToken = response.refreshToken ?? null;\n this.expiresAt = response.expiresAt;\n\n console.log(`Authenticated until ${this.expiresAt.toISOString()}`);\n\n this.remember = remember;\n\n if (remember) {\n this.setItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY, response.accessToken);\n if (response.refreshToken) {\n this.setItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY, response.refreshToken);\n }\n this.setItem(REMEMBER_LOCAL_STORAGE_KEY, 'true');\n if (response.expiresAt) {\n console.log(`Authenticated until ${response.expiresAt.toISOString()}`);\n this.setItem(\n EXPIRES_AT_LOCAL_STORAGE_KEY,\n response.expiresAt.getTime().toFixed(0)\n );\n }\n } else {\n this.removeItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY);\n this.removeItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY);\n this.removeItem(REMEMBER_LOCAL_STORAGE_KEY);\n this.removeItem(EXPIRES_AT_LOCAL_STORAGE_KEY);\n }\n\n this._isAuthenticated = true;\n this.events$.next({ type: AuthenticationEventType.OnAuthSuccess });\n }\n\n private getKey(key: string): string {\n return [this.secret, key].join('__');\n }\n\n private getItem(key: string): string | null {\n return localStorage.getItem(this.getKey(key));\n }\n\n private setItem(key: string, value: string): void {\n localStorage.setItem(this.getKey(key), value);\n }\n\n private removeItem(key: string): void {\n localStorage.removeItem(this.getKey(key));\n }\n\n protected clearStorage() {\n this.removeItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY);\n this.removeItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY);\n this.removeItem(REMEMBER_LOCAL_STORAGE_KEY);\n this.removeItem(EXPIRES_AT_LOCAL_STORAGE_KEY);\n }\n\n private async signInWithRefreshToken(\n refreshToken: string\n ): Promise<OAuthMethodResponse> {\n if (!this.secret) {\n throw new Error('The oauth secret is not defined');\n }\n\n if (!this.authEndpoint) {\n throw new Error('The oauth auth endpoint is not defined');\n }\n\n const response = await this.oAuthMethod.call({\n refreshToken,\n authEndpoint: this.authEndpoint,\n secret: this.secret,\n clientId: this.clientId ?? undefined,\n });\n\n this.authenticated(response);\n\n return response;\n }\n}\n"]}
@@ -5,6 +5,8 @@ import { HttpClient, HttpHeaders } from '@angular/common/http';
5
5
  import { __awaiter } from 'tslib';
6
6
  import * as i1$1 from '@angular/router';
7
7
  import { Router, RouterModule } from '@angular/router';
8
+ import { ReplaySubject } from 'rxjs';
9
+ import { AuthenticationEventType } from '@rxap/authentication';
8
10
  import { trigger, transition, style, animate, state } from '@angular/animations';
9
11
  import * as i1$2 from '@angular/material/progress-bar';
10
12
  import { MatProgressBarModule } from '@angular/material/progress-bar';
@@ -205,6 +207,7 @@ class OAuthService {
205
207
  this.redirectSignOut = redirectSignOut;
206
208
  this.redirectUrl = redirectUrl;
207
209
  this.clientId = clientId;
210
+ this.events$ = new ReplaySubject();
208
211
  this._isAuthenticated = null;
209
212
  }
210
213
  get expiresAt() {
@@ -341,6 +344,9 @@ class OAuthService {
341
344
  authEndpoint: this.authEndpoint,
342
345
  secret: this.secret,
343
346
  clientId: (_a = this.clientId) !== null && _a !== void 0 ? _a : undefined
347
+ }).catch(e => {
348
+ this.events$.next({ type: AuthenticationEventType.OnAuthError });
349
+ throw e;
344
350
  });
345
351
  this.authenticated(response, remember);
346
352
  return response;
@@ -385,6 +391,7 @@ class OAuthService {
385
391
  }
386
392
  location.replace(`${this.ssoUrl}?redirect=${btoa(this.redirectUrl)}&secret=${this.secret}&action=signOut`);
387
393
  }
394
+ this.events$.next({ type: AuthenticationEventType.OnLogout });
388
395
  });
389
396
  }
390
397
  authenticated(response, remember) {
@@ -413,6 +420,7 @@ class OAuthService {
413
420
  this.removeItem(EXPIRES_AT_LOCAL_STORAGE_KEY);
414
421
  }
415
422
  this._isAuthenticated = true;
423
+ this.events$.next({ type: AuthenticationEventType.OnAuthSuccess });
416
424
  }
417
425
  getKey(key) {
418
426
  return [this.secret, key].join('__');
@@ -1 +1 @@
1
- {"version":3,"file":"rxap-oauth.js","sources":["../../../../libs/oauth/src/lib/get-o-auth-profile.method.ts","../../../../libs/oauth/src/lib/o-auth.method.ts","../../../../libs/oauth/src/lib/tokens.ts","../../../../libs/oauth/src/lib/o-auth.service.ts","../../../../libs/oauth/src/lib/o-auth-extract.guard.ts","../../../../libs/oauth/src/lib/o-auth-redirect.guard.ts","../../../../libs/oauth/src/lib/o-auth.module.ts","../../../../libs/oauth/src/lib/container/container.component.ts","../../../../libs/oauth/src/lib/container/container.component.html","../../../../libs/oauth/src/lib/loading/loading.component.ts","../../../../libs/oauth/src/lib/loading/loading.component.html","../../../../libs/oauth/src/lib/sign-in-with-redirect/sign-in-with-redirect.component.ts","../../../../libs/oauth/src/lib/sign-in-with-redirect/sign-in-with-redirect.component.html","../../../../libs/oauth/src/lib/routes.ts","../../../../libs/oauth/src/lib/profile.resolve.ts","../../../../libs/oauth/src/lib/container/container.component.module.ts","../../../../libs/oauth/src/lib/loading/loading.component.module.ts","../../../../libs/oauth/src/lib/sign-in-with-redirect/sign-in-with-redirect.component.module.ts","../../../../libs/oauth/src/lib/o-auth-routing.module.ts","../../../../libs/oauth/src/rxap-oauth.ts"],"sourcesContent":["import {\n Inject,\n Injectable,\n InjectionToken,\n Optional\n} from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport { Method } from '@rxap/utilities/rxjs';\n\nexport const PROFILE_AUTH_ENDPOINT = new InjectionToken(\n 'PROFILE_AUTH_ENDPOINT'\n);\n\nexport interface GetOAuthProfileMethodParameters {\n accessToken: string;\n profileEndpoint?: string | null;\n withCredentials?: boolean;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class GetOAuthProfileMethod<T = any>\n implements Method<T, GetOAuthProfileMethodParameters>\n{\n constructor(\n @Inject(HttpClient)\n private readonly http: HttpClient,\n @Optional()\n @Inject(PROFILE_AUTH_ENDPOINT)\n public profileEndpoint: string | null = null\n ) {}\n\n public call(parameters: GetOAuthProfileMethodParameters): Promise<T> {\n const profileEndpoint = parameters.profileEndpoint ?? this.profileEndpoint;\n\n if (!profileEndpoint) {\n throw new Error('The profile endpoint is not defined');\n }\n\n return this.http\n .get<T>(profileEndpoint, {\n headers: {\n Authorization: `Bearer ${parameters.accessToken}`,\n },\n withCredentials: parameters.withCredentials ?? true,\n })\n .toPromise();\n }\n}\n","import {\n Injectable,\n Inject\n} from '@angular/core';\nimport {\n HttpClient,\n HttpHeaders\n} from '@angular/common/http';\nimport { Method } from '@rxap/utilities/rxjs';\n\nexport interface OAuthMethodWithUsernamePasswordParameters {\n grantType?: string;\n username: string;\n password: string;\n secret: string;\n clientId?: string;\n authEndpoint: string;\n}\n\nexport interface OAuthMethodWithRefreshTokenParameters {\n grantType?: string;\n refreshToken: string;\n secret: string;\n clientId?: string;\n authEndpoint: string;\n}\n\nexport type OAuthMethodParameters = (\n | OAuthMethodWithUsernamePasswordParameters\n | OAuthMethodWithRefreshTokenParameters\n) & { withCredentials?: boolean };\n\nexport function IsOAuthMethodWithRefreshTokenParameters(\n parameters: OAuthMethodParameters\n): parameters is OAuthMethodWithRefreshTokenParameters {\n // eslint-disable-next-line no-prototype-builtins\n return parameters.hasOwnProperty('refreshToken');\n}\n\nexport function IsOAuthMethodWithUsernamePasswordParameters(\n parameters: OAuthMethodParameters\n): parameters is OAuthMethodWithUsernamePasswordParameters {\n // eslint-disable-next-line no-prototype-builtins\n return (\n parameters.hasOwnProperty('username') &&\n parameters.hasOwnProperty('password')\n );\n}\n\nexport function AssertOAuthMethodWithUsernamePasswordParameters(\n parameters: OAuthMethodParameters\n): asserts parameters is OAuthMethodWithUsernamePasswordParameters {\n if (!IsOAuthMethodWithUsernamePasswordParameters(parameters)) {\n throw new Error(\n 'The grant type password requires the parameters username and password'\n );\n }\n}\n\nexport function AssertOAuthMethodWithRefreshTokenParameters(\n parameters: OAuthMethodParameters\n): asserts parameters is OAuthMethodWithRefreshTokenParameters {\n if (!IsOAuthMethodWithRefreshTokenParameters(parameters)) {\n throw new Error(\n 'The grant type refresh token requires the parameters refreshToken'\n );\n }\n}\n\nexport function AssertOAuthMethodParameters(\n parameters: any\n): asserts parameters is OAuthMethodParameters {\n if (!parameters.authEndpoint) {\n throw new Error('The authEndpoint parameter must be defined');\n }\n if (!parameters.secret) {\n throw new Error('The secret parameter must be defined');\n }\n if (parameters.grantType) {\n switch (parameters.grantType) {\n case 'password':\n AssertOAuthMethodWithUsernamePasswordParameters(parameters);\n break;\n\n case 'refresh_token':\n AssertOAuthMethodWithRefreshTokenParameters(parameters);\n break;\n\n default:\n throw new Error(\n `The grant type '${parameters.grantType}' is not supported`\n );\n }\n } else {\n if (\n !IsOAuthMethodWithRefreshTokenParameters(parameters) &&\n !IsOAuthMethodWithUsernamePasswordParameters(parameters)\n ) {\n throw new Error(\n 'Either the refresh token or the username and password must be defined'\n );\n }\n }\n}\n\nexport interface OAuthResponse {\n access_token: string;\n refresh_token: string;\n expires_in: number;\n}\n\nexport interface OAuthMethodResponse {\n accessToken: string;\n refreshToken: string;\n expiresIn: number;\n expiresAt: Date;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class OAuthMethod\n implements Method<OAuthMethodResponse, OAuthMethodParameters>\n{\n constructor(\n @Inject(HttpClient)\n private readonly http: HttpClient\n ) {}\n\n public async call(\n parameters: OAuthMethodParameters\n ): Promise<OAuthMethodResponse> {\n AssertOAuthMethodParameters(parameters);\n\n const params = new URLSearchParams();\n const grantType = this.getGrantType(parameters);\n params.append('grant_type', grantType);\n switch (grantType) {\n case 'password':\n AssertOAuthMethodWithUsernamePasswordParameters(parameters);\n params.append('username', parameters.username);\n params.append('password', parameters.password);\n break;\n\n case 'refresh_token':\n AssertOAuthMethodWithRefreshTokenParameters(parameters);\n params.append('refresh_token', parameters.refreshToken);\n break;\n\n default:\n throw new Error('Not supported grant type');\n }\n\n let headers = new HttpHeaders();\n\n headers = headers.append('Content-type', 'application/x-www-form-urlencoded; charset=utf-8');\n\n if (parameters.secret && parameters.clientId) {\n params.append('client_id', parameters.clientId);\n params.append('client_secret', parameters.secret);\n } else {\n headers = headers.append('Authorization', `Basic ${parameters.secret}`);\n }\n\n const response = await this.http\n .post<OAuthResponse>(parameters.authEndpoint, params.toString(), {\n headers,\n withCredentials: parameters.withCredentials ?? true,\n })\n .toPromise();\n\n return {\n accessToken: response.access_token,\n refreshToken: response.refresh_token,\n expiresIn: response.expires_in,\n expiresAt: new Date(Date.now() + response.expires_in * 1000),\n };\n }\n\n private getGrantType(parameters: OAuthMethodParameters) {\n if (parameters.grantType) {\n return parameters.grantType;\n }\n\n if (IsOAuthMethodWithRefreshTokenParameters(parameters)) {\n return 'refresh_token';\n }\n\n if (IsOAuthMethodWithUsernamePasswordParameters(parameters)) {\n return 'password';\n }\n\n throw new Error('Could not guess the grant type');\n }\n}\n","import { InjectionToken } from '@angular/core';\n\nexport function DefaultRedirectSignInFactory(): string[] {\n return [ '/', 'authentication', 'login' ];\n}\n\nexport const RXAP_O_AUTH_REDIRECT_SIGN_IN = new InjectionToken('rxap/o-auth/redirect-sign-in', {\n providedIn: 'root',\n factory: DefaultRedirectSignInFactory\n});\n\nexport const RXAP_O_AUTH_REDIRECT_SIGN_OUT = new InjectionToken('rxap/o-auth/redirect-sign-out');\n\nexport function DefaultRedirectUrl(): string {\n return location.origin + '/oauth';\n}\n\nexport const RXAP_O_AUTH_REDIRECT_URL = new InjectionToken('rxap/o-auth/redirect-url', {\n providedIn: 'root',\n factory: DefaultRedirectUrl\n});\n","import {\n Inject,\n Injectable,\n InjectionToken,\n Optional\n} from '@angular/core';\nimport {\n GetOAuthProfileMethod,\n PROFILE_AUTH_ENDPOINT\n} from './get-o-auth-profile.method';\nimport {\n OAuthMethod,\n OAuthMethodResponse\n} from './o-auth.method';\nimport {\n RXAP_O_AUTH_REDIRECT_SIGN_OUT,\n RXAP_O_AUTH_REDIRECT_URL\n} from './tokens';\nimport { Router } from '@angular/router';\n\nexport const OAUTH_SECRET = new InjectionToken('OAUTH_SECRET');\nexport const OAUTH_AUTH_ENDPOINT = new InjectionToken('OAUTH_AUTH_ENDPOINT');\nexport const OAUTH_SSO_URL = new InjectionToken('OAUTH_SSO_URL');\nexport const OAUTH_CLIENT_ID = new InjectionToken('OAUTH_CLIENT_ID');\n\nexport const ACCESS_TOKEN_LOCAL_STORAGE_KEY = 'access_token';\nexport const REFRESH_TOKEN_LOCAL_STORAGE_KEY = 'refresh_token';\nexport const EXPIRES_AT_LOCAL_STORAGE_KEY = 'expires_at';\nexport const REMEMBER_LOCAL_STORAGE_KEY = 'remember';\n\nexport interface OAuthStatus {\n accessToken: string;\n refreshToken?: string | null;\n expiresIn: number;\n expiresAt: Date;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class OAuthService<Profile = any> {\n get expiresAt(): Date | null {\n const expiresAt = this.getItem(EXPIRES_AT_LOCAL_STORAGE_KEY);\n if (expiresAt) {\n return new Date(\n parseInt(this.getItem(EXPIRES_AT_LOCAL_STORAGE_KEY)!, 10)\n );\n }\n return null;\n }\n\n set expiresAt(value: Date | null) {\n if (value) {\n this.setItem(EXPIRES_AT_LOCAL_STORAGE_KEY, value.getTime().toFixed(0));\n } else {\n this.removeItem(EXPIRES_AT_LOCAL_STORAGE_KEY);\n }\n }\n\n get refreshToken(): string | null {\n return this.getItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY);\n }\n\n set refreshToken(value: string | null) {\n if (value) {\n this.setItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY, value);\n } else {\n this.removeItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY);\n }\n }\n\n get accessToken(): string | null {\n return this.getItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY);\n }\n\n set accessToken(value: string | null) {\n if (value) {\n this.setItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY, value);\n } else {\n this.removeItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY);\n }\n }\n\n /**\n * The time until the access token expires in seconds\n */\n public get expiresIn(): number | null {\n const expiresAt = this.expiresAt;\n if (expiresAt) {\n return Math.round(\n (expiresAt.getTime() - Date.now()) / 1000\n );\n }\n return null;\n }\n\n public get remember(): boolean {\n return !!this.getItem(REMEMBER_LOCAL_STORAGE_KEY);\n }\n\n public set remember(value: boolean) {\n if (value) {\n this.setItem(REMEMBER_LOCAL_STORAGE_KEY, 'true');\n } else {\n this.removeItem(REMEMBER_LOCAL_STORAGE_KEY);\n }\n }\n\n private _profile?: Profile | null;\n\n protected _isAuthenticated: boolean | null = null;\n\n public get profile(): Profile | null | undefined {\n return this._profile;\n }\n\n constructor(\n @Inject(OAuthMethod)\n public readonly oAuthMethod: OAuthMethod,\n @Inject(GetOAuthProfileMethod)\n public readonly getOAuthProfileMethod: GetOAuthProfileMethod,\n @Inject(Router)\n private readonly router: Router,\n @Optional()\n @Inject(PROFILE_AUTH_ENDPOINT)\n public profileEndpoint: string | null = null,\n @Optional()\n @Inject(OAUTH_AUTH_ENDPOINT)\n public authEndpoint: string | null = null,\n @Optional()\n @Inject(OAUTH_SECRET)\n public secret: string | null = null,\n @Optional()\n @Inject(OAUTH_SSO_URL)\n private readonly ssoUrl: string | null = null,\n @Optional()\n @Inject(RXAP_O_AUTH_REDIRECT_SIGN_OUT)\n private readonly redirectSignOut: string[] | null = null,\n @Optional()\n @Inject(RXAP_O_AUTH_REDIRECT_URL)\n private readonly redirectUrl: string | null = null,\n @Optional()\n @Inject(OAUTH_CLIENT_ID)\n public clientId: string | null = null,\n ) {}\n\n public signInWithRedirect(lastUrl?: string): void {\n if (!this.redirectUrl) {\n throw new Error('Redirect url is not defined');\n }\n location.replace(\n `${this.ssoUrl}?redirect=${btoa(this.redirectUrl)}&secret=${\n this.secret\n }&payload=${btoa(JSON.stringify({ lastUrl }))}`\n );\n }\n\n public async isAuthenticated(): Promise<boolean> {\n if (!this.secret) {\n throw new Error('The oauth secret is not defined');\n }\n\n if (!this.authEndpoint) {\n throw new Error('The oauth auth endpoint is not defined');\n }\n\n if (this._isAuthenticated !== null) {\n return this._isAuthenticated;\n }\n\n if (this.accessToken) {\n console.debug('Access token is defined: ' + this.accessToken);\n if (this.expiresIn && this.expiresIn > 60) {\n const profile = await this.getProfile();\n\n if (!profile) {\n console.log('profile is not defined');\n return (this._isAuthenticated = false);\n }\n\n this.authenticated(\n {\n refreshToken: this.refreshToken,\n accessToken: this.accessToken,\n expiresAt: this.expiresAt ?? new Date(Date.now() + 60 * 1000),\n expiresIn: this.expiresIn,\n },\n this.remember\n );\n\n return (this._isAuthenticated = true);\n } else {\n this.accessToken = null;\n this.expiresAt = null;\n console.warn(\n 'The access token expires soon. Use refresh token instead.'\n );\n }\n }\n if (this.refreshToken) {\n console.debug('Refresh token is defined: ' + this.refreshToken);\n try {\n await this.signInWithRefreshToken(this.refreshToken);\n return (this._isAuthenticated = true);\n } catch (e) {\n if (![401, 403, 400].includes(e.status)) {\n console.error('Could not sign in with refresh token', e.message);\n throw e;\n }\n console.warn('Refresh token is expired');\n }\n }\n\n console.warn('Unauthenticated');\n\n return (this._isAuthenticated = false);\n }\n\n public async signInWithEmailAndPassword(\n email: string,\n password: string,\n remember: boolean\n ): Promise<OAuthMethodResponse> {\n if (!this.secret) {\n throw new Error('The oauth secret is not defined');\n }\n\n if (!this.authEndpoint) {\n throw new Error('The oauth auth endpoint is not defined');\n }\n\n const response = await this.oAuthMethod.call({\n username: email,\n password: password,\n authEndpoint: this.authEndpoint,\n secret: this.secret,\n clientId: this.clientId ?? undefined\n });\n\n this.authenticated(response, remember);\n\n return response;\n }\n\n public async getProfile<T extends Profile = Profile>(): Promise<T | null> {\n let profile: T | null = null;\n\n if (!this.accessToken) {\n throw new Error('The access token is not defined');\n }\n\n if (this.profileEndpoint) {\n try {\n profile = await this.getOAuthProfileMethod.call({\n accessToken: this.accessToken,\n profileEndpoint: this.profileEndpoint,\n });\n } catch (e) {\n console.error('Could not request the user profile', e.message);\n }\n } else {\n console.warn('The profile endpoint is not defined!');\n }\n\n return (this._profile = profile);\n }\n\n public async signOut() {\n this.clearStorage();\n this.accessToken = null;\n this.refreshToken = null;\n this.expiresAt = null;\n this._isAuthenticated = false;\n if (this.redirectSignOut) {\n await this.router.navigate(this.redirectSignOut);\n } else {\n if (!this.redirectUrl) {\n throw new Error('Redirect url is not defined');\n }\n location.replace(\n `${this.ssoUrl}?redirect=${btoa(this.redirectUrl)}&secret=${this.secret}&action=signOut`\n );\n }\n }\n\n public authenticated(\n response: OAuthStatus,\n remember: boolean = this.remember ?? false\n ): void {\n this.accessToken = response.accessToken;\n this.refreshToken = response.refreshToken ?? null;\n this.expiresAt = response.expiresAt;\n\n console.log(`Authenticated until ${this.expiresAt.toISOString()}`);\n\n this.remember = remember;\n\n if (remember) {\n this.setItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY, response.accessToken);\n if (response.refreshToken) {\n this.setItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY, response.refreshToken);\n }\n this.setItem(REMEMBER_LOCAL_STORAGE_KEY, 'true');\n if (response.expiresAt) {\n console.log(`Authenticated until ${response.expiresAt.toISOString()}`);\n this.setItem(\n EXPIRES_AT_LOCAL_STORAGE_KEY,\n response.expiresAt.getTime().toFixed(0)\n );\n }\n } else {\n this.removeItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY);\n this.removeItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY);\n this.removeItem(REMEMBER_LOCAL_STORAGE_KEY);\n this.removeItem(EXPIRES_AT_LOCAL_STORAGE_KEY);\n }\n\n this._isAuthenticated = true;\n }\n\n private getKey(key: string): string {\n return [this.secret, key].join('__');\n }\n\n private getItem(key: string): string | null {\n return localStorage.getItem(this.getKey(key));\n }\n\n private setItem(key: string, value: string): void {\n localStorage.setItem(this.getKey(key), value);\n }\n\n private removeItem(key: string): void {\n localStorage.removeItem(this.getKey(key));\n }\n\n protected clearStorage() {\n this.removeItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY);\n this.removeItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY);\n this.removeItem(REMEMBER_LOCAL_STORAGE_KEY);\n this.removeItem(EXPIRES_AT_LOCAL_STORAGE_KEY);\n }\n\n private async signInWithRefreshToken(\n refreshToken: string\n ): Promise<OAuthMethodResponse> {\n if (!this.secret) {\n throw new Error('The oauth secret is not defined');\n }\n\n if (!this.authEndpoint) {\n throw new Error('The oauth auth endpoint is not defined');\n }\n\n const response = await this.oAuthMethod.call({\n refreshToken,\n authEndpoint: this.authEndpoint,\n secret: this.secret,\n clientId: this.clientId ?? undefined,\n });\n\n this.authenticated(response);\n\n return response;\n }\n}\n","import {\n ActivatedRouteSnapshot,\n CanActivate,\n UrlTree,\n Router\n} from '@angular/router';\nimport { Injectable } from '@angular/core';\nimport { OAuthService } from './o-auth.service';\n\n@Injectable({ providedIn: 'root' })\nexport class OAuthExtractGuard implements CanActivate {\n\n constructor(\n private readonly router: Router,\n private readonly oAuthService: OAuthService\n ) {}\n\n public canActivate(route: ActivatedRouteSnapshot): UrlTree {\n\n if (route.queryParamMap.has('accessToken') && route.queryParamMap.has('refreshToken') && route.queryParamMap.has('expiresIn')) {\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const accessToken = route.queryParamMap.get('accessToken')!;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const refreshToken = route.queryParamMap.get('refreshToken')!;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const expiresIn = parseInt(route.queryParamMap.get('expiresIn')!, 10);\n const payloadBase64 = route.queryParamMap.get('payload');\n\n const expiresAt = new Date(Date.now() + expiresIn * 1000);\n\n this.oAuthService.authenticated({\n accessToken,\n refreshToken,\n expiresIn,\n expiresAt\n }, true);\n\n let redirectUrl = '/';\n\n if (payloadBase64) {\n try {\n const payload = JSON.parse(atob(payloadBase64));\n console.debug('sso redirect payload', payload);\n if (payload.lastUrl) {\n redirectUrl = payload.lastUrl;\n }\n } catch (e) {\n console.error('Could not parse redirect payload', e.message);\n }\n }\n\n return this.router.createUrlTree([ redirectUrl ]);\n\n } else {\n console.warn('Not every query parameter is defined!');\n }\n\n return this.router.createUrlTree([ ...route.url.map(url => url.path), 'redirect' ]);\n }\n\n\n}\n","import {\n ActivatedRouteSnapshot,\n CanActivate,\n CanActivateChild,\n RouterStateSnapshot,\n UrlTree\n} from '@angular/router';\nimport {\n Injectable,\n Inject,\n isDevMode\n} from '@angular/core';\nimport { OAuthService } from './o-auth.service';\n\n@Injectable({ providedIn: 'root' })\nexport class OAuthRedirectGuard implements CanActivate, CanActivateChild {\n\n constructor(\n @Inject(OAuthService)\n private readonly oAuthService: OAuthService\n ) {\n }\n\n public async canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean | UrlTree> {\n\n const isAuthenticated = await this.oAuthService.isAuthenticated();\n\n console.log(`isAuthenticated: ${isAuthenticated}`);\n\n if (isAuthenticated) {\n return true;\n }\n\n this.oAuthService.signInWithRedirect(state.url);\n\n return false;\n\n }\n\n public canActivateChild(childRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean | UrlTree> {\n return this.canActivate(childRoute, state);\n }\n\n}\n","import {\n NgModule,\n ModuleWithProviders\n} from '@angular/core';\nimport {\n RXAP_O_AUTH_REDIRECT_SIGN_IN,\n RXAP_O_AUTH_REDIRECT_SIGN_OUT\n} from './tokens';\n\nexport interface OAuthModuleOptions {\n signInPath?: string[]\n signOutPath?: string[]\n}\n\n@NgModule()\nexport class OAuthModule {\n\n public static forRoot(options: OAuthModuleOptions = {}): ModuleWithProviders<OAuthModule> {\n return {\n ngModule: OAuthModule,\n providers: [\n {\n provide: RXAP_O_AUTH_REDIRECT_SIGN_IN,\n useValue: options.signInPath ?? [ '/', 'oauth', 'redirect' ]\n },\n {\n provide: RXAP_O_AUTH_REDIRECT_SIGN_OUT,\n useValue: options.signOutPath ?? null\n }\n ]\n };\n }\n\n}\n","import {\n Component,\n ChangeDetectionStrategy\n} from '@angular/core';\nimport { RouterOutlet } from '@angular/router';\nimport {\n trigger,\n transition,\n style,\n animate\n} from '@angular/animations';\n\n@Component({\n selector: 'rxap-container',\n templateUrl: './container.component.html',\n styleUrls: [ './container.component.scss' ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'rxap-container' },\n animations: [\n trigger('routeAnimations', [\n transition(\n ':enter',\n [\n style({ opacity: 0 }),\n animate('512ms', style({ opacity: 1 }))\n ]\n ),\n transition(\n ':leave',\n [\n style({ opacity: 1 }),\n animate('512ms', style({ opacity: 0 }))\n ]\n )\n ])\n ]\n})\nexport class ContainerComponent {\n\n public prepareRoute(outlet: RouterOutlet) {\n return outlet.isActivated ? outlet.activatedRoute : 'true';\n }\n\n}\n","<div [@routeAnimations]=\"prepareRoute(outlet)\" class=\"container\">\n\n <div class=\"split mat-elevation-z3\"></div>\n\n <router-outlet #outlet=\"outlet\"></router-outlet>\n\n</div>\n","import {\n ChangeDetectionStrategy,\n Component\n} from '@angular/core';\n\n@Component({\n selector: 'rxap-loading',\n templateUrl: './loading.component.html',\n styleUrls: [ './loading.component.scss' ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'rxap-loading' }\n})\nexport class LoadingComponent {\n}\n","<mat-progress-bar class=\"loading-bar\" mode=\"indeterminate\"></mat-progress-bar>\n","import {\n Component,\n ChangeDetectionStrategy\n} from '@angular/core';\nimport { OAuthService } from '../o-auth.service';\nimport {\n trigger,\n state,\n style,\n transition,\n animate\n} from '@angular/animations';\n\n@Component({\n selector: 'rxap-sign-in-with-redirect',\n templateUrl: './sign-in-with-redirect.component.html',\n styleUrls: [ './sign-in-with-redirect.component.scss' ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'rxap-sign-in-with-redirect' },\n animations: [\n trigger('fadeAnimation', [\n\n // the \"in\" style determines the \"resting\" state of the element when it is visible.\n state('in', style({ opacity: 1 })),\n\n // fade in when created. this could also be written as transition('void => *')\n transition(':enter', [\n style({ opacity: 0 }),\n animate(300)\n ]),\n\n // fade out when destroyed. this could also be written as transition('void => *')\n transition(\n ':leave',\n animate(300, style({ opacity: 0 }))\n )\n ])\n ]\n})\nexport class SignInWithRedirectComponent {\n\n constructor(\n private readonly authService: OAuthService\n ) {}\n\n public signIn() {\n this.authService.signInWithRedirect();\n }\n\n}\n","<div [@fadeAnimation]=\"'in'\" class=\"inner mat-elevation-z5\" fxLayout=\"column\" fxLayoutAlign=\"center center\" fxLayoutGap=\"32px\">\n\n <div class=\"header\" fxFlex=\"nogrow\" fxLayout=\"column\" fxLayoutAlign=\"center center\">\n\n <mat-icon class=\"avatar-icon\" color=\"primary\" fxFlex=\"nogrow\">account_circle</mat-icon>\n\n </div>\n\n <div fxFlex=\"nogrow\" fxLayout=\"row\" fxLayoutAlign=\"center center\">\n\n <div fxFlex=\"nogrow\">\n <button (click)=\"signIn()\" color=\"primary\" fxFlex=\"nogrow\" mat-raised-button>\n <span fxLayout=\"row\" fxLayoutAlign=\"start center\" fxLayoutGap=\"16px\">\n <mat-icon fxFlex=\"nogrow\">login</mat-icon>\n <span fxFlex=\"nogrow\">Sign In</span>\n </span>\n </button>\n </div>\n\n </div>\n\n</div>\n\n","import { Routes } from '@angular/router';\nimport {\n ContainerComponent\n} from './container/container.component';\nimport { LoadingComponent } from './loading/loading.component';\nimport { SignInWithRedirectComponent } from './sign-in-with-redirect/sign-in-with-redirect.component';\nimport { OAuthExtractGuard } from './o-auth-extract.guard';\n\nexport const RXAP_O_AUTH_ROUTES: Routes = [\n {\n path: 'oauth',\n component: ContainerComponent,\n children: [\n {\n path: 'redirect',\n component: SignInWithRedirectComponent\n },\n {\n canActivate: [ OAuthExtractGuard ],\n path: '',\n component: LoadingComponent\n },\n {\n path: '**',\n redirectTo: ''\n }\n ]\n }\n];\n","import {\n Resolve,\n Router\n} from '@angular/router';\nimport {\n Inject,\n Injectable\n} from '@angular/core';\nimport { OAuthService } from './o-auth.service';\nimport { RXAP_O_AUTH_REDIRECT_SIGN_IN } from './tokens';\n\n@Injectable({ providedIn: 'root' })\nexport class ProfileResolve<T = Record<string, any>> implements Resolve<T> {\n\n constructor(\n @Inject(OAuthService)\n private readonly oAuthService: OAuthService,\n @Inject(Router)\n private readonly router: Router,\n @Inject(RXAP_O_AUTH_REDIRECT_SIGN_IN)\n private readonly redirectLogin: string[]\n ) {\n }\n\n public async resolve(): Promise<T> {\n const profile = await this.oAuthService.getProfile();\n\n if (!profile) {\n await this.router.navigate(this.redirectLogin);\n }\n\n return profile;\n }\n\n}\n","import { NgModule } from '@angular/core';\nimport { ContainerComponent } from './container.component';\nimport { RouterModule } from '@angular/router';\n\n\n@NgModule({\n declarations: [ ContainerComponent ],\n imports: [\n RouterModule\n ],\n exports: [ ContainerComponent ]\n})\nexport class ContainerComponentModule {}\n","import { NgModule } from '@angular/core';\nimport { LoadingComponent } from './loading.component';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\n\n\n@NgModule({\n declarations: [\n LoadingComponent\n ],\n imports: [\n MatProgressBarModule\n ],\n exports: [\n LoadingComponent\n ]\n})\nexport class LoadingComponentModule {\n}\n","import { NgModule } from '@angular/core';\nimport { SignInWithRedirectComponent } from './sign-in-with-redirect.component';\nimport { MatIconModule } from '@angular/material/icon';\nimport { CommonModule } from '@angular/common';\nimport { MatCardModule } from '@angular/material/card';\nimport { FlexLayoutModule } from '@angular/flex-layout';\nimport { MatButtonModule } from '@angular/material/button';\n\n\n@NgModule({\n declarations: [ SignInWithRedirectComponent ],\n imports: [\n MatCardModule,\n MatButtonModule,\n FlexLayoutModule,\n MatIconModule,\n CommonModule\n ],\n exports: [ SignInWithRedirectComponent ]\n})\nexport class SignInWithRedirectComponentModule {}\n","import { NgModule } from '@angular/core';\nimport { ContainerComponentModule } from './container/container.component.module';\nimport { LoadingComponentModule } from './loading/loading.component.module';\nimport {\n SignInWithRedirectComponentModule\n} from './sign-in-with-redirect/sign-in-with-redirect.component.module';\n\n@NgModule({\n exports: [\n ContainerComponentModule,\n LoadingComponentModule,\n SignInWithRedirectComponentModule\n ]\n})\nexport class OAuthRoutingModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;MASa,qBAAqB,GAAG,IAAI,cAAc,CACrD,uBAAuB,EACvB;MASW,qBAAqB;IAGhC,YAEmB,IAAgB,EAG1B,kBAAiC,IAAI;QAH3B,SAAI,GAAJ,IAAI,CAAY;QAG1B,oBAAe,GAAf,eAAe,CAAsB;KAC1C;IAEG,IAAI,CAAC,UAA2C;;QACrD,MAAM,eAAe,GAAG,MAAA,UAAU,CAAC,eAAe,mCAAI,IAAI,CAAC,eAAe,CAAC;QAE3E,IAAI,CAAC,eAAe,EAAE;YACpB,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;SACxD;QAED,OAAO,IAAI,CAAC,IAAI;aACb,GAAG,CAAI,eAAe,EAAE;YACvB,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,UAAU,CAAC,WAAW,EAAE;aAClD;YACD,eAAe,EAAE,MAAA,UAAU,CAAC,eAAe,mCAAI,IAAI;SACpD,CAAC;aACD,SAAS,EAAE,CAAC;KAChB;;mHA1BU,qBAAqB,kBAItB,UAAU,aAGV,qBAAqB;uHAPpB,qBAAqB,cADR,MAAM;4FACnB,qBAAqB;kBADjC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;0BAK7B,MAAM;2BAAC,UAAU;;0BAEjB,QAAQ;;0BACR,MAAM;2BAAC,qBAAqB;;;SCKjB,uCA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,aAAa;YACb,eAAe;YACf,gBAAgB;YAChB,aAAa;YACb,YAAY;SACb;4FAGU,iCAAiC;kBAX7C,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAE,2BAA2B,CAAE;oBAC7C,OAAO,EAAO;wBACZ,aAAa;wBACb,eAAe;wBACf,gBAAgB;wBAChB,aAAa;wBACb,YAAY;qBACb;oBACD,OAAO,EAAO,CAAE,2BAA2B,CAAE;iBAC9C;;;MCLY,kBAAkB;;gHAAlB,kBAAkB;iHAAlB,kBAAkB,YAL3B,wBAAwB;QACxB,sBAAsB;QACtB,iCAAiC;iHAGxB,kBAAkB,YAL3B,wBAAwB;QACxB,sBAAsB;QACtB,iCAAiC;4FAGxB,kBAAkB;kBAP9B,QAAQ;mBAAC;oBACR,OAAO,EAAE;wBACP,wBAAwB;wBACxB,sBAAsB;wBACtB,iCAAiC;qBAClC;iBACF;;;ACbD;;;;;;"}
1
+ {"version":3,"file":"rxap-oauth.js","sources":["../../../../libs/oauth/src/lib/get-o-auth-profile.method.ts","../../../../libs/oauth/src/lib/o-auth.method.ts","../../../../libs/oauth/src/lib/tokens.ts","../../../../libs/oauth/src/lib/o-auth.service.ts","../../../../libs/oauth/src/lib/o-auth-extract.guard.ts","../../../../libs/oauth/src/lib/o-auth-redirect.guard.ts","../../../../libs/oauth/src/lib/o-auth.module.ts","../../../../libs/oauth/src/lib/container/container.component.ts","../../../../libs/oauth/src/lib/container/container.component.html","../../../../libs/oauth/src/lib/loading/loading.component.ts","../../../../libs/oauth/src/lib/loading/loading.component.html","../../../../libs/oauth/src/lib/sign-in-with-redirect/sign-in-with-redirect.component.ts","../../../../libs/oauth/src/lib/sign-in-with-redirect/sign-in-with-redirect.component.html","../../../../libs/oauth/src/lib/routes.ts","../../../../libs/oauth/src/lib/profile.resolve.ts","../../../../libs/oauth/src/lib/container/container.component.module.ts","../../../../libs/oauth/src/lib/loading/loading.component.module.ts","../../../../libs/oauth/src/lib/sign-in-with-redirect/sign-in-with-redirect.component.module.ts","../../../../libs/oauth/src/lib/o-auth-routing.module.ts","../../../../libs/oauth/src/rxap-oauth.ts"],"sourcesContent":["import {\n Inject,\n Injectable,\n InjectionToken,\n Optional\n} from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport { Method } from '@rxap/utilities/rxjs';\n\nexport const PROFILE_AUTH_ENDPOINT = new InjectionToken(\n 'PROFILE_AUTH_ENDPOINT'\n);\n\nexport interface GetOAuthProfileMethodParameters {\n accessToken: string;\n profileEndpoint?: string | null;\n withCredentials?: boolean;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class GetOAuthProfileMethod<T = any>\n implements Method<T, GetOAuthProfileMethodParameters>\n{\n constructor(\n @Inject(HttpClient)\n private readonly http: HttpClient,\n @Optional()\n @Inject(PROFILE_AUTH_ENDPOINT)\n public profileEndpoint: string | null = null\n ) {}\n\n public call(parameters: GetOAuthProfileMethodParameters): Promise<T> {\n const profileEndpoint = parameters.profileEndpoint ?? this.profileEndpoint;\n\n if (!profileEndpoint) {\n throw new Error('The profile endpoint is not defined');\n }\n\n return this.http\n .get<T>(profileEndpoint, {\n headers: {\n Authorization: `Bearer ${parameters.accessToken}`,\n },\n withCredentials: parameters.withCredentials ?? true,\n })\n .toPromise();\n }\n}\n","import {\n Injectable,\n Inject\n} from '@angular/core';\nimport {\n HttpClient,\n HttpHeaders\n} from '@angular/common/http';\nimport { Method } from '@rxap/utilities/rxjs';\n\nexport interface OAuthMethodWithUsernamePasswordParameters {\n grantType?: string;\n username: string;\n password: string;\n secret: string;\n clientId?: string;\n authEndpoint: string;\n}\n\nexport interface OAuthMethodWithRefreshTokenParameters {\n grantType?: string;\n refreshToken: string;\n secret: string;\n clientId?: string;\n authEndpoint: string;\n}\n\nexport type OAuthMethodParameters = (\n | OAuthMethodWithUsernamePasswordParameters\n | OAuthMethodWithRefreshTokenParameters\n) & { withCredentials?: boolean };\n\nexport function IsOAuthMethodWithRefreshTokenParameters(\n parameters: OAuthMethodParameters\n): parameters is OAuthMethodWithRefreshTokenParameters {\n // eslint-disable-next-line no-prototype-builtins\n return parameters.hasOwnProperty('refreshToken');\n}\n\nexport function IsOAuthMethodWithUsernamePasswordParameters(\n parameters: OAuthMethodParameters\n): parameters is OAuthMethodWithUsernamePasswordParameters {\n // eslint-disable-next-line no-prototype-builtins\n return (\n parameters.hasOwnProperty('username') &&\n parameters.hasOwnProperty('password')\n );\n}\n\nexport function AssertOAuthMethodWithUsernamePasswordParameters(\n parameters: OAuthMethodParameters\n): asserts parameters is OAuthMethodWithUsernamePasswordParameters {\n if (!IsOAuthMethodWithUsernamePasswordParameters(parameters)) {\n throw new Error(\n 'The grant type password requires the parameters username and password'\n );\n }\n}\n\nexport function AssertOAuthMethodWithRefreshTokenParameters(\n parameters: OAuthMethodParameters\n): asserts parameters is OAuthMethodWithRefreshTokenParameters {\n if (!IsOAuthMethodWithRefreshTokenParameters(parameters)) {\n throw new Error(\n 'The grant type refresh token requires the parameters refreshToken'\n );\n }\n}\n\nexport function AssertOAuthMethodParameters(\n parameters: any\n): asserts parameters is OAuthMethodParameters {\n if (!parameters.authEndpoint) {\n throw new Error('The authEndpoint parameter must be defined');\n }\n if (!parameters.secret) {\n throw new Error('The secret parameter must be defined');\n }\n if (parameters.grantType) {\n switch (parameters.grantType) {\n case 'password':\n AssertOAuthMethodWithUsernamePasswordParameters(parameters);\n break;\n\n case 'refresh_token':\n AssertOAuthMethodWithRefreshTokenParameters(parameters);\n break;\n\n default:\n throw new Error(\n `The grant type '${parameters.grantType}' is not supported`\n );\n }\n } else {\n if (\n !IsOAuthMethodWithRefreshTokenParameters(parameters) &&\n !IsOAuthMethodWithUsernamePasswordParameters(parameters)\n ) {\n throw new Error(\n 'Either the refresh token or the username and password must be defined'\n );\n }\n }\n}\n\nexport interface OAuthResponse {\n access_token: string;\n refresh_token: string;\n expires_in: number;\n}\n\nexport interface OAuthMethodResponse {\n accessToken: string;\n refreshToken: string;\n expiresIn: number;\n expiresAt: Date;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class OAuthMethod\n implements Method<OAuthMethodResponse, OAuthMethodParameters>\n{\n constructor(\n @Inject(HttpClient)\n private readonly http: HttpClient\n ) {}\n\n public async call(\n parameters: OAuthMethodParameters\n ): Promise<OAuthMethodResponse> {\n AssertOAuthMethodParameters(parameters);\n\n const params = new URLSearchParams();\n const grantType = this.getGrantType(parameters);\n params.append('grant_type', grantType);\n switch (grantType) {\n case 'password':\n AssertOAuthMethodWithUsernamePasswordParameters(parameters);\n params.append('username', parameters.username);\n params.append('password', parameters.password);\n break;\n\n case 'refresh_token':\n AssertOAuthMethodWithRefreshTokenParameters(parameters);\n params.append('refresh_token', parameters.refreshToken);\n break;\n\n default:\n throw new Error('Not supported grant type');\n }\n\n let headers = new HttpHeaders();\n\n headers = headers.append('Content-type', 'application/x-www-form-urlencoded; charset=utf-8');\n\n if (parameters.secret && parameters.clientId) {\n params.append('client_id', parameters.clientId);\n params.append('client_secret', parameters.secret);\n } else {\n headers = headers.append('Authorization', `Basic ${parameters.secret}`);\n }\n\n const response = await this.http\n .post<OAuthResponse>(parameters.authEndpoint, params.toString(), {\n headers,\n withCredentials: parameters.withCredentials ?? true,\n })\n .toPromise();\n\n return {\n accessToken: response.access_token,\n refreshToken: response.refresh_token,\n expiresIn: response.expires_in,\n expiresAt: new Date(Date.now() + response.expires_in * 1000),\n };\n }\n\n private getGrantType(parameters: OAuthMethodParameters) {\n if (parameters.grantType) {\n return parameters.grantType;\n }\n\n if (IsOAuthMethodWithRefreshTokenParameters(parameters)) {\n return 'refresh_token';\n }\n\n if (IsOAuthMethodWithUsernamePasswordParameters(parameters)) {\n return 'password';\n }\n\n throw new Error('Could not guess the grant type');\n }\n}\n","import { InjectionToken } from '@angular/core';\n\nexport function DefaultRedirectSignInFactory(): string[] {\n return [ '/', 'authentication', 'login' ];\n}\n\nexport const RXAP_O_AUTH_REDIRECT_SIGN_IN = new InjectionToken('rxap/o-auth/redirect-sign-in', {\n providedIn: 'root',\n factory: DefaultRedirectSignInFactory\n});\n\nexport const RXAP_O_AUTH_REDIRECT_SIGN_OUT = new InjectionToken('rxap/o-auth/redirect-sign-out');\n\nexport function DefaultRedirectUrl(): string {\n return location.origin + '/oauth';\n}\n\nexport const RXAP_O_AUTH_REDIRECT_URL = new InjectionToken('rxap/o-auth/redirect-url', {\n providedIn: 'root',\n factory: DefaultRedirectUrl\n});\n","import {\n Inject,\n Injectable,\n InjectionToken,\n Optional\n} from '@angular/core';\nimport {\n GetOAuthProfileMethod,\n PROFILE_AUTH_ENDPOINT\n} from './get-o-auth-profile.method';\nimport {\n OAuthMethod,\n OAuthMethodResponse\n} from './o-auth.method';\nimport {\n RXAP_O_AUTH_REDIRECT_SIGN_OUT,\n RXAP_O_AUTH_REDIRECT_URL\n} from './tokens';\nimport { Router } from '@angular/router';\nimport { ReplaySubject, Subject } from 'rxjs';\nimport { AuthenticationEvent, AuthenticationEventType } from '@rxap/authentication';\n\nexport const OAUTH_SECRET = new InjectionToken('OAUTH_SECRET');\nexport const OAUTH_AUTH_ENDPOINT = new InjectionToken('OAUTH_AUTH_ENDPOINT');\nexport const OAUTH_SSO_URL = new InjectionToken('OAUTH_SSO_URL');\nexport const OAUTH_CLIENT_ID = new InjectionToken('OAUTH_CLIENT_ID');\n\nexport const ACCESS_TOKEN_LOCAL_STORAGE_KEY = 'access_token';\nexport const REFRESH_TOKEN_LOCAL_STORAGE_KEY = 'refresh_token';\nexport const EXPIRES_AT_LOCAL_STORAGE_KEY = 'expires_at';\nexport const REMEMBER_LOCAL_STORAGE_KEY = 'remember';\n\nexport interface OAuthStatus {\n accessToken: string;\n refreshToken?: string | null;\n expiresIn: number;\n expiresAt: Date;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class OAuthService<Profile = any> {\n\n public readonly events$ = new ReplaySubject<AuthenticationEvent>();\n\n get expiresAt(): Date | null {\n const expiresAt = this.getItem(EXPIRES_AT_LOCAL_STORAGE_KEY);\n if (expiresAt) {\n return new Date(\n parseInt(this.getItem(EXPIRES_AT_LOCAL_STORAGE_KEY)!, 10)\n );\n }\n return null;\n }\n\n set expiresAt(value: Date | null) {\n if (value) {\n this.setItem(EXPIRES_AT_LOCAL_STORAGE_KEY, value.getTime().toFixed(0));\n } else {\n this.removeItem(EXPIRES_AT_LOCAL_STORAGE_KEY);\n }\n }\n\n get refreshToken(): string | null {\n return this.getItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY);\n }\n\n set refreshToken(value: string | null) {\n if (value) {\n this.setItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY, value);\n } else {\n this.removeItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY);\n }\n }\n\n get accessToken(): string | null {\n return this.getItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY);\n }\n\n set accessToken(value: string | null) {\n if (value) {\n this.setItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY, value);\n } else {\n this.removeItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY);\n }\n }\n\n /**\n * The time until the access token expires in seconds\n */\n public get expiresIn(): number | null {\n const expiresAt = this.expiresAt;\n if (expiresAt) {\n return Math.round(\n (expiresAt.getTime() - Date.now()) / 1000\n );\n }\n return null;\n }\n\n public get remember(): boolean {\n return !!this.getItem(REMEMBER_LOCAL_STORAGE_KEY);\n }\n\n public set remember(value: boolean) {\n if (value) {\n this.setItem(REMEMBER_LOCAL_STORAGE_KEY, 'true');\n } else {\n this.removeItem(REMEMBER_LOCAL_STORAGE_KEY);\n }\n }\n\n private _profile?: Profile | null;\n\n protected _isAuthenticated: boolean | null = null;\n\n public get profile(): Profile | null | undefined {\n return this._profile;\n }\n\n constructor(\n @Inject(OAuthMethod)\n public readonly oAuthMethod: OAuthMethod,\n @Inject(GetOAuthProfileMethod)\n public readonly getOAuthProfileMethod: GetOAuthProfileMethod,\n @Inject(Router)\n private readonly router: Router,\n @Optional()\n @Inject(PROFILE_AUTH_ENDPOINT)\n public profileEndpoint: string | null = null,\n @Optional()\n @Inject(OAUTH_AUTH_ENDPOINT)\n public authEndpoint: string | null = null,\n @Optional()\n @Inject(OAUTH_SECRET)\n public secret: string | null = null,\n @Optional()\n @Inject(OAUTH_SSO_URL)\n private readonly ssoUrl: string | null = null,\n @Optional()\n @Inject(RXAP_O_AUTH_REDIRECT_SIGN_OUT)\n private readonly redirectSignOut: string[] | null = null,\n @Optional()\n @Inject(RXAP_O_AUTH_REDIRECT_URL)\n private readonly redirectUrl: string | null = null,\n @Optional()\n @Inject(OAUTH_CLIENT_ID)\n public clientId: string | null = null,\n ) {}\n\n public signInWithRedirect(lastUrl?: string): void {\n if (!this.redirectUrl) {\n throw new Error('Redirect url is not defined');\n }\n location.replace(\n `${this.ssoUrl}?redirect=${btoa(this.redirectUrl)}&secret=${\n this.secret\n }&payload=${btoa(JSON.stringify({ lastUrl }))}`\n );\n }\n\n public async isAuthenticated(): Promise<boolean> {\n if (!this.secret) {\n throw new Error('The oauth secret is not defined');\n }\n\n if (!this.authEndpoint) {\n throw new Error('The oauth auth endpoint is not defined');\n }\n\n if (this._isAuthenticated !== null) {\n return this._isAuthenticated;\n }\n\n if (this.accessToken) {\n console.debug('Access token is defined: ' + this.accessToken);\n if (this.expiresIn && this.expiresIn > 60) {\n const profile = await this.getProfile();\n\n if (!profile) {\n console.log('profile is not defined');\n return (this._isAuthenticated = false);\n }\n\n this.authenticated(\n {\n refreshToken: this.refreshToken,\n accessToken: this.accessToken,\n expiresAt: this.expiresAt ?? new Date(Date.now() + 60 * 1000),\n expiresIn: this.expiresIn,\n },\n this.remember\n );\n\n return (this._isAuthenticated = true);\n } else {\n this.accessToken = null;\n this.expiresAt = null;\n console.warn(\n 'The access token expires soon. Use refresh token instead.'\n );\n }\n }\n if (this.refreshToken) {\n console.debug('Refresh token is defined: ' + this.refreshToken);\n try {\n await this.signInWithRefreshToken(this.refreshToken);\n return (this._isAuthenticated = true);\n } catch (e) {\n if (![401, 403, 400].includes(e.status)) {\n console.error('Could not sign in with refresh token', e.message);\n throw e;\n }\n console.warn('Refresh token is expired');\n }\n }\n\n console.warn('Unauthenticated');\n\n return (this._isAuthenticated = false);\n }\n\n public async signInWithEmailAndPassword(\n email: string,\n password: string,\n remember: boolean\n ): Promise<OAuthMethodResponse> {\n if (!this.secret) {\n throw new Error('The oauth secret is not defined');\n }\n\n if (!this.authEndpoint) {\n throw new Error('The oauth auth endpoint is not defined');\n }\n\n const response = await this.oAuthMethod.call({\n username: email,\n password: password,\n authEndpoint: this.authEndpoint,\n secret: this.secret,\n clientId: this.clientId ?? undefined\n }).catch(e => {\n this.events$.next({ type: AuthenticationEventType.OnAuthError });\n throw e;\n });\n\n this.authenticated(response, remember);\n\n return response;\n }\n\n public async getProfile<T extends Profile = Profile>(): Promise<T | null> {\n let profile: T | null = null;\n\n if (!this.accessToken) {\n throw new Error('The access token is not defined');\n }\n\n if (this.profileEndpoint) {\n try {\n profile = await this.getOAuthProfileMethod.call({\n accessToken: this.accessToken,\n profileEndpoint: this.profileEndpoint,\n });\n } catch (e) {\n console.error('Could not request the user profile', e.message);\n }\n } else {\n console.warn('The profile endpoint is not defined!');\n }\n\n return (this._profile = profile);\n }\n\n public async signOut() {\n this.clearStorage();\n this.accessToken = null;\n this.refreshToken = null;\n this.expiresAt = null;\n this._isAuthenticated = false;\n if (this.redirectSignOut) {\n await this.router.navigate(this.redirectSignOut);\n } else {\n if (!this.redirectUrl) {\n throw new Error('Redirect url is not defined');\n }\n location.replace(\n `${this.ssoUrl}?redirect=${btoa(this.redirectUrl)}&secret=${this.secret}&action=signOut`\n );\n }\n this.events$.next({ type: AuthenticationEventType.OnLogout });\n }\n\n public authenticated(\n response: OAuthStatus,\n remember: boolean = this.remember ?? false\n ): void {\n this.accessToken = response.accessToken;\n this.refreshToken = response.refreshToken ?? null;\n this.expiresAt = response.expiresAt;\n\n console.log(`Authenticated until ${this.expiresAt.toISOString()}`);\n\n this.remember = remember;\n\n if (remember) {\n this.setItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY, response.accessToken);\n if (response.refreshToken) {\n this.setItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY, response.refreshToken);\n }\n this.setItem(REMEMBER_LOCAL_STORAGE_KEY, 'true');\n if (response.expiresAt) {\n console.log(`Authenticated until ${response.expiresAt.toISOString()}`);\n this.setItem(\n EXPIRES_AT_LOCAL_STORAGE_KEY,\n response.expiresAt.getTime().toFixed(0)\n );\n }\n } else {\n this.removeItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY);\n this.removeItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY);\n this.removeItem(REMEMBER_LOCAL_STORAGE_KEY);\n this.removeItem(EXPIRES_AT_LOCAL_STORAGE_KEY);\n }\n\n this._isAuthenticated = true;\n this.events$.next({ type: AuthenticationEventType.OnAuthSuccess });\n }\n\n private getKey(key: string): string {\n return [this.secret, key].join('__');\n }\n\n private getItem(key: string): string | null {\n return localStorage.getItem(this.getKey(key));\n }\n\n private setItem(key: string, value: string): void {\n localStorage.setItem(this.getKey(key), value);\n }\n\n private removeItem(key: string): void {\n localStorage.removeItem(this.getKey(key));\n }\n\n protected clearStorage() {\n this.removeItem(ACCESS_TOKEN_LOCAL_STORAGE_KEY);\n this.removeItem(REFRESH_TOKEN_LOCAL_STORAGE_KEY);\n this.removeItem(REMEMBER_LOCAL_STORAGE_KEY);\n this.removeItem(EXPIRES_AT_LOCAL_STORAGE_KEY);\n }\n\n private async signInWithRefreshToken(\n refreshToken: string\n ): Promise<OAuthMethodResponse> {\n if (!this.secret) {\n throw new Error('The oauth secret is not defined');\n }\n\n if (!this.authEndpoint) {\n throw new Error('The oauth auth endpoint is not defined');\n }\n\n const response = await this.oAuthMethod.call({\n refreshToken,\n authEndpoint: this.authEndpoint,\n secret: this.secret,\n clientId: this.clientId ?? undefined,\n });\n\n this.authenticated(response);\n\n return response;\n }\n}\n","import {\n ActivatedRouteSnapshot,\n CanActivate,\n UrlTree,\n Router\n} from '@angular/router';\nimport { Injectable } from '@angular/core';\nimport { OAuthService } from './o-auth.service';\n\n@Injectable({ providedIn: 'root' })\nexport class OAuthExtractGuard implements CanActivate {\n\n constructor(\n private readonly router: Router,\n private readonly oAuthService: OAuthService\n ) {}\n\n public canActivate(route: ActivatedRouteSnapshot): UrlTree {\n\n if (route.queryParamMap.has('accessToken') && route.queryParamMap.has('refreshToken') && route.queryParamMap.has('expiresIn')) {\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const accessToken = route.queryParamMap.get('accessToken')!;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const refreshToken = route.queryParamMap.get('refreshToken')!;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const expiresIn = parseInt(route.queryParamMap.get('expiresIn')!, 10);\n const payloadBase64 = route.queryParamMap.get('payload');\n\n const expiresAt = new Date(Date.now() + expiresIn * 1000);\n\n this.oAuthService.authenticated({\n accessToken,\n refreshToken,\n expiresIn,\n expiresAt\n }, true);\n\n let redirectUrl = '/';\n\n if (payloadBase64) {\n try {\n const payload = JSON.parse(atob(payloadBase64));\n console.debug('sso redirect payload', payload);\n if (payload.lastUrl) {\n redirectUrl = payload.lastUrl;\n }\n } catch (e) {\n console.error('Could not parse redirect payload', e.message);\n }\n }\n\n return this.router.createUrlTree([ redirectUrl ]);\n\n } else {\n console.warn('Not every query parameter is defined!');\n }\n\n return this.router.createUrlTree([ ...route.url.map(url => url.path), 'redirect' ]);\n }\n\n\n}\n","import {\n ActivatedRouteSnapshot,\n CanActivate,\n CanActivateChild,\n RouterStateSnapshot,\n UrlTree\n} from '@angular/router';\nimport {\n Injectable,\n Inject,\n isDevMode\n} from '@angular/core';\nimport { OAuthService } from './o-auth.service';\n\n@Injectable({ providedIn: 'root' })\nexport class OAuthRedirectGuard implements CanActivate, CanActivateChild {\n\n constructor(\n @Inject(OAuthService)\n private readonly oAuthService: OAuthService\n ) {\n }\n\n public async canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean | UrlTree> {\n\n const isAuthenticated = await this.oAuthService.isAuthenticated();\n\n console.log(`isAuthenticated: ${isAuthenticated}`);\n\n if (isAuthenticated) {\n return true;\n }\n\n this.oAuthService.signInWithRedirect(state.url);\n\n return false;\n\n }\n\n public canActivateChild(childRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean | UrlTree> {\n return this.canActivate(childRoute, state);\n }\n\n}\n","import {\n NgModule,\n ModuleWithProviders\n} from '@angular/core';\nimport {\n RXAP_O_AUTH_REDIRECT_SIGN_IN,\n RXAP_O_AUTH_REDIRECT_SIGN_OUT\n} from './tokens';\n\nexport interface OAuthModuleOptions {\n signInPath?: string[]\n signOutPath?: string[]\n}\n\n@NgModule()\nexport class OAuthModule {\n\n public static forRoot(options: OAuthModuleOptions = {}): ModuleWithProviders<OAuthModule> {\n return {\n ngModule: OAuthModule,\n providers: [\n {\n provide: RXAP_O_AUTH_REDIRECT_SIGN_IN,\n useValue: options.signInPath ?? [ '/', 'oauth', 'redirect' ]\n },\n {\n provide: RXAP_O_AUTH_REDIRECT_SIGN_OUT,\n useValue: options.signOutPath ?? null\n }\n ]\n };\n }\n\n}\n","import {\n Component,\n ChangeDetectionStrategy\n} from '@angular/core';\nimport { RouterOutlet } from '@angular/router';\nimport {\n trigger,\n transition,\n style,\n animate\n} from '@angular/animations';\n\n@Component({\n selector: 'rxap-container',\n templateUrl: './container.component.html',\n styleUrls: [ './container.component.scss' ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'rxap-container' },\n animations: [\n trigger('routeAnimations', [\n transition(\n ':enter',\n [\n style({ opacity: 0 }),\n animate('512ms', style({ opacity: 1 }))\n ]\n ),\n transition(\n ':leave',\n [\n style({ opacity: 1 }),\n animate('512ms', style({ opacity: 0 }))\n ]\n )\n ])\n ]\n})\nexport class ContainerComponent {\n\n public prepareRoute(outlet: RouterOutlet) {\n return outlet.isActivated ? outlet.activatedRoute : 'true';\n }\n\n}\n","<div [@routeAnimations]=\"prepareRoute(outlet)\" class=\"container\">\n\n <div class=\"split mat-elevation-z3\"></div>\n\n <router-outlet #outlet=\"outlet\"></router-outlet>\n\n</div>\n","import {\n ChangeDetectionStrategy,\n Component\n} from '@angular/core';\n\n@Component({\n selector: 'rxap-loading',\n templateUrl: './loading.component.html',\n styleUrls: [ './loading.component.scss' ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'rxap-loading' }\n})\nexport class LoadingComponent {\n}\n","<mat-progress-bar class=\"loading-bar\" mode=\"indeterminate\"></mat-progress-bar>\n","import {\n Component,\n ChangeDetectionStrategy\n} from '@angular/core';\nimport { OAuthService } from '../o-auth.service';\nimport {\n trigger,\n state,\n style,\n transition,\n animate\n} from '@angular/animations';\n\n@Component({\n selector: 'rxap-sign-in-with-redirect',\n templateUrl: './sign-in-with-redirect.component.html',\n styleUrls: [ './sign-in-with-redirect.component.scss' ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'rxap-sign-in-with-redirect' },\n animations: [\n trigger('fadeAnimation', [\n\n // the \"in\" style determines the \"resting\" state of the element when it is visible.\n state('in', style({ opacity: 1 })),\n\n // fade in when created. this could also be written as transition('void => *')\n transition(':enter', [\n style({ opacity: 0 }),\n animate(300)\n ]),\n\n // fade out when destroyed. this could also be written as transition('void => *')\n transition(\n ':leave',\n animate(300, style({ opacity: 0 }))\n )\n ])\n ]\n})\nexport class SignInWithRedirectComponent {\n\n constructor(\n private readonly authService: OAuthService\n ) {}\n\n public signIn() {\n this.authService.signInWithRedirect();\n }\n\n}\n","<div [@fadeAnimation]=\"'in'\" class=\"inner mat-elevation-z5\" fxLayout=\"column\" fxLayoutAlign=\"center center\" fxLayoutGap=\"32px\">\n\n <div class=\"header\" fxFlex=\"nogrow\" fxLayout=\"column\" fxLayoutAlign=\"center center\">\n\n <mat-icon class=\"avatar-icon\" color=\"primary\" fxFlex=\"nogrow\">account_circle</mat-icon>\n\n </div>\n\n <div fxFlex=\"nogrow\" fxLayout=\"row\" fxLayoutAlign=\"center center\">\n\n <div fxFlex=\"nogrow\">\n <button (click)=\"signIn()\" color=\"primary\" fxFlex=\"nogrow\" mat-raised-button>\n <span fxLayout=\"row\" fxLayoutAlign=\"start center\" fxLayoutGap=\"16px\">\n <mat-icon fxFlex=\"nogrow\">login</mat-icon>\n <span fxFlex=\"nogrow\">Sign In</span>\n </span>\n </button>\n </div>\n\n </div>\n\n</div>\n\n","import { Routes } from '@angular/router';\nimport {\n ContainerComponent\n} from './container/container.component';\nimport { LoadingComponent } from './loading/loading.component';\nimport { SignInWithRedirectComponent } from './sign-in-with-redirect/sign-in-with-redirect.component';\nimport { OAuthExtractGuard } from './o-auth-extract.guard';\n\nexport const RXAP_O_AUTH_ROUTES: Routes = [\n {\n path: 'oauth',\n component: ContainerComponent,\n children: [\n {\n path: 'redirect',\n component: SignInWithRedirectComponent\n },\n {\n canActivate: [ OAuthExtractGuard ],\n path: '',\n component: LoadingComponent\n },\n {\n path: '**',\n redirectTo: ''\n }\n ]\n }\n];\n","import {\n Resolve,\n Router\n} from '@angular/router';\nimport {\n Inject,\n Injectable\n} from '@angular/core';\nimport { OAuthService } from './o-auth.service';\nimport { RXAP_O_AUTH_REDIRECT_SIGN_IN } from './tokens';\n\n@Injectable({ providedIn: 'root' })\nexport class ProfileResolve<T = Record<string, any>> implements Resolve<T> {\n\n constructor(\n @Inject(OAuthService)\n private readonly oAuthService: OAuthService,\n @Inject(Router)\n private readonly router: Router,\n @Inject(RXAP_O_AUTH_REDIRECT_SIGN_IN)\n private readonly redirectLogin: string[]\n ) {\n }\n\n public async resolve(): Promise<T> {\n const profile = await this.oAuthService.getProfile();\n\n if (!profile) {\n await this.router.navigate(this.redirectLogin);\n }\n\n return profile;\n }\n\n}\n","import { NgModule } from '@angular/core';\nimport { ContainerComponent } from './container.component';\nimport { RouterModule } from '@angular/router';\n\n\n@NgModule({\n declarations: [ ContainerComponent ],\n imports: [\n RouterModule\n ],\n exports: [ ContainerComponent ]\n})\nexport class ContainerComponentModule {}\n","import { NgModule } from '@angular/core';\nimport { LoadingComponent } from './loading.component';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\n\n\n@NgModule({\n declarations: [\n LoadingComponent\n ],\n imports: [\n MatProgressBarModule\n ],\n exports: [\n LoadingComponent\n ]\n})\nexport class LoadingComponentModule {\n}\n","import { NgModule } from '@angular/core';\nimport { SignInWithRedirectComponent } from './sign-in-with-redirect.component';\nimport { MatIconModule } from '@angular/material/icon';\nimport { CommonModule } from '@angular/common';\nimport { MatCardModule } from '@angular/material/card';\nimport { FlexLayoutModule } from '@angular/flex-layout';\nimport { MatButtonModule } from '@angular/material/button';\n\n\n@NgModule({\n declarations: [ SignInWithRedirectComponent ],\n imports: [\n MatCardModule,\n MatButtonModule,\n FlexLayoutModule,\n MatIconModule,\n CommonModule\n ],\n exports: [ SignInWithRedirectComponent ]\n})\nexport class SignInWithRedirectComponentModule {}\n","import { NgModule } from '@angular/core';\nimport { ContainerComponentModule } from './container/container.component.module';\nimport { LoadingComponentModule } from './loading/loading.component.module';\nimport {\n SignInWithRedirectComponentModule\n} from './sign-in-with-redirect/sign-in-with-redirect.component.module';\n\n@NgModule({\n exports: [\n ContainerComponentModule,\n LoadingComponentModule,\n SignInWithRedirectComponentModule\n ]\n})\nexport class OAuthRoutingModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;MASa,qBAAqB,GAAG,IAAI,cAAc,CACrD,uBAAuB,EACvB;MASW,qBAAqB;IAGhC,YAEmB,IAAgB,EAG1B,kBAAiC,IAAI;QAH3B,SAAI,GAAJ,IAAI,CAAY;QAG1B,oBAAe,GAAf,eAAe,CAAsB;KAC1C;IAEG,IAAI,CAAC,UAA2C;;QACrD,MAAM,eAAe,GAAG,MAAA,UAAU,CAAC,eAAe,mCAAI,IAAI,CAAC,eAAe,CAAC;QAE3E,IAAI,CAAC,eAAe,EAAE;YACpB,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;SACxD;QAED,OAAO,IAAI,CAA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,wBAAwB;QACxB,sBAAsB;QACtB,iCAAiC;4FAGxB,kBAAkB;kBAP9B,QAAQ;mBAAC;oBACR,OAAO,EAAE;wBACP,wBAAwB;wBACxB,sBAAsB;wBACtB,iCAAiC;qBAClC;iBACF;;;ACbD;;;;;;"}
@@ -2,6 +2,8 @@ import { InjectionToken } from '@angular/core';
2
2
  import { GetOAuthProfileMethod } from './get-o-auth-profile.method';
3
3
  import { OAuthMethod, OAuthMethodResponse } from './o-auth.method';
4
4
  import { Router } from '@angular/router';
5
+ import { ReplaySubject } from 'rxjs';
6
+ import { AuthenticationEvent } from '@rxap/authentication';
5
7
  import * as i0 from "@angular/core";
6
8
  export declare const OAUTH_SECRET: InjectionToken<unknown>;
7
9
  export declare const OAUTH_AUTH_ENDPOINT: InjectionToken<unknown>;
@@ -28,6 +30,7 @@ export declare class OAuthService<Profile = any> {
28
30
  private readonly redirectSignOut;
29
31
  private readonly redirectUrl;
30
32
  clientId: string | null;
33
+ readonly events$: ReplaySubject<AuthenticationEvent>;
31
34
  get expiresAt(): Date | null;
32
35
  set expiresAt(value: Date | null);
33
36
  get refreshToken(): string | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rxap/oauth",
3
- "version": "12.0.11",
3
+ "version": "12.1.0",
4
4
  "peerDependencies": {
5
5
  "@angular-devkit/schematics": "^12.2.9",
6
6
  "@angular/animations": "^12.0.1",
@@ -8,13 +8,23 @@
8
8
  "@angular/common": "^12.0.1",
9
9
  "@angular/core": "^12.0.1",
10
10
  "@angular/flex-layout": "^12.0.0-beta.34",
11
+ "@angular/forms": "^12.0.1",
12
+ "@angular/localize": "^12.0.1",
11
13
  "@angular/material": "^12.0.1",
14
+ "@angular/platform-browser": "^12.0.1",
12
15
  "@angular/router": "^12.0.1",
16
+ "@rxap/authentication": "^12.3.0",
17
+ "@rxap/config": "^12.3.0",
18
+ "@rxap/definition": "^12.0.8",
13
19
  "@rxap/directives": "^12.3.1",
20
+ "@rxap/forms": "^12.7.4",
14
21
  "@rxap/services": "^12.0.8",
15
22
  "@rxap/utilities": "^12.2.3",
16
23
  "reflect-metadata": "^0.1.13",
17
- "rxjs": "^6.5.5"
24
+ "rxjs": "^6.5.5",
25
+ "@rxap/schematics-ts-morph": "^12.3.2",
26
+ "uuid": "8.3.2",
27
+ "@rxap/validator": "0.0.2"
18
28
  },
19
29
  "schematics": "./collection.json",
20
30
  "ng-update": {
@@ -57,4 +67,4 @@
57
67
  "fesm2015": "fesm2015/rxap-oauth.js",
58
68
  "typings": "rxap-oauth.d.ts",
59
69
  "sideEffects": false
60
- }
70
+ }