keycloak-angular 7.3.0 → 7.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -10
- package/bundles/keycloak-angular.umd.js +15 -23
- package/bundles/keycloak-angular.umd.js.map +1 -1
- package/bundles/keycloak-angular.umd.min.js +2 -2
- package/bundles/keycloak-angular.umd.min.js.map +1 -1
- package/esm2015/lib/core/services/keycloak.service.js +14 -16
- package/esm5/lib/core/services/keycloak.service.js +13 -20
- package/fesm2015/keycloak-angular.js +13 -16
- package/fesm2015/keycloak-angular.js.map +1 -1
- package/fesm5/keycloak-angular.js +12 -20
- package/fesm5/keycloak-angular.js.map +1 -1
- package/keycloak-angular.metadata.json +1 -1
- package/lib/core/services/keycloak.service.d.ts +1 -1
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -45,6 +45,11 @@ This library helps you to use [keycloak-js](https://www.keycloak.org/docs/latest
|
|
|
45
45
|
npm i --save keycloak-angular
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
+
**Note about versions**:
|
|
49
|
+
|
|
50
|
+
- For Angular v9, please use keycloak-angular v7.3 or higher.
|
|
51
|
+
- For Angular v8 and bellow, keycloak-angular v7.2.
|
|
52
|
+
|
|
48
53
|
### keycloak-js
|
|
49
54
|
|
|
50
55
|
> Since keycloak-angular v.7.0.0, the [keycloak-js](https://www.npmjs.com/package/keycloak-js) dependency became a peer dependency. This change allows greater flexibility for choosing the keycloak-js adapter version and follows the [project documentation recommendation](https://www.keycloak.org/docs/latest/securing_apps/index.html#_javascript_adapter).
|
|
@@ -83,9 +88,9 @@ import { initializer } from './utils/app-init';
|
|
|
83
88
|
provide: APP_INITIALIZER,
|
|
84
89
|
useFactory: initializer,
|
|
85
90
|
multi: true,
|
|
86
|
-
deps: [KeycloakService]
|
|
87
|
-
}
|
|
88
|
-
]
|
|
91
|
+
deps: [KeycloakService],
|
|
92
|
+
},
|
|
93
|
+
],
|
|
89
94
|
})
|
|
90
95
|
export class AppModule {}
|
|
91
96
|
```
|
|
@@ -126,10 +131,10 @@ const keycloakService = new KeycloakService();
|
|
|
126
131
|
providers: [
|
|
127
132
|
{
|
|
128
133
|
provide: KeycloakService,
|
|
129
|
-
useValue: keycloakService
|
|
130
|
-
}
|
|
134
|
+
useValue: keycloakService,
|
|
135
|
+
},
|
|
131
136
|
],
|
|
132
|
-
entryComponents: [AppComponent]
|
|
137
|
+
entryComponents: [AppComponent],
|
|
133
138
|
})
|
|
134
139
|
export class AppModule implements DoBootstrap {
|
|
135
140
|
ngDoBootstrap(appRef: ApplicationRef) {
|
|
@@ -140,7 +145,9 @@ export class AppModule implements DoBootstrap {
|
|
|
140
145
|
|
|
141
146
|
appRef.bootstrap(AppComponent);
|
|
142
147
|
})
|
|
143
|
-
.catch(error =>
|
|
148
|
+
.catch((error) =>
|
|
149
|
+
console.error('[ngDoBootstrap] init Keycloak failed', error)
|
|
150
|
+
);
|
|
144
151
|
}
|
|
145
152
|
}
|
|
146
153
|
```
|
|
@@ -218,14 +225,14 @@ try {
|
|
|
218
225
|
config: {
|
|
219
226
|
url: 'http://localhost:8080/auth',
|
|
220
227
|
realm: 'your-realm',
|
|
221
|
-
clientId: 'client-id'
|
|
228
|
+
clientId: 'client-id',
|
|
222
229
|
},
|
|
223
230
|
initOptions: {
|
|
224
231
|
onLoad: 'login-required',
|
|
225
|
-
checkLoginIframe: false
|
|
232
|
+
checkLoginIframe: false,
|
|
226
233
|
},
|
|
227
234
|
enableBearerInterceptor: true,
|
|
228
|
-
bearerExcludedUrls: ['/assets', '/clients/public']
|
|
235
|
+
bearerExcludedUrls: ['/assets', '/clients/public'],
|
|
229
236
|
});
|
|
230
237
|
resolve();
|
|
231
238
|
} catch (error) {}
|
|
@@ -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('rxjs'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define('keycloak-angular', ['exports', '@angular/core', '@angular/common/http', 'rxjs', '
|
|
4
|
-
(global = global || self, factory(global['keycloak-angular'] = {}, global.ng.core, global.ng.common.http, global.rxjs, global.
|
|
5
|
-
}(this, (function (exports, core, http, rxjs,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common/http'), require('rxjs'), require('rxjs/operators'), require('keycloak-js'), require('@angular/common')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('keycloak-angular', ['exports', '@angular/core', '@angular/common/http', 'rxjs', 'rxjs/operators', 'keycloak-js', '@angular/common'], factory) :
|
|
4
|
+
(global = global || self, factory(global['keycloak-angular'] = {}, global.ng.core, global.ng.common.http, global.rxjs, global.rxjs.operators, global.Keycloak, global.ng.common));
|
|
5
|
+
}(this, (function (exports, core, http, rxjs, operators, Keycloak_, common) { 'use strict';
|
|
6
6
|
|
|
7
7
|
/*! *****************************************************************************
|
|
8
8
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -286,7 +286,7 @@
|
|
|
286
286
|
this._instance.onAuthError = function (errorData) {
|
|
287
287
|
_this._keycloakEvents$.next({
|
|
288
288
|
args: errorData,
|
|
289
|
-
type: exports.KeycloakEventType.OnAuthError
|
|
289
|
+
type: exports.KeycloakEventType.OnAuthError,
|
|
290
290
|
});
|
|
291
291
|
};
|
|
292
292
|
this._instance.onAuthLogout = function () {
|
|
@@ -294,12 +294,12 @@
|
|
|
294
294
|
};
|
|
295
295
|
this._instance.onAuthRefreshSuccess = function () {
|
|
296
296
|
_this._keycloakEvents$.next({
|
|
297
|
-
type: exports.KeycloakEventType.OnAuthRefreshSuccess
|
|
297
|
+
type: exports.KeycloakEventType.OnAuthRefreshSuccess,
|
|
298
298
|
});
|
|
299
299
|
};
|
|
300
300
|
this._instance.onAuthRefreshError = function () {
|
|
301
301
|
_this._keycloakEvents$.next({
|
|
302
|
-
type: exports.KeycloakEventType.OnAuthRefreshError
|
|
302
|
+
type: exports.KeycloakEventType.OnAuthRefreshError,
|
|
303
303
|
});
|
|
304
304
|
};
|
|
305
305
|
this._instance.onAuthSuccess = function () {
|
|
@@ -307,13 +307,13 @@
|
|
|
307
307
|
};
|
|
308
308
|
this._instance.onTokenExpired = function () {
|
|
309
309
|
_this._keycloakEvents$.next({
|
|
310
|
-
type: exports.KeycloakEventType.OnTokenExpired
|
|
310
|
+
type: exports.KeycloakEventType.OnTokenExpired,
|
|
311
311
|
});
|
|
312
312
|
};
|
|
313
313
|
this._instance.onReady = function (authenticated) {
|
|
314
314
|
_this._keycloakEvents$.next({
|
|
315
315
|
args: authenticated,
|
|
316
|
-
type: exports.KeycloakEventType.OnReady
|
|
316
|
+
type: exports.KeycloakEventType.OnReady,
|
|
317
317
|
});
|
|
318
318
|
};
|
|
319
319
|
};
|
|
@@ -330,7 +330,7 @@
|
|
|
330
330
|
else {
|
|
331
331
|
excludedUrl = {
|
|
332
332
|
urlPattern: new RegExp(item.url, 'i'),
|
|
333
|
-
httpMethods: item.httpMethods
|
|
333
|
+
httpMethods: item.httpMethods,
|
|
334
334
|
};
|
|
335
335
|
}
|
|
336
336
|
excludedUrls.push(excludedUrl);
|
|
@@ -403,7 +403,7 @@
|
|
|
403
403
|
switch (_a.label) {
|
|
404
404
|
case 0:
|
|
405
405
|
options = {
|
|
406
|
-
redirectUri: redirectUri
|
|
406
|
+
redirectUri: redirectUri,
|
|
407
407
|
};
|
|
408
408
|
return [4, toPromise(this._instance.logout(options))];
|
|
409
409
|
case 1:
|
|
@@ -511,7 +511,7 @@
|
|
|
511
511
|
}
|
|
512
512
|
_a = this;
|
|
513
513
|
return [4, toPromise(this._instance.loadUserProfile())];
|
|
514
|
-
case 1: return [2, _a._userProfile = _b.sent()];
|
|
514
|
+
case 1: return [2, (_a._userProfile = _b.sent())];
|
|
515
515
|
}
|
|
516
516
|
});
|
|
517
517
|
});
|
|
@@ -554,17 +554,9 @@
|
|
|
554
554
|
KeycloakService.prototype.addTokenToHeader = function (headers) {
|
|
555
555
|
var _this = this;
|
|
556
556
|
if (headers === void 0) { headers = new http.HttpHeaders(); }
|
|
557
|
-
return rxjs.from(
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
switch (_a.label) {
|
|
561
|
-
case 0: return [4, this.getToken()];
|
|
562
|
-
case 1:
|
|
563
|
-
token = _a.sent();
|
|
564
|
-
return [2, headers.set(this._authorizationHeaderName, this._bearerPrefix + token)];
|
|
565
|
-
}
|
|
566
|
-
});
|
|
567
|
-
}); });
|
|
557
|
+
return rxjs.from(this.getToken()).pipe(operators.map(function (token) {
|
|
558
|
+
return headers.set(_this._authorizationHeaderName, _this._bearerPrefix + token);
|
|
559
|
+
}));
|
|
568
560
|
};
|
|
569
561
|
KeycloakService.prototype.getKeycloakInstance = function () {
|
|
570
562
|
return this._instance;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keycloak-angular.umd.js","sources":["../../../node_modules/tslib/tslib.es6.js","ng://keycloak-angular/lib/core/interfaces/keycloak-event.ts","ng://keycloak-angular/lib/core/services/keycloak-auth-guard.ts","ng://keycloak-angular/lib/core/utils/to-promise.ts","ng://keycloak-angular/lib/core/services/keycloak.service.ts","ng://keycloak-angular/lib/core/interceptors/keycloak-bearer.interceptor.ts","ng://keycloak-angular/lib/core/core.module.ts","ng://keycloak-angular/lib/keycloak-angular.module.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\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 (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\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 function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = 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\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\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 __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\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 (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = 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, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","/**\n * @license\n * Copyright Mauricio Gemelli Vigolo and contributors.\n *\n * Use of this source code is governed by a MIT-style license that can be\n * found in the LICENSE file at https://github.com/mauriciovigolo/keycloak-angular/LICENSE\n */\n\n/**\n * Keycloak event types, as described at the keycloak-js documentation:\n * https://www.keycloak.org/docs/latest/securing_apps/index.html#callback-events\n */\nexport enum KeycloakEventType {\n /**\n * Called if there was an error during authentication.\n */\n OnAuthError,\n /**\n * Called if the user is logged out\n * (will only be called if the session status iframe is enabled, or in Cordova mode).\n */\n OnAuthLogout,\n /**\n * Called if there was an error while trying to refresh the token.\n */\n OnAuthRefreshError,\n /**\n * Called when the token is refreshed.\n */\n OnAuthRefreshSuccess,\n /**\n * Called when a user is successfully authenticated.\n */\n OnAuthSuccess,\n /**\n * Called when the adapter is initialized.\n */\n OnReady,\n /**\n * Called when the access token is expired. If a refresh token is available the token\n * can be refreshed with updateToken, or in cases where it is not (that is, with implicit flow)\n * you can redirect to login screen to obtain a new access token.\n */\n OnTokenExpired\n}\n\n/**\n * Structure of an event triggered by Keycloak, contains it's type\n * and arguments (if any).\n */\nexport interface KeycloakEvent {\n /**\n * Event type as described at {@link KeycloakEventType}.\n */\n type: KeycloakEventType;\n /**\n * Arguments from the keycloak-js event function.\n */\n args?: any;\n}\n","/**\n * @license\n * Copyright Mauricio Gemelli Vigolo and contributors.\n *\n * Use of this source code is governed by a MIT-style license that can be\n * found in the LICENSE file at https://github.com/mauriciovigolo/keycloak-angular/LICENSE\n */\n\nimport { CanActivate, Router, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree } from '@angular/router';\n\nimport { KeycloakService } from './keycloak.service';\n\n/**\n * A simple guard implementation out of the box. This class should be inherited and\n * implemented by the application. The only method that should be implemented is #isAccessAllowed.\n * The reason for this is that the authorization flow is usually not unique, so in this way you will\n * have more freedom to customize your authorization flow.\n */\nexport abstract class KeycloakAuthGuard implements CanActivate {\n /**\n * Indicates if the user is authenticated or not.\n */\n protected authenticated: boolean;\n /**\n * Roles of the logged user. It contains the clientId and realm user roles.\n */\n protected roles: string[];\n\n constructor(protected router: Router, protected keycloakAngular: KeycloakService) {}\n\n /**\n * CanActivate checks if the user is logged in and get the full list of roles (REALM + CLIENT)\n * of the logged user. This values are set to authenticated and roles params.\n *\n * @param route\n * @param state\n */\n canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean | UrlTree> {\n return new Promise(async (resolve, reject) => {\n try {\n this.authenticated = await this.keycloakAngular.isLoggedIn();\n this.roles = await this.keycloakAngular.getUserRoles(true);\n\n const result = await this.isAccessAllowed(route, state);\n resolve(result);\n } catch (error) {\n reject('An error happened during access validation. Details:' + error);\n }\n });\n }\n\n /**\n * Create your own customized authorization flow in this method. From here you already known\n * if the user is authenticated (this.authenticated) and the user roles (this.roles).\n *\n * Return a UrlTree if the user should be redirected to another route.\n *\n * @param route\n * @param state\n */\n abstract isAccessAllowed(\n route: ActivatedRouteSnapshot,\n state: RouterStateSnapshot\n ): Promise<boolean | UrlTree>;\n}\n","import { KeycloakPromise } from 'keycloak-js';\n\ninterface LegacyKeycloakPromise<T, E> {\n success(callback: (result: T) => void): LegacyKeycloakPromise<T, E>;\n error(callback: (result: E) => void): LegacyKeycloakPromise<T, E>;\n}\n\n/**\n * Converts a 'legacy' Keycloak promise to a standardized one.\n *\n * @param originalPromise The Keycloak promise to convert.\n */\nexport function toPromise<T, E>(originalPromise: LegacyKeycloakPromise<T, E> | KeycloakPromise<T, E>) {\n if (originalPromise instanceof Promise) {\n return originalPromise;\n }\n\n return new Promise<T>((resolve, reject) => {\n originalPromise.success(resolve);\n originalPromise.error(reject);\n });\n}\n","/**\n * @license\n * Copyright Mauricio Gemelli Vigolo and contributors.\n *\n * Use of this source code is governed by a MIT-style license that can be\n * found in the LICENSE file at https://github.com/mauriciovigolo/keycloak-angular/LICENSE\n */\n\nimport { Injectable } from '@angular/core';\nimport { HttpHeaders } from '@angular/common/http';\n\nimport { Subject, from } from 'rxjs';\n\n// Workaround for rollup library behaviour, as pointed out on issue #1267 (https://github.com/rollup/rollup/issues/1267).\nimport * as Keycloak_ from 'keycloak-js';\nexport const Keycloak = Keycloak_;\n\nimport { ExcludedUrl, ExcludedUrlRegex, KeycloakOptions } from '../interfaces/keycloak-options';\nimport { KeycloakEvent, KeycloakEventType } from '../interfaces/keycloak-event';\nimport { toPromise } from '../utils/to-promise';\n\n/**\n * Service to expose existent methods from the Keycloak JS adapter, adding new\n * functionalities to improve the use of keycloak in Angular v > 4.3 applications.\n *\n * This class should be injected in the application bootstrap, so the same instance will be used\n * along the web application.\n */\n@Injectable()\nexport class KeycloakService {\n /**\n * Keycloak-js instance.\n */\n private _instance: Keycloak.KeycloakInstance;\n /**\n * User profile as KeycloakProfile interface.\n */\n private _userProfile: Keycloak.KeycloakProfile;\n /**\n * Flag to indicate if the bearer will not be added to the authorization header.\n */\n private _enableBearerInterceptor: boolean;\n /**\n * When the implicit flow is choosen there must exist a silentRefresh, as there is\n * no refresh token.\n */\n private _silentRefresh: boolean;\n /**\n * Indicates that the user profile should be loaded at the keycloak initialization,\n * just after the login.\n */\n private _loadUserProfileAtStartUp: boolean;\n /**\n * The bearer prefix that will be appended to the Authorization Header.\n */\n private _bearerPrefix: string;\n /**\n * Value that will be used as the Authorization Http Header name.\n */\n private _authorizationHeaderName: string;\n /**\n * The excluded urls patterns that must skip the KeycloakBearerInterceptor.\n */\n private _excludedUrls: ExcludedUrlRegex[];\n /**\n * Observer for the keycloak events\n */\n private _keycloakEvents$: Subject<KeycloakEvent> = new Subject<KeycloakEvent>();\n\n /**\n * Binds the keycloak-js events to the keycloakEvents Subject\n * which is a good way to monitor for changes, if needed.\n *\n * The keycloakEvents returns the keycloak-js event type and any\n * argument if the source function provides any.\n */\n private bindsKeycloakEvents(): void {\n this._instance.onAuthError = errorData => {\n this._keycloakEvents$.next({\n args: errorData,\n type: KeycloakEventType.OnAuthError\n });\n };\n\n this._instance.onAuthLogout = () => {\n this._keycloakEvents$.next({ type: KeycloakEventType.OnAuthLogout });\n };\n\n this._instance.onAuthRefreshSuccess = () => {\n this._keycloakEvents$.next({\n type: KeycloakEventType.OnAuthRefreshSuccess\n });\n };\n\n this._instance.onAuthRefreshError = () => {\n this._keycloakEvents$.next({\n type: KeycloakEventType.OnAuthRefreshError\n });\n };\n\n this._instance.onAuthSuccess = () => {\n this._keycloakEvents$.next({ type: KeycloakEventType.OnAuthSuccess });\n };\n\n this._instance.onTokenExpired = () => {\n this._keycloakEvents$.next({\n type: KeycloakEventType.OnTokenExpired\n });\n };\n\n this._instance.onReady = authenticated => {\n this._keycloakEvents$.next({\n args: authenticated,\n type: KeycloakEventType.OnReady\n });\n };\n }\n\n /**\n * Loads all bearerExcludedUrl content in a uniform type: ExcludedUrl,\n * so it becomes easier to handle.\n *\n * @param bearerExcludedUrls array of strings or ExcludedUrl that includes\n * the url and HttpMethod.\n */\n private loadExcludedUrls(bearerExcludedUrls: (string | ExcludedUrl)[]): ExcludedUrlRegex[] {\n const excludedUrls: ExcludedUrlRegex[] = [];\n for (const item of bearerExcludedUrls) {\n let excludedUrl: ExcludedUrlRegex;\n if (typeof item === 'string') {\n excludedUrl = { urlPattern: new RegExp(item, 'i'), httpMethods: [] };\n } else {\n excludedUrl = {\n urlPattern: new RegExp(item.url, 'i'),\n httpMethods: item.httpMethods\n };\n }\n excludedUrls.push(excludedUrl);\n }\n return excludedUrls;\n }\n\n /**\n * Handles the class values initialization.\n *\n * @param options\n */\n private initServiceValues({\n enableBearerInterceptor = true,\n loadUserProfileAtStartUp = true,\n bearerExcludedUrls = [],\n authorizationHeaderName = 'Authorization',\n bearerPrefix = 'bearer',\n initOptions\n }: KeycloakOptions): void {\n this._enableBearerInterceptor = enableBearerInterceptor;\n this._loadUserProfileAtStartUp = loadUserProfileAtStartUp;\n this._authorizationHeaderName = authorizationHeaderName;\n this._bearerPrefix = bearerPrefix.trim().concat(' ');\n this._excludedUrls = this.loadExcludedUrls(bearerExcludedUrls);\n this._silentRefresh = initOptions ? initOptions.flow === 'implicit' : false;\n }\n\n /**\n * Keycloak initialization. It should be called to initialize the adapter.\n * Options is a object with 2 main parameters: config and initOptions. The first one\n * will be used to create the Keycloak instance. The second one are options to initialize the\n * keycloak instance.\n *\n * @param options\n * Config: may be a string representing the keycloak URI or an object with the\n * following content:\n * - url: Keycloak json URL\n * - realm: realm name\n * - clientId: client id\n *\n * initOptions:\n * Options to initialize the Keycloak adapter, matches the options as provided by Keycloak itself.\n *\n * enableBearerInterceptor:\n * Flag to indicate if the bearer will added to the authorization header.\n *\n * loadUserProfileInStartUp:\n * Indicates that the user profile should be loaded at the keycloak initialization,\n * just after the login.\n *\n * bearerExcludedUrls:\n * String Array to exclude the urls that should not have the Authorization Header automatically\n * added.\n *\n * authorizationHeaderName:\n * This value will be used as the Authorization Http Header name.\n *\n * bearerPrefix:\n * This value will be included in the Authorization Http Header param.\n *\n * @returns\n * A Promise with a boolean indicating if the initialization was successful.\n */\n public async init(options: KeycloakOptions = {}) {\n this.initServiceValues(options);\n const { config, initOptions } = options;\n\n this._instance = Keycloak(config);\n this.bindsKeycloakEvents();\n\n const authenticated = await toPromise(this._instance.init(initOptions));\n\n if (authenticated && this._loadUserProfileAtStartUp) {\n await this.loadUserProfile();\n }\n\n return authenticated;\n }\n\n /**\n * Redirects to login form on (options is an optional object with redirectUri and/or\n * prompt fields).\n *\n * @param options\n * Object, where:\n * - redirectUri: Specifies the uri to redirect to after login.\n * - prompt:By default the login screen is displayed if the user is not logged-in to Keycloak.\n * To only authenticate to the application if the user is already logged-in and not display the\n * login page if the user is not logged-in, set this option to none. To always require\n * re-authentication and ignore SSO, set this option to login .\n * - maxAge: Used just if user is already authenticated. Specifies maximum time since the\n * authentication of user happened. If user is already authenticated for longer time than\n * maxAge, the SSO is ignored and he will need to re-authenticate again.\n * - loginHint: Used to pre-fill the username/email field on the login form.\n * - action: If value is 'register' then user is redirected to registration page, otherwise to\n * login page.\n * - locale: Specifies the desired locale for the UI.\n * @returns\n * A void Promise if the login is successful and after the user profile loading.\n */\n public async login(options: Keycloak.KeycloakLoginOptions = {}) {\n await toPromise(this._instance.login(options));\n\n if (this._loadUserProfileAtStartUp) {\n await this.loadUserProfile();\n }\n }\n\n /**\n * Redirects to logout.\n *\n * @param redirectUri\n * Specifies the uri to redirect to after logout.\n * @returns\n * A void Promise if the logout was successful, cleaning also the userProfile.\n */\n public async logout(redirectUri?: string) {\n const options = {\n redirectUri\n };\n\n await toPromise(this._instance.logout(options));\n this._userProfile = undefined;\n }\n\n /**\n * Redirects to registration form. Shortcut for login with option\n * action = 'register'. Options are same as for the login method but 'action' is set to\n * 'register'.\n *\n * @param options\n * login options\n * @returns\n * A void Promise if the register flow was successful.\n */\n public async register(options: Keycloak.KeycloakLoginOptions = { action: 'register' }) {\n await toPromise(this._instance.register(options));\n }\n\n /**\n * Check if the user has access to the specified role. It will look for roles in\n * realm and clientId, but will not check if the user is logged in for better performance.\n *\n * @param role\n * role name\n * @param resource\n * resource name If not specified, `clientId` is used\n * @returns\n * A boolean meaning if the user has the specified Role.\n */\n isUserInRole(role: string, resource?: string): boolean {\n let hasRole: boolean;\n hasRole = this._instance.hasResourceRole(role, resource);\n if (!hasRole) {\n hasRole = this._instance.hasRealmRole(role);\n }\n return hasRole;\n }\n\n /**\n * Return the roles of the logged user. The allRoles parameter, with default value\n * true, will return the clientId and realm roles associated with the logged user. If set to false\n * it will only return the user roles associated with the clientId.\n *\n * @param allRoles\n * Flag to set if all roles should be returned.(Optional: default value is true)\n * @returns\n * Array of Roles associated with the logged user.\n */\n getUserRoles(allRoles: boolean = true): string[] {\n let roles: string[] = [];\n if (this._instance.resourceAccess) {\n for (const key in this._instance.resourceAccess) {\n if (this._instance.resourceAccess.hasOwnProperty(key)) {\n const resourceAccess: any = this._instance.resourceAccess[key];\n const clientRoles = resourceAccess['roles'] || [];\n roles = roles.concat(clientRoles);\n }\n }\n }\n if (allRoles && this._instance.realmAccess) {\n const realmRoles = this._instance.realmAccess['roles'] || [];\n roles.push(...realmRoles);\n }\n return roles;\n }\n\n /**\n * Check if user is logged in.\n *\n * @returns\n * A boolean that indicates if the user is logged in.\n */\n async isLoggedIn(): Promise<boolean> {\n try {\n if (!this._instance.authenticated) {\n return false;\n }\n await this.updateToken(20);\n return true;\n } catch (error) {\n return false;\n }\n }\n\n /**\n * Returns true if the token has less than minValidity seconds left before\n * it expires.\n *\n * @param minValidity\n * Seconds left. (minValidity) is optional. Default value is 0.\n * @returns\n * Boolean indicating if the token is expired.\n */\n isTokenExpired(minValidity: number = 0): boolean {\n return this._instance.isTokenExpired(minValidity);\n }\n\n /**\n * If the token expires within minValidity seconds the token is refreshed. If the\n * session status iframe is enabled, the session status is also checked.\n * Returns a promise telling if the token was refreshed or not. If the session is not active\n * anymore, the promise is rejected.\n *\n * @param minValidity\n * Seconds left. (minValidity is optional, if not specified 5 is used)\n * @returns\n * Promise with a boolean indicating if the token was succesfully updated.\n */\n public async updateToken(minValidity = 5) {\n // TODO: this is a workaround until the silent refresh (issue #43)\n // is not implemented, avoiding the redirect loop.\n if (this._silentRefresh) {\n if (this.isTokenExpired()) {\n throw new Error('Failed to refresh the token, or the session is expired');\n }\n\n return true;\n }\n\n if (!this._instance) {\n throw new Error('Keycloak Angular library is not initialized.');\n }\n\n return toPromise(this._instance.updateToken(minValidity));\n }\n\n /**\n * Loads the user profile.\n * Returns promise to set functions to be invoked if the profile was loaded\n * successfully, or if the profile could not be loaded.\n *\n * @param forceReload\n * If true will force the loadUserProfile even if its already loaded.\n * @returns\n * A promise with the KeycloakProfile data loaded.\n */\n public async loadUserProfile(forceReload = false) {\n if (this._userProfile && !forceReload) {\n return this._userProfile;\n }\n\n if (!this._instance.authenticated) {\n throw new Error('The user profile was not loaded as the user is not logged in.');\n }\n\n return this._userProfile = await toPromise(this._instance.loadUserProfile());\n }\n\n /**\n * Returns the authenticated token, calling updateToken to get a refreshed one if\n * necessary. If the session is expired and the forceLogin flag is set to true,\n * this method calls the login method for a new login, otherwise rejects.\n *\n * @param forceLogin\n * Flag whether a login should be enforced if the session is expired.\n * @returns\n * Promise with the generated token.\n */\n async getToken(forceLogin = true): Promise<string> {\n try {\n await this.updateToken(10);\n return this._instance.token;\n } catch (error) {\n if (forceLogin) {\n this.login();\n } else {\n throw error;\n }\n }\n }\n\n /**\n * Returns the logged username.\n *\n * @returns\n * The logged username.\n */\n public getUsername() {\n if (!this._userProfile) {\n throw new Error('User not logged in or user profile was not loaded.');\n }\n\n return this._userProfile.username;\n }\n\n /**\n * Clear authentication state, including tokens. This can be useful if application\n * has detected the session was expired, for example if updating token fails.\n * Invoking this results in onAuthLogout callback listener being invoked.\n */\n clearToken(): void {\n this._instance.clearToken();\n }\n\n /**\n * Adds a valid token in header. The key & value format is:\n * Authorization Bearer <token>.\n * If the headers param is undefined it will create the Angular headers object.\n *\n * @param headers\n * Updated header with Authorization and Keycloak token.\n * @returns\n * An observable with with the HTTP Authorization header and the current token.\n */\n public addTokenToHeader(headers: HttpHeaders = new HttpHeaders()) {\n return from(async () => {\n const token = await this.getToken();\n return headers.set(this._authorizationHeaderName, this._bearerPrefix + token);\n });\n }\n\n /**\n * Returns the original Keycloak instance, if you need any customization that\n * this Angular service does not support yet. Use with caution.\n *\n * @returns\n * The KeycloakInstance from keycloak-js.\n */\n getKeycloakInstance(): Keycloak.KeycloakInstance {\n return this._instance;\n }\n\n /**\n * Returns the excluded URLs that should not be considered by\n * the http interceptor which automatically adds the authorization header in the Http Request.\n *\n * @returns\n * The excluded urls that must not be intercepted by the KeycloakBearerInterceptor.\n */\n get excludedUrls(): ExcludedUrlRegex[] {\n return this._excludedUrls;\n }\n\n /**\n * Flag to indicate if the bearer will be added to the authorization header.\n *\n * @returns\n * Returns if the bearer interceptor was set to be disabled.\n */\n get enableBearerInterceptor(): boolean {\n return this._enableBearerInterceptor;\n }\n\n /**\n * Keycloak subject to monitor the events triggered by keycloak-js.\n * The following events as available (as described at keycloak docs -\n * https://www.keycloak.org/docs/latest/securing_apps/index.html#callback-events):\n * - OnAuthError\n * - OnAuthLogout\n * - OnAuthRefreshError\n * - OnAuthRefreshSuccess\n * - OnAuthSuccess\n * - OnReady\n * - OnTokenExpire\n * In each occurrence of any of these, this subject will return the event type,\n * described at {@link KeycloakEventType} enum and the function args from the keycloak-js\n * if provided any.\n *\n * @returns\n * A subject with the {@link KeycloakEvent} which describes the event type and attaches the\n * function args.\n */\n get keycloakEvents$(): Subject<KeycloakEvent> {\n return this._keycloakEvents$;\n }\n}\n","/**\n * @license\n * Copyright Mauricio Gemelli Vigolo and contributors.\n *\n * Use of this source code is governed by a MIT-style license that can be\n * found in the LICENSE file at https://github.com/mauriciovigolo/keycloak-angular/LICENSE\n */\n\nimport { Injectable } from '@angular/core';\nimport {\n HttpInterceptor,\n HttpRequest,\n HttpHandler,\n HttpEvent\n} from '@angular/common/http';\n\nimport { Observable, from } from 'rxjs';\nimport { mergeMap } from 'rxjs/operators';\n\nimport { KeycloakService } from '../services/keycloak.service';\nimport { ExcludedUrlRegex } from '../interfaces/keycloak-options';\n\n/**\n * This interceptor includes the bearer by default in all HttpClient requests.\n *\n * If you need to exclude some URLs from adding the bearer, please, take a look\n * at the {@link KeycloakOptions} bearerExcludedUrls property.\n */\n@Injectable()\nexport class KeycloakBearerInterceptor implements HttpInterceptor {\n constructor(private keycloak: KeycloakService) {}\n\n /**\n * Checks if the url is excluded from having the Bearer Authorization\n * header added.\n *\n * @param req http request from @angular http module.\n * @param excludedUrlRegex contains the url pattern and the http methods,\n * excluded from adding the bearer at the Http Request.\n */\n private isUrlExcluded(\n { method, url }: HttpRequest<any>,\n { urlPattern, httpMethods }: ExcludedUrlRegex\n ): boolean {\n const httpTest =\n httpMethods.length === 0 ||\n httpMethods.join().indexOf(method.toUpperCase()) > -1;\n\n const urlTest = urlPattern.test(url);\n\n return httpTest && urlTest;\n }\n\n /**\n * Intercept implementation that checks if the request url matches the excludedUrls.\n * If not, adds the Authorization header to the request if the user is logged in.\n *\n * @param req\n * @param next\n */\n public intercept(\n req: HttpRequest<any>,\n next: HttpHandler\n ): Observable<HttpEvent<any>> {\n const { enableBearerInterceptor, excludedUrls } = this.keycloak;\n if (!enableBearerInterceptor) {\n return next.handle(req);\n }\n\n const shallPass: boolean =\n excludedUrls.findIndex(item => this.isUrlExcluded(req, item)) > -1;\n if (shallPass) {\n return next.handle(req);\n }\n\n return from(this.keycloak.isLoggedIn()).pipe(\n mergeMap((loggedIn: boolean) => loggedIn\n ? this.handleRequestWithTokenHeader(req, next)\n : next.handle(req))\n );\n }\n\n /**\n * Adds the token of the current user to the Authorization header\n *\n * @param req\n * @param next\n */\n private handleRequestWithTokenHeader(\n req: HttpRequest<any>,\n next: HttpHandler\n ): Observable<any> {\n return this.keycloak.addTokenToHeader(req.headers).pipe(\n mergeMap(headersWithBearer => {\n const kcReq = req.clone({ headers: headersWithBearer });\n return next.handle(kcReq);\n })\n );\n }\n}\n","/**\n * @license\n * Copyright Mauricio Gemelli Vigolo and contributors.\n *\n * Use of this source code is governed by a MIT-style license that can be\n * found in the LICENSE file at https://github.com/mauriciovigolo/keycloak-angular/LICENSE\n */\n\nimport { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { HTTP_INTERCEPTORS } from '@angular/common/http';\n\nimport { KeycloakService } from './services/keycloak.service';\nimport { KeycloakBearerInterceptor } from './interceptors/keycloak-bearer.interceptor';\n\n@NgModule({\n imports: [CommonModule],\n providers: [\n KeycloakService,\n {\n provide: HTTP_INTERCEPTORS,\n useClass: KeycloakBearerInterceptor,\n multi: true\n }\n ]\n})\nexport class CoreModule {}\n","/**\n * @license\n * Copyright Mauricio Gemelli Vigolo and contributors.\n *\n * Use of this source code is governed by a MIT-style license that can be\n * found in the LICENSE file at https://github.com/mauriciovigolo/keycloak-angular/LICENSE\n */\n\nimport { NgModule } from '@angular/core';\n\nimport { CoreModule } from './core/core.module';\n\n@NgModule({\n imports: [CoreModule]\n})\nexport class KeycloakAngularModule {}\n"],"names":["KeycloakEventType","Subject","HttpHeaders","from","Injectable","mergeMap","NgModule","CommonModule","HTTP_INTERCEPTORS"],"mappings":";;;;;;IAAA;IACA;IACA;IACA;IACA;AACA;IACA;IACA;IACA;IACA;AACA;IACA;IACA;IACA;IACA;AACA;IACA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE;IACnC,IAAI,aAAa,GAAG,MAAM,CAAC,cAAc;IACzC,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;IACpF,QAAQ,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACnF,IAAI,OAAO,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/B,CAAC,CAAC;AACF;IACO,SAAS,SAAS,CAAC,CAAC,E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,KAAK,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC,CAAC;gBACxD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;aAC3B,CAAC,CACH,CAAC;SACH;;oBApE6B,eAAe;;QADlC,yBAAyB;YADrCD,eAAU,EAAE;6CAEmB,eAAe;WADlC,yBAAyB,CAsErC;QAAD,gCAAC;KAtED;;;QCHA;SAA0B;QAAb,UAAU;YAXtBE,aAAQ,CAAC;gBACR,OAAO,EAAE,CAACC,mBAAY,CAAC;gBACvB,SAAS,EAAE;oBACT,eAAe;oBACf;wBACE,OAAO,EAAEC,sBAAiB;wBAC1B,QAAQ,EAAE,yBAAyB;wBACnC,KAAK,EAAE,IAAI;qBACZ;iBACF;aACF,CAAC;WACW,UAAU,CAAG;QAAD,iBAAC;KAA1B;;;QCXA;SAAqC;QAAxB,qBAAqB;YAHjCF,aAAQ,CAAC;gBACR,OAAO,EAAE,CAAC,UAAU,CAAC;aACtB,CAAC;WACW,qBAAqB,CAAG;QAAD,4BAAC;KAArC;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"keycloak-angular.umd.js","sources":["../../../node_modules/tslib/tslib.es6.js","ng://keycloak-angular/lib/core/interfaces/keycloak-event.ts","ng://keycloak-angular/lib/core/services/keycloak-auth-guard.ts","ng://keycloak-angular/lib/core/utils/to-promise.ts","ng://keycloak-angular/lib/core/services/keycloak.service.ts","ng://keycloak-angular/lib/core/interceptors/keycloak-bearer.interceptor.ts","ng://keycloak-angular/lib/core/core.module.ts","ng://keycloak-angular/lib/keycloak-angular.module.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\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 (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\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 function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = 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\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\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 __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\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 (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = 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, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","/**\n * @license\n * Copyright Mauricio Gemelli Vigolo and contributors.\n *\n * Use of this source code is governed by a MIT-style license that can be\n * found in the LICENSE file at https://github.com/mauriciovigolo/keycloak-angular/LICENSE\n */\n\n/**\n * Keycloak event types, as described at the keycloak-js documentation:\n * https://www.keycloak.org/docs/latest/securing_apps/index.html#callback-events\n */\nexport enum KeycloakEventType {\n /**\n * Called if there was an error during authentication.\n */\n OnAuthError,\n /**\n * Called if the user is logged out\n * (will only be called if the session status iframe is enabled, or in Cordova mode).\n */\n OnAuthLogout,\n /**\n * Called if there was an error while trying to refresh the token.\n */\n OnAuthRefreshError,\n /**\n * Called when the token is refreshed.\n */\n OnAuthRefreshSuccess,\n /**\n * Called when a user is successfully authenticated.\n */\n OnAuthSuccess,\n /**\n * Called when the adapter is initialized.\n */\n OnReady,\n /**\n * Called when the access token is expired. If a refresh token is available the token\n * can be refreshed with updateToken, or in cases where it is not (that is, with implicit flow)\n * you can redirect to login screen to obtain a new access token.\n */\n OnTokenExpired\n}\n\n/**\n * Structure of an event triggered by Keycloak, contains it's type\n * and arguments (if any).\n */\nexport interface KeycloakEvent {\n /**\n * Event type as described at {@link KeycloakEventType}.\n */\n type: KeycloakEventType;\n /**\n * Arguments from the keycloak-js event function.\n */\n args?: any;\n}\n","/**\n * @license\n * Copyright Mauricio Gemelli Vigolo and contributors.\n *\n * Use of this source code is governed by a MIT-style license that can be\n * found in the LICENSE file at https://github.com/mauriciovigolo/keycloak-angular/LICENSE\n */\n\nimport { CanActivate, Router, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree } from '@angular/router';\n\nimport { KeycloakService } from './keycloak.service';\n\n/**\n * A simple guard implementation out of the box. This class should be inherited and\n * implemented by the application. The only method that should be implemented is #isAccessAllowed.\n * The reason for this is that the authorization flow is usually not unique, so in this way you will\n * have more freedom to customize your authorization flow.\n */\nexport abstract class KeycloakAuthGuard implements CanActivate {\n /**\n * Indicates if the user is authenticated or not.\n */\n protected authenticated: boolean;\n /**\n * Roles of the logged user. It contains the clientId and realm user roles.\n */\n protected roles: string[];\n\n constructor(protected router: Router, protected keycloakAngular: KeycloakService) {}\n\n /**\n * CanActivate checks if the user is logged in and get the full list of roles (REALM + CLIENT)\n * of the logged user. This values are set to authenticated and roles params.\n *\n * @param route\n * @param state\n */\n canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean | UrlTree> {\n return new Promise(async (resolve, reject) => {\n try {\n this.authenticated = await this.keycloakAngular.isLoggedIn();\n this.roles = await this.keycloakAngular.getUserRoles(true);\n\n const result = await this.isAccessAllowed(route, state);\n resolve(result);\n } catch (error) {\n reject('An error happened during access validation. Details:' + error);\n }\n });\n }\n\n /**\n * Create your own customized authorization flow in this method. From here you already known\n * if the user is authenticated (this.authenticated) and the user roles (this.roles).\n *\n * Return a UrlTree if the user should be redirected to another route.\n *\n * @param route\n * @param state\n */\n abstract isAccessAllowed(\n route: ActivatedRouteSnapshot,\n state: RouterStateSnapshot\n ): Promise<boolean | UrlTree>;\n}\n","import { KeycloakPromise } from 'keycloak-js';\n\ninterface LegacyKeycloakPromise<T, E> {\n success(callback: (result: T) => void): LegacyKeycloakPromise<T, E>;\n error(callback: (result: E) => void): LegacyKeycloakPromise<T, E>;\n}\n\n/**\n * Converts a 'legacy' Keycloak promise to a standardized one.\n *\n * @param originalPromise The Keycloak promise to convert.\n */\nexport function toPromise<T, E>(originalPromise: LegacyKeycloakPromise<T, E> | KeycloakPromise<T, E>) {\n if (originalPromise instanceof Promise) {\n return originalPromise;\n }\n\n return new Promise<T>((resolve, reject) => {\n originalPromise.success(resolve);\n originalPromise.error(reject);\n });\n}\n","/**\n * @license\n * Copyright Mauricio Gemelli Vigolo and contributors.\n *\n * Use of this source code is governed by a MIT-style license that can be\n * found in the LICENSE file at https://github.com/mauriciovigolo/keycloak-angular/LICENSE\n */\n\nimport { Injectable } from '@angular/core';\nimport { HttpHeaders } from '@angular/common/http';\n\nimport { Subject, from } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\n// Workaround for rollup library behaviour, as pointed out on issue #1267 (https://github.com/rollup/rollup/issues/1267).\nimport * as Keycloak_ from 'keycloak-js';\nexport const Keycloak = Keycloak_;\n\nimport {\n ExcludedUrl,\n ExcludedUrlRegex,\n KeycloakOptions,\n} from '../interfaces/keycloak-options';\nimport { KeycloakEvent, KeycloakEventType } from '../interfaces/keycloak-event';\nimport { toPromise } from '../utils/to-promise';\n\n/**\n * Service to expose existent methods from the Keycloak JS adapter, adding new\n * functionalities to improve the use of keycloak in Angular v > 4.3 applications.\n *\n * This class should be injected in the application bootstrap, so the same instance will be used\n * along the web application.\n */\n@Injectable()\nexport class KeycloakService {\n /**\n * Keycloak-js instance.\n */\n private _instance: Keycloak.KeycloakInstance;\n /**\n * User profile as KeycloakProfile interface.\n */\n private _userProfile: Keycloak.KeycloakProfile;\n /**\n * Flag to indicate if the bearer will not be added to the authorization header.\n */\n private _enableBearerInterceptor: boolean;\n /**\n * When the implicit flow is choosen there must exist a silentRefresh, as there is\n * no refresh token.\n */\n private _silentRefresh: boolean;\n /**\n * Indicates that the user profile should be loaded at the keycloak initialization,\n * just after the login.\n */\n private _loadUserProfileAtStartUp: boolean;\n /**\n * The bearer prefix that will be appended to the Authorization Header.\n */\n private _bearerPrefix: string;\n /**\n * Value that will be used as the Authorization Http Header name.\n */\n private _authorizationHeaderName: string;\n /**\n * The excluded urls patterns that must skip the KeycloakBearerInterceptor.\n */\n private _excludedUrls: ExcludedUrlRegex[];\n /**\n * Observer for the keycloak events\n */\n private _keycloakEvents$: Subject<KeycloakEvent> = new Subject<\n KeycloakEvent\n >();\n\n /**\n * Binds the keycloak-js events to the keycloakEvents Subject\n * which is a good way to monitor for changes, if needed.\n *\n * The keycloakEvents returns the keycloak-js event type and any\n * argument if the source function provides any.\n */\n private bindsKeycloakEvents(): void {\n this._instance.onAuthError = (errorData) => {\n this._keycloakEvents$.next({\n args: errorData,\n type: KeycloakEventType.OnAuthError,\n });\n };\n\n this._instance.onAuthLogout = () => {\n this._keycloakEvents$.next({ type: KeycloakEventType.OnAuthLogout });\n };\n\n this._instance.onAuthRefreshSuccess = () => {\n this._keycloakEvents$.next({\n type: KeycloakEventType.OnAuthRefreshSuccess,\n });\n };\n\n this._instance.onAuthRefreshError = () => {\n this._keycloakEvents$.next({\n type: KeycloakEventType.OnAuthRefreshError,\n });\n };\n\n this._instance.onAuthSuccess = () => {\n this._keycloakEvents$.next({ type: KeycloakEventType.OnAuthSuccess });\n };\n\n this._instance.onTokenExpired = () => {\n this._keycloakEvents$.next({\n type: KeycloakEventType.OnTokenExpired,\n });\n };\n\n this._instance.onReady = (authenticated) => {\n this._keycloakEvents$.next({\n args: authenticated,\n type: KeycloakEventType.OnReady,\n });\n };\n }\n\n /**\n * Loads all bearerExcludedUrl content in a uniform type: ExcludedUrl,\n * so it becomes easier to handle.\n *\n * @param bearerExcludedUrls array of strings or ExcludedUrl that includes\n * the url and HttpMethod.\n */\n private loadExcludedUrls(\n bearerExcludedUrls: (string | ExcludedUrl)[]\n ): ExcludedUrlRegex[] {\n const excludedUrls: ExcludedUrlRegex[] = [];\n for (const item of bearerExcludedUrls) {\n let excludedUrl: ExcludedUrlRegex;\n if (typeof item === 'string') {\n excludedUrl = { urlPattern: new RegExp(item, 'i'), httpMethods: [] };\n } else {\n excludedUrl = {\n urlPattern: new RegExp(item.url, 'i'),\n httpMethods: item.httpMethods,\n };\n }\n excludedUrls.push(excludedUrl);\n }\n return excludedUrls;\n }\n\n /**\n * Handles the class values initialization.\n *\n * @param options\n */\n private initServiceValues({\n enableBearerInterceptor = true,\n loadUserProfileAtStartUp = true,\n bearerExcludedUrls = [],\n authorizationHeaderName = 'Authorization',\n bearerPrefix = 'bearer',\n initOptions,\n }: KeycloakOptions): void {\n this._enableBearerInterceptor = enableBearerInterceptor;\n this._loadUserProfileAtStartUp = loadUserProfileAtStartUp;\n this._authorizationHeaderName = authorizationHeaderName;\n this._bearerPrefix = bearerPrefix.trim().concat(' ');\n this._excludedUrls = this.loadExcludedUrls(bearerExcludedUrls);\n this._silentRefresh = initOptions ? initOptions.flow === 'implicit' : false;\n }\n\n /**\n * Keycloak initialization. It should be called to initialize the adapter.\n * Options is a object with 2 main parameters: config and initOptions. The first one\n * will be used to create the Keycloak instance. The second one are options to initialize the\n * keycloak instance.\n *\n * @param options\n * Config: may be a string representing the keycloak URI or an object with the\n * following content:\n * - url: Keycloak json URL\n * - realm: realm name\n * - clientId: client id\n *\n * initOptions:\n * Options to initialize the Keycloak adapter, matches the options as provided by Keycloak itself.\n *\n * enableBearerInterceptor:\n * Flag to indicate if the bearer will added to the authorization header.\n *\n * loadUserProfileInStartUp:\n * Indicates that the user profile should be loaded at the keycloak initialization,\n * just after the login.\n *\n * bearerExcludedUrls:\n * String Array to exclude the urls that should not have the Authorization Header automatically\n * added.\n *\n * authorizationHeaderName:\n * This value will be used as the Authorization Http Header name.\n *\n * bearerPrefix:\n * This value will be included in the Authorization Http Header param.\n *\n * @returns\n * A Promise with a boolean indicating if the initialization was successful.\n */\n public async init(options: KeycloakOptions = {}) {\n this.initServiceValues(options);\n const { config, initOptions } = options;\n\n this._instance = Keycloak(config);\n this.bindsKeycloakEvents();\n\n const authenticated = await toPromise(this._instance.init(initOptions));\n\n if (authenticated && this._loadUserProfileAtStartUp) {\n await this.loadUserProfile();\n }\n\n return authenticated;\n }\n\n /**\n * Redirects to login form on (options is an optional object with redirectUri and/or\n * prompt fields).\n *\n * @param options\n * Object, where:\n * - redirectUri: Specifies the uri to redirect to after login.\n * - prompt:By default the login screen is displayed if the user is not logged-in to Keycloak.\n * To only authenticate to the application if the user is already logged-in and not display the\n * login page if the user is not logged-in, set this option to none. To always require\n * re-authentication and ignore SSO, set this option to login .\n * - maxAge: Used just if user is already authenticated. Specifies maximum time since the\n * authentication of user happened. If user is already authenticated for longer time than\n * maxAge, the SSO is ignored and he will need to re-authenticate again.\n * - loginHint: Used to pre-fill the username/email field on the login form.\n * - action: If value is 'register' then user is redirected to registration page, otherwise to\n * login page.\n * - locale: Specifies the desired locale for the UI.\n * @returns\n * A void Promise if the login is successful and after the user profile loading.\n */\n public async login(options: Keycloak.KeycloakLoginOptions = {}) {\n await toPromise(this._instance.login(options));\n\n if (this._loadUserProfileAtStartUp) {\n await this.loadUserProfile();\n }\n }\n\n /**\n * Redirects to logout.\n *\n * @param redirectUri\n * Specifies the uri to redirect to after logout.\n * @returns\n * A void Promise if the logout was successful, cleaning also the userProfile.\n */\n public async logout(redirectUri?: string) {\n const options = {\n redirectUri,\n };\n\n await toPromise(this._instance.logout(options));\n this._userProfile = undefined;\n }\n\n /**\n * Redirects to registration form. Shortcut for login with option\n * action = 'register'. Options are same as for the login method but 'action' is set to\n * 'register'.\n *\n * @param options\n * login options\n * @returns\n * A void Promise if the register flow was successful.\n */\n public async register(\n options: Keycloak.KeycloakLoginOptions = { action: 'register' }\n ) {\n await toPromise(this._instance.register(options));\n }\n\n /**\n * Check if the user has access to the specified role. It will look for roles in\n * realm and clientId, but will not check if the user is logged in for better performance.\n *\n * @param role\n * role name\n * @param resource\n * resource name If not specified, `clientId` is used\n * @returns\n * A boolean meaning if the user has the specified Role.\n */\n isUserInRole(role: string, resource?: string): boolean {\n let hasRole: boolean;\n hasRole = this._instance.hasResourceRole(role, resource);\n if (!hasRole) {\n hasRole = this._instance.hasRealmRole(role);\n }\n return hasRole;\n }\n\n /**\n * Return the roles of the logged user. The allRoles parameter, with default value\n * true, will return the clientId and realm roles associated with the logged user. If set to false\n * it will only return the user roles associated with the clientId.\n *\n * @param allRoles\n * Flag to set if all roles should be returned.(Optional: default value is true)\n * @returns\n * Array of Roles associated with the logged user.\n */\n getUserRoles(allRoles: boolean = true): string[] {\n let roles: string[] = [];\n if (this._instance.resourceAccess) {\n for (const key in this._instance.resourceAccess) {\n if (this._instance.resourceAccess.hasOwnProperty(key)) {\n const resourceAccess: any = this._instance.resourceAccess[key];\n const clientRoles = resourceAccess['roles'] || [];\n roles = roles.concat(clientRoles);\n }\n }\n }\n if (allRoles && this._instance.realmAccess) {\n const realmRoles = this._instance.realmAccess['roles'] || [];\n roles.push(...realmRoles);\n }\n return roles;\n }\n\n /**\n * Check if user is logged in.\n *\n * @returns\n * A boolean that indicates if the user is logged in.\n */\n async isLoggedIn(): Promise<boolean> {\n try {\n if (!this._instance.authenticated) {\n return false;\n }\n await this.updateToken(20);\n return true;\n } catch (error) {\n return false;\n }\n }\n\n /**\n * Returns true if the token has less than minValidity seconds left before\n * it expires.\n *\n * @param minValidity\n * Seconds left. (minValidity) is optional. Default value is 0.\n * @returns\n * Boolean indicating if the token is expired.\n */\n isTokenExpired(minValidity: number = 0): boolean {\n return this._instance.isTokenExpired(minValidity);\n }\n\n /**\n * If the token expires within minValidity seconds the token is refreshed. If the\n * session status iframe is enabled, the session status is also checked.\n * Returns a promise telling if the token was refreshed or not. If the session is not active\n * anymore, the promise is rejected.\n *\n * @param minValidity\n * Seconds left. (minValidity is optional, if not specified 5 is used)\n * @returns\n * Promise with a boolean indicating if the token was succesfully updated.\n */\n public async updateToken(minValidity = 5) {\n // TODO: this is a workaround until the silent refresh (issue #43)\n // is not implemented, avoiding the redirect loop.\n if (this._silentRefresh) {\n if (this.isTokenExpired()) {\n throw new Error(\n 'Failed to refresh the token, or the session is expired'\n );\n }\n\n return true;\n }\n\n if (!this._instance) {\n throw new Error('Keycloak Angular library is not initialized.');\n }\n\n return toPromise(this._instance.updateToken(minValidity));\n }\n\n /**\n * Loads the user profile.\n * Returns promise to set functions to be invoked if the profile was loaded\n * successfully, or if the profile could not be loaded.\n *\n * @param forceReload\n * If true will force the loadUserProfile even if its already loaded.\n * @returns\n * A promise with the KeycloakProfile data loaded.\n */\n public async loadUserProfile(forceReload = false) {\n if (this._userProfile && !forceReload) {\n return this._userProfile;\n }\n\n if (!this._instance.authenticated) {\n throw new Error(\n 'The user profile was not loaded as the user is not logged in.'\n );\n }\n\n return (this._userProfile = await toPromise(\n this._instance.loadUserProfile()\n ));\n }\n\n /**\n * Returns the authenticated token, calling updateToken to get a refreshed one if\n * necessary. If the session is expired and the forceLogin flag is set to true,\n * this method calls the login method for a new login, otherwise rejects.\n *\n * @param forceLogin\n * Flag whether a login should be enforced if the session is expired.\n * @returns\n * Promise with the generated token.\n */\n async getToken(forceLogin = true): Promise<string> {\n try {\n await this.updateToken(10);\n return this._instance.token;\n } catch (error) {\n if (forceLogin) {\n this.login();\n } else {\n throw error;\n }\n }\n }\n\n /**\n * Returns the logged username.\n *\n * @returns\n * The logged username.\n */\n public getUsername() {\n if (!this._userProfile) {\n throw new Error('User not logged in or user profile was not loaded.');\n }\n\n return this._userProfile.username;\n }\n\n /**\n * Clear authentication state, including tokens. This can be useful if application\n * has detected the session was expired, for example if updating token fails.\n * Invoking this results in onAuthLogout callback listener being invoked.\n */\n clearToken(): void {\n this._instance.clearToken();\n }\n\n /**\n * Adds a valid token in header. The key & value format is:\n * Authorization Bearer <token>.\n * If the headers param is undefined it will create the Angular headers object.\n *\n * @param headers\n * Updated header with Authorization and Keycloak token.\n * @returns\n * An observable with with the HTTP Authorization header and the current token.\n */\n public addTokenToHeader(headers: HttpHeaders = new HttpHeaders()) {\n return from(this.getToken()).pipe(\n map((token) =>\n headers.set(this._authorizationHeaderName, this._bearerPrefix + token)\n )\n );\n }\n\n /**\n * Returns the original Keycloak instance, if you need any customization that\n * this Angular service does not support yet. Use with caution.\n *\n * @returns\n * The KeycloakInstance from keycloak-js.\n */\n getKeycloakInstance(): Keycloak.KeycloakInstance {\n return this._instance;\n }\n\n /**\n * Returns the excluded URLs that should not be considered by\n * the http interceptor which automatically adds the authorization header in the Http Request.\n *\n * @returns\n * The excluded urls that must not be intercepted by the KeycloakBearerInterceptor.\n */\n get excludedUrls(): ExcludedUrlRegex[] {\n return this._excludedUrls;\n }\n\n /**\n * Flag to indicate if the bearer will be added to the authorization header.\n *\n * @returns\n * Returns if the bearer interceptor was set to be disabled.\n */\n get enableBearerInterceptor(): boolean {\n return this._enableBearerInterceptor;\n }\n\n /**\n * Keycloak subject to monitor the events triggered by keycloak-js.\n * The following events as available (as described at keycloak docs -\n * https://www.keycloak.org/docs/latest/securing_apps/index.html#callback-events):\n * - OnAuthError\n * - OnAuthLogout\n * - OnAuthRefreshError\n * - OnAuthRefreshSuccess\n * - OnAuthSuccess\n * - OnReady\n * - OnTokenExpire\n * In each occurrence of any of these, this subject will return the event type,\n * described at {@link KeycloakEventType} enum and the function args from the keycloak-js\n * if provided any.\n *\n * @returns\n * A subject with the {@link KeycloakEvent} which describes the event type and attaches the\n * function args.\n */\n get keycloakEvents$(): Subject<KeycloakEvent> {\n return this._keycloakEvents$;\n }\n}\n","/**\n * @license\n * Copyright Mauricio Gemelli Vigolo and contributors.\n *\n * Use of this source code is governed by a MIT-style license that can be\n * found in the LICENSE file at https://github.com/mauriciovigolo/keycloak-angular/LICENSE\n */\n\nimport { Injectable } from '@angular/core';\nimport {\n HttpInterceptor,\n HttpRequest,\n HttpHandler,\n HttpEvent\n} from '@angular/common/http';\n\nimport { Observable, from } from 'rxjs';\nimport { mergeMap } from 'rxjs/operators';\n\nimport { KeycloakService } from '../services/keycloak.service';\nimport { ExcludedUrlRegex } from '../interfaces/keycloak-options';\n\n/**\n * This interceptor includes the bearer by default in all HttpClient requests.\n *\n * If you need to exclude some URLs from adding the bearer, please, take a look\n * at the {@link KeycloakOptions} bearerExcludedUrls property.\n */\n@Injectable()\nexport class KeycloakBearerInterceptor implements HttpInterceptor {\n constructor(private keycloak: KeycloakService) {}\n\n /**\n * Checks if the url is excluded from having the Bearer Authorization\n * header added.\n *\n * @param req http request from @angular http module.\n * @param excludedUrlRegex contains the url pattern and the http methods,\n * excluded from adding the bearer at the Http Request.\n */\n private isUrlExcluded(\n { method, url }: HttpRequest<any>,\n { urlPattern, httpMethods }: ExcludedUrlRegex\n ): boolean {\n const httpTest =\n httpMethods.length === 0 ||\n httpMethods.join().indexOf(method.toUpperCase()) > -1;\n\n const urlTest = urlPattern.test(url);\n\n return httpTest && urlTest;\n }\n\n /**\n * Intercept implementation that checks if the request url matches the excludedUrls.\n * If not, adds the Authorization header to the request if the user is logged in.\n *\n * @param req\n * @param next\n */\n public intercept(\n req: HttpRequest<any>,\n next: HttpHandler\n ): Observable<HttpEvent<any>> {\n const { enableBearerInterceptor, excludedUrls } = this.keycloak;\n if (!enableBearerInterceptor) {\n return next.handle(req);\n }\n\n const shallPass: boolean =\n excludedUrls.findIndex(item => this.isUrlExcluded(req, item)) > -1;\n if (shallPass) {\n return next.handle(req);\n }\n\n return from(this.keycloak.isLoggedIn()).pipe(\n mergeMap((loggedIn: boolean) => loggedIn\n ? this.handleRequestWithTokenHeader(req, next)\n : next.handle(req))\n );\n }\n\n /**\n * Adds the token of the current user to the Authorization header\n *\n * @param req\n * @param next\n */\n private handleRequestWithTokenHeader(\n req: HttpRequest<any>,\n next: HttpHandler\n ): Observable<any> {\n return this.keycloak.addTokenToHeader(req.headers).pipe(\n mergeMap(headersWithBearer => {\n const kcReq = req.clone({ headers: headersWithBearer });\n return next.handle(kcReq);\n })\n );\n }\n}\n","/**\n * @license\n * Copyright Mauricio Gemelli Vigolo and contributors.\n *\n * Use of this source code is governed by a MIT-style license that can be\n * found in the LICENSE file at https://github.com/mauriciovigolo/keycloak-angular/LICENSE\n */\n\nimport { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { HTTP_INTERCEPTORS } from '@angular/common/http';\n\nimport { KeycloakService } from './services/keycloak.service';\nimport { KeycloakBearerInterceptor } from './interceptors/keycloak-bearer.interceptor';\n\n@NgModule({\n imports: [CommonModule],\n providers: [\n KeycloakService,\n {\n provide: HTTP_INTERCEPTORS,\n useClass: KeycloakBearerInterceptor,\n multi: true\n }\n ]\n})\nexport class CoreModule {}\n","/**\n * @license\n * Copyright Mauricio Gemelli Vigolo and contributors.\n *\n * Use of this source code is governed by a MIT-style license that can be\n * found in the LICENSE file at https://github.com/mauriciovigolo/keycloak-angular/LICENSE\n */\n\nimport { NgModule } from '@angular/core';\n\nimport { CoreModule } from './core/core.module';\n\n@NgModule({\n imports: [CoreModule]\n})\nexport class KeycloakAngularModule {}\n"],"names":["KeycloakEventType","Subject","HttpHeaders","from","map","Injectable","mergeMap","NgModule","CommonModule","HTTP_INTERCEPTORS"],"mappings":";;;;;;IAAA;IACA;IACA;IACA;IACA;AACA;IACA;IACA;IACA;IACA;AACA;IACA;IACA;IACA;IACA;AACA;IACA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE;IACnC,IAAI,aAAa,GAAG,MAAM,CAAC,cAAc;IACzC,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;IACpF,QAAQ,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAA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H;QAQO,gEAA4B,GAApC,UACE,GAAqB,EACrB,IAAiB;YAEjB,OAAO,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,CACrDA,kBAAQ,CAAC,UAAA,iBAAiB;gBACxB,IAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAAC,CAAC;gBACxD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;aAC3B,CAAC,CACH,CAAC;SACH;;oBApE6B,eAAe;;QADlC,yBAAyB;YADrCD,eAAU,EAAE;6CAEmB,eAAe;WADlC,yBAAyB,CAsErC;QAAD,gCAAC;KAtED;;;QCHA;SAA0B;QAAb,UAAU;YAXtBE,aAAQ,CAAC;gBACR,OAAO,EAAE,CAACC,mBAAY,CAAC;gBACvB,SAAS,EAAE;oBACT,eAAe;oBACf;wBACE,OAAO,EAAEC,sBAAiB;wBAC1B,QAAQ,EAAE,yBAAyB;wBACnC,KAAK,EAAE,IAAI;qBACZ;iBACF;aACF,CAAC;WACW,UAAU,CAAG;QAAD,iBAAC;KAA1B;;;QCXA;SAAqC;QAAxB,qBAAqB;YAHjCF,aAAQ,CAAC;gBACR,OAAO,EAAE,CAAC,UAAU,CAAC;aACtB,CAAC;WACW,qBAAqB,CAAG;QAAD,4BAAC;KAArC;;;;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common/http"),require("rxjs"),require("
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common/http"),require("rxjs"),require("rxjs/operators"),require("keycloak-js"),require("@angular/common")):"function"==typeof define&&define.amd?define("keycloak-angular",["exports","@angular/core","@angular/common/http","rxjs","rxjs/operators","keycloak-js","@angular/common"],t):t((e=e||self)["keycloak-angular"]={},e.ng.core,e.ng.common.http,e.rxjs,e.rxjs.operators,e.Keycloak,e.ng.common)}(this,(function(e,t,n,r,o,i,s){"use strict";
|
|
2
2
|
/*! *****************************************************************************
|
|
3
3
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
@@ -12,5 +12,5 @@
|
|
|
12
12
|
|
|
13
13
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
14
14
|
and limitations under the License.
|
|
15
|
-
***************************************************************************** */var a;function c(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s}function u(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function l(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))}function h(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}function f(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function p(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s}(a=e.KeycloakEventType||(e.KeycloakEventType={}))[a.OnAuthError=0]="OnAuthError",a[a.OnAuthLogout=1]="OnAuthLogout",a[a.OnAuthRefreshError=2]="OnAuthRefreshError",a[a.OnAuthRefreshSuccess=3]="OnAuthRefreshSuccess",a[a.OnAuthSuccess=4]="OnAuthSuccess",a[a.OnReady=5]="OnReady",a[a.OnTokenExpired=6]="OnTokenExpired";var d=function(){function e(e,t){this.router=e,this.keycloakAngular=t}return e.prototype.canActivate=function(e,t){var n=this;return new Promise((function(r,o){return l(n,void 0,void 0,(function(){var n,i,s,a;return h(this,(function(c){switch(c.label){case 0:return c.trys.push([0,4,,5]),n=this,[4,this.keycloakAngular.isLoggedIn()];case 1:return n.authenticated=c.sent(),i=this,[4,this.keycloakAngular.getUserRoles(!0)];case 2:return i.roles=c.sent(),[4,this.isAccessAllowed(e,t)];case 3:return s=c.sent(),r(s),[3,5];case 4:return a=c.sent(),o("An error happened during access validation. Details:"+a),[3,5];case 5:return[2]}}))}))}))},e}();function y(e){return e instanceof Promise?e:new Promise((function(t,n){e.success(t),e.error(n)}))}var v=o,k=function(){function o(){this._keycloakEvents$=new r.Subject}return o.prototype.bindsKeycloakEvents=function(){var t=this;this._instance.onAuthError=function(n){t._keycloakEvents$.next({args:n,type:e.KeycloakEventType.OnAuthError})},this._instance.onAuthLogout=function(){t._keycloakEvents$.next({type:e.KeycloakEventType.OnAuthLogout})},this._instance.onAuthRefreshSuccess=function(){t._keycloakEvents$.next({type:e.KeycloakEventType.OnAuthRefreshSuccess})},this._instance.onAuthRefreshError=function(){t._keycloakEvents$.next({type:e.KeycloakEventType.OnAuthRefreshError})},this._instance.onAuthSuccess=function(){t._keycloakEvents$.next({type:e.KeycloakEventType.OnAuthSuccess})},this._instance.onTokenExpired=function(){t._keycloakEvents$.next({type:e.KeycloakEventType.OnTokenExpired})},this._instance.onReady=function(n){t._keycloakEvents$.next({args:n,type:e.KeycloakEventType.OnReady})}},o.prototype.loadExcludedUrls=function(e){var t,n,r=[];try{for(var o=f(e),i=o.next();!i.done;i=o.next()){var s=i.value,a=void 0;a="string"==typeof s?{urlPattern:new RegExp(s,"i"),httpMethods:[]}:{urlPattern:new RegExp(s.url,"i"),httpMethods:s.httpMethods},r.push(a)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r},o.prototype.initServiceValues=function(e){var t=e.enableBearerInterceptor,n=void 0===t||t,r=e.loadUserProfileAtStartUp,o=void 0===r||r,i=e.bearerExcludedUrls,s=void 0===i?[]:i,a=e.authorizationHeaderName,c=void 0===a?"Authorization":a,u=e.bearerPrefix,l=void 0===u?"bearer":u,h=e.initOptions;this._enableBearerInterceptor=n,this._loadUserProfileAtStartUp=o,this._authorizationHeaderName=c,this._bearerPrefix=l.trim().concat(" "),this._excludedUrls=this.loadExcludedUrls(s),this._silentRefresh=!!h&&"implicit"===h.flow},o.prototype.init=function(e){return void 0===e&&(e={}),l(this,void 0,void 0,(function(){var t,n,r;return h(this,(function(o){switch(o.label){case 0:return this.initServiceValues(e),t=e.config,n=e.initOptions,this._instance=v(t),this.bindsKeycloakEvents(),[4,y(this._instance.init(n))];case 1:return(r=o.sent())&&this._loadUserProfileAtStartUp?[4,this.loadUserProfile()]:[3,3];case 2:o.sent(),o.label=3;case 3:return[2,r]}}))}))},o.prototype.login=function(e){return void 0===e&&(e={}),l(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return[4,y(this._instance.login(e))];case 1:return t.sent(),this._loadUserProfileAtStartUp?[4,this.loadUserProfile()]:[3,3];case 2:t.sent(),t.label=3;case 3:return[2]}}))}))},o.prototype.logout=function(e){return l(this,void 0,void 0,(function(){var t;return h(this,(function(n){switch(n.label){case 0:return t={redirectUri:e},[4,y(this._instance.logout(t))];case 1:return n.sent(),this._userProfile=void 0,[2]}}))}))},o.prototype.register=function(e){return void 0===e&&(e={action:"register"}),l(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return[4,y(this._instance.register(e))];case 1:return t.sent(),[2]}}))}))},o.prototype.isUserInRole=function(e,t){var n;return(n=this._instance.hasResourceRole(e,t))||(n=this._instance.hasRealmRole(e)),n},o.prototype.getUserRoles=function(e){void 0===e&&(e=!0);var t=[];if(this._instance.resourceAccess)for(var n in this._instance.resourceAccess)if(this._instance.resourceAccess.hasOwnProperty(n)){var r=this._instance.resourceAccess[n].roles||[];t=t.concat(r)}if(e&&this._instance.realmAccess){var o=this._instance.realmAccess.roles||[];t.push.apply(t,function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(p(arguments[t]));return e}(o))}return t},o.prototype.isLoggedIn=function(){return l(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),this._instance.authenticated?[4,this.updateToken(20)]:[2,!1];case 1:return e.sent(),[2,!0];case 2:return e.sent(),[2,!1];case 3:return[2]}}))}))},o.prototype.isTokenExpired=function(e){return void 0===e&&(e=0),this._instance.isTokenExpired(e)},o.prototype.updateToken=function(e){return void 0===e&&(e=5),l(this,void 0,void 0,(function(){return h(this,(function(t){if(this._silentRefresh){if(this.isTokenExpired())throw new Error("Failed to refresh the token, or the session is expired");return[2,!0]}if(!this._instance)throw new Error("Keycloak Angular library is not initialized.");return[2,y(this._instance.updateToken(e))]}))}))},o.prototype.loadUserProfile=function(e){return void 0===e&&(e=!1),l(this,void 0,void 0,(function(){var t;return h(this,(function(n){switch(n.label){case 0:if(this._userProfile&&!e)return[2,this._userProfile];if(!this._instance.authenticated)throw new Error("The user profile was not loaded as the user is not logged in.");return t=this,[4,y(this._instance.loadUserProfile())];case 1:return[2,t._userProfile=n.sent()]}}))}))},o.prototype.getToken=function(e){return void 0===e&&(e=!0),l(this,void 0,void 0,(function(){var t;return h(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.updateToken(10)];case 1:return n.sent(),[2,this._instance.token];case 2:if(t=n.sent(),!e)throw t;return this.login(),[3,3];case 3:return[2]}}))}))},o.prototype.getUsername=function(){if(!this._userProfile)throw new Error("User not logged in or user profile was not loaded.");return this._userProfile.username},o.prototype.clearToken=function(){this._instance.clearToken()},o.prototype.addTokenToHeader=function(e){var t=this;return void 0===e&&(e=new n.HttpHeaders),r.from((function(){return l(t,void 0,void 0,(function(){var t;return h(this,(function(n){switch(n.label){case 0:return[4,this.getToken()];case 1:return t=n.sent(),[2,e.set(this._authorizationHeaderName,this._bearerPrefix+t)]}}))}))}))},o.prototype.getKeycloakInstance=function(){return this._instance},Object.defineProperty(o.prototype,"excludedUrls",{get:function(){return this._excludedUrls},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"enableBearerInterceptor",{get:function(){return this._enableBearerInterceptor},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"keycloakEvents$",{get:function(){return this._keycloakEvents$},enumerable:!0,configurable:!0}),o=c([t.Injectable()],o)}(),g=function(){function e(e){this.keycloak=e}return e.prototype.isUrlExcluded=function(e,t){var n=e.method,r=e.url,o=t.urlPattern,i=t.httpMethods,s=0===i.length||i.join().indexOf(n.toUpperCase())>-1,a=o.test(r);return s&&a},e.prototype.intercept=function(e,t){var n=this,o=this.keycloak,s=o.enableBearerInterceptor,a=o.excludedUrls;return s?a.findIndex((function(t){return n.isUrlExcluded(e,t)}))>-1?t.handle(e):r.from(this.keycloak.isLoggedIn()).pipe(i.mergeMap((function(r){return r?n.handleRequestWithTokenHeader(e,t):t.handle(e)}))):t.handle(e)},e.prototype.handleRequestWithTokenHeader=function(e,t){return this.keycloak.addTokenToHeader(e.headers).pipe(i.mergeMap((function(n){var r=e.clone({headers:n});return t.handle(r)})))},e.ctorParameters=function(){return[{type:k}]},e=c([t.Injectable(),u("design:paramtypes",[k])],e)}(),b=function(){function e(){}return e=c([t.NgModule({imports:[s.CommonModule],providers:[k,{provide:n.HTTP_INTERCEPTORS,useClass:g,multi:!0}]})],e)}(),_=function(){function e(){}return e=c([t.NgModule({imports:[b]})],e)}();e.CoreModule=b,e.KeycloakAngularModule=_,e.KeycloakAuthGuard=d,e.KeycloakBearerInterceptor=g,e.KeycloakService=k,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
15
|
+
***************************************************************************** */var a;function c(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s}function u(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function l(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))}function h(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}function f(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function p(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s}(a=e.KeycloakEventType||(e.KeycloakEventType={}))[a.OnAuthError=0]="OnAuthError",a[a.OnAuthLogout=1]="OnAuthLogout",a[a.OnAuthRefreshError=2]="OnAuthRefreshError",a[a.OnAuthRefreshSuccess=3]="OnAuthRefreshSuccess",a[a.OnAuthSuccess=4]="OnAuthSuccess",a[a.OnReady=5]="OnReady",a[a.OnTokenExpired=6]="OnTokenExpired";var d=function(){function e(e,t){this.router=e,this.keycloakAngular=t}return e.prototype.canActivate=function(e,t){var n=this;return new Promise((function(r,o){return l(n,void 0,void 0,(function(){var n,i,s,a;return h(this,(function(c){switch(c.label){case 0:return c.trys.push([0,4,,5]),n=this,[4,this.keycloakAngular.isLoggedIn()];case 1:return n.authenticated=c.sent(),i=this,[4,this.keycloakAngular.getUserRoles(!0)];case 2:return i.roles=c.sent(),[4,this.isAccessAllowed(e,t)];case 3:return s=c.sent(),r(s),[3,5];case 4:return a=c.sent(),o("An error happened during access validation. Details:"+a),[3,5];case 5:return[2]}}))}))}))},e}();function y(e){return e instanceof Promise?e:new Promise((function(t,n){e.success(t),e.error(n)}))}var v=i,k=function(){function i(){this._keycloakEvents$=new r.Subject}return i.prototype.bindsKeycloakEvents=function(){var t=this;this._instance.onAuthError=function(n){t._keycloakEvents$.next({args:n,type:e.KeycloakEventType.OnAuthError})},this._instance.onAuthLogout=function(){t._keycloakEvents$.next({type:e.KeycloakEventType.OnAuthLogout})},this._instance.onAuthRefreshSuccess=function(){t._keycloakEvents$.next({type:e.KeycloakEventType.OnAuthRefreshSuccess})},this._instance.onAuthRefreshError=function(){t._keycloakEvents$.next({type:e.KeycloakEventType.OnAuthRefreshError})},this._instance.onAuthSuccess=function(){t._keycloakEvents$.next({type:e.KeycloakEventType.OnAuthSuccess})},this._instance.onTokenExpired=function(){t._keycloakEvents$.next({type:e.KeycloakEventType.OnTokenExpired})},this._instance.onReady=function(n){t._keycloakEvents$.next({args:n,type:e.KeycloakEventType.OnReady})}},i.prototype.loadExcludedUrls=function(e){var t,n,r=[];try{for(var o=f(e),i=o.next();!i.done;i=o.next()){var s=i.value,a=void 0;a="string"==typeof s?{urlPattern:new RegExp(s,"i"),httpMethods:[]}:{urlPattern:new RegExp(s.url,"i"),httpMethods:s.httpMethods},r.push(a)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r},i.prototype.initServiceValues=function(e){var t=e.enableBearerInterceptor,n=void 0===t||t,r=e.loadUserProfileAtStartUp,o=void 0===r||r,i=e.bearerExcludedUrls,s=void 0===i?[]:i,a=e.authorizationHeaderName,c=void 0===a?"Authorization":a,u=e.bearerPrefix,l=void 0===u?"bearer":u,h=e.initOptions;this._enableBearerInterceptor=n,this._loadUserProfileAtStartUp=o,this._authorizationHeaderName=c,this._bearerPrefix=l.trim().concat(" "),this._excludedUrls=this.loadExcludedUrls(s),this._silentRefresh=!!h&&"implicit"===h.flow},i.prototype.init=function(e){return void 0===e&&(e={}),l(this,void 0,void 0,(function(){var t,n,r;return h(this,(function(o){switch(o.label){case 0:return this.initServiceValues(e),t=e.config,n=e.initOptions,this._instance=v(t),this.bindsKeycloakEvents(),[4,y(this._instance.init(n))];case 1:return(r=o.sent())&&this._loadUserProfileAtStartUp?[4,this.loadUserProfile()]:[3,3];case 2:o.sent(),o.label=3;case 3:return[2,r]}}))}))},i.prototype.login=function(e){return void 0===e&&(e={}),l(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return[4,y(this._instance.login(e))];case 1:return t.sent(),this._loadUserProfileAtStartUp?[4,this.loadUserProfile()]:[3,3];case 2:t.sent(),t.label=3;case 3:return[2]}}))}))},i.prototype.logout=function(e){return l(this,void 0,void 0,(function(){var t;return h(this,(function(n){switch(n.label){case 0:return t={redirectUri:e},[4,y(this._instance.logout(t))];case 1:return n.sent(),this._userProfile=void 0,[2]}}))}))},i.prototype.register=function(e){return void 0===e&&(e={action:"register"}),l(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return[4,y(this._instance.register(e))];case 1:return t.sent(),[2]}}))}))},i.prototype.isUserInRole=function(e,t){var n;return(n=this._instance.hasResourceRole(e,t))||(n=this._instance.hasRealmRole(e)),n},i.prototype.getUserRoles=function(e){void 0===e&&(e=!0);var t=[];if(this._instance.resourceAccess)for(var n in this._instance.resourceAccess)if(this._instance.resourceAccess.hasOwnProperty(n)){var r=this._instance.resourceAccess[n].roles||[];t=t.concat(r)}if(e&&this._instance.realmAccess){var o=this._instance.realmAccess.roles||[];t.push.apply(t,function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(p(arguments[t]));return e}(o))}return t},i.prototype.isLoggedIn=function(){return l(this,void 0,void 0,(function(){return h(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),this._instance.authenticated?[4,this.updateToken(20)]:[2,!1];case 1:return e.sent(),[2,!0];case 2:return e.sent(),[2,!1];case 3:return[2]}}))}))},i.prototype.isTokenExpired=function(e){return void 0===e&&(e=0),this._instance.isTokenExpired(e)},i.prototype.updateToken=function(e){return void 0===e&&(e=5),l(this,void 0,void 0,(function(){return h(this,(function(t){if(this._silentRefresh){if(this.isTokenExpired())throw new Error("Failed to refresh the token, or the session is expired");return[2,!0]}if(!this._instance)throw new Error("Keycloak Angular library is not initialized.");return[2,y(this._instance.updateToken(e))]}))}))},i.prototype.loadUserProfile=function(e){return void 0===e&&(e=!1),l(this,void 0,void 0,(function(){var t;return h(this,(function(n){switch(n.label){case 0:if(this._userProfile&&!e)return[2,this._userProfile];if(!this._instance.authenticated)throw new Error("The user profile was not loaded as the user is not logged in.");return t=this,[4,y(this._instance.loadUserProfile())];case 1:return[2,t._userProfile=n.sent()]}}))}))},i.prototype.getToken=function(e){return void 0===e&&(e=!0),l(this,void 0,void 0,(function(){var t;return h(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.updateToken(10)];case 1:return n.sent(),[2,this._instance.token];case 2:if(t=n.sent(),!e)throw t;return this.login(),[3,3];case 3:return[2]}}))}))},i.prototype.getUsername=function(){if(!this._userProfile)throw new Error("User not logged in or user profile was not loaded.");return this._userProfile.username},i.prototype.clearToken=function(){this._instance.clearToken()},i.prototype.addTokenToHeader=function(e){var t=this;return void 0===e&&(e=new n.HttpHeaders),r.from(this.getToken()).pipe(o.map((function(n){return e.set(t._authorizationHeaderName,t._bearerPrefix+n)})))},i.prototype.getKeycloakInstance=function(){return this._instance},Object.defineProperty(i.prototype,"excludedUrls",{get:function(){return this._excludedUrls},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"enableBearerInterceptor",{get:function(){return this._enableBearerInterceptor},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"keycloakEvents$",{get:function(){return this._keycloakEvents$},enumerable:!0,configurable:!0}),i=c([t.Injectable()],i)}(),g=function(){function e(e){this.keycloak=e}return e.prototype.isUrlExcluded=function(e,t){var n=e.method,r=e.url,o=t.urlPattern,i=t.httpMethods,s=0===i.length||i.join().indexOf(n.toUpperCase())>-1,a=o.test(r);return s&&a},e.prototype.intercept=function(e,t){var n=this,i=this.keycloak,s=i.enableBearerInterceptor,a=i.excludedUrls;return s?a.findIndex((function(t){return n.isUrlExcluded(e,t)}))>-1?t.handle(e):r.from(this.keycloak.isLoggedIn()).pipe(o.mergeMap((function(r){return r?n.handleRequestWithTokenHeader(e,t):t.handle(e)}))):t.handle(e)},e.prototype.handleRequestWithTokenHeader=function(e,t){return this.keycloak.addTokenToHeader(e.headers).pipe(o.mergeMap((function(n){var r=e.clone({headers:n});return t.handle(r)})))},e.ctorParameters=function(){return[{type:k}]},e=c([t.Injectable(),u("design:paramtypes",[k])],e)}(),b=function(){function e(){}return e=c([t.NgModule({imports:[s.CommonModule],providers:[k,{provide:n.HTTP_INTERCEPTORS,useClass:g,multi:!0}]})],e)}(),_=function(){function e(){}return e=c([t.NgModule({imports:[b]})],e)}();e.CoreModule=b,e.KeycloakAngularModule=_,e.KeycloakAuthGuard=d,e.KeycloakBearerInterceptor=g,e.KeycloakService=k,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
16
16
|
//# sourceMappingURL=keycloak-angular.umd.min.js.map
|