keycloak-angular 11.0.0 → 12.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -60,7 +60,7 @@ Note that `keycloak-js` is a peer dependency of Keycloak Angular. This change al
|
|
|
60
60
|
|
|
61
61
|
Only the latest version of Angular in the table above is actively supported. This is due to the fact that compilation of Angular libraries is [incompatible between major versions](https://angular.io/guide/creating-libraries#ensuring-library-version-compatibility).
|
|
62
62
|
|
|
63
|
-
_Note_:
|
|
63
|
+
_Note_: Only for keycloak-angular **v.9**, there is the need to add `allowSyntheticDefaultImports: true` in the tsconfig.json file in your project. This is related to this [issue in the keycloak project](https://github.com/keycloak/keycloak/issues/9045). From keycloak-angular v.10 on, there is no need to set this configuration.
|
|
64
64
|
|
|
65
65
|
#### Choosing the right keycloak-js version
|
|
66
66
|
|
|
@@ -85,7 +85,7 @@ function initializeKeycloak(keycloak: KeycloakService) {
|
|
|
85
85
|
return () =>
|
|
86
86
|
keycloak.init({
|
|
87
87
|
config: {
|
|
88
|
-
url: 'http://localhost:8080
|
|
88
|
+
url: 'http://localhost:8080',
|
|
89
89
|
realm: 'your-realm',
|
|
90
90
|
clientId: 'your-client-id'
|
|
91
91
|
},
|
|
@@ -175,7 +175,7 @@ export class AuthGuard extends KeycloakAuthGuard {
|
|
|
175
175
|
// Get the roles required from the route.
|
|
176
176
|
const requiredRoles = route.data.roles;
|
|
177
177
|
|
|
178
|
-
// Allow the user to
|
|
178
|
+
// Allow the user to proceed if no additional roles are required to access the route.
|
|
179
179
|
if (!(requiredRoles instanceof Array) || requiredRoles.length === 0) {
|
|
180
180
|
return true;
|
|
181
181
|
}
|
|
@@ -223,7 +223,7 @@ In the example below, any http requests with the header `token-update: false` wi
|
|
|
223
223
|
```ts
|
|
224
224
|
await keycloak.init({
|
|
225
225
|
config: {
|
|
226
|
-
url: 'http://localhost:8080
|
|
226
|
+
url: 'http://localhost:8080',
|
|
227
227
|
realm: 'your-realm',
|
|
228
228
|
clientId: 'your-client-id'
|
|
229
229
|
},
|
|
@@ -260,8 +260,8 @@ keycloakService.keycloakEvents$.subscribe({
|
|
|
260
260
|
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
|
261
261
|
|
|
262
262
|
<!-- prettier-ignore -->
|
|
263
|
-
|[<img src="https://avatars3.githubusercontent.com/u/676270?v=4" width="89px;"/><br /><sub><b>Mauricio
|
|
264
|
-
| :---: | :---: |
|
|
263
|
+
|[<img src="https://avatars3.githubusercontent.com/u/676270?v=4" width="89px;"/><br /><sub><b>Mauricio Vigolo</b></sub>](https://github.com/mauriciovigolo)<br />|[<img src="https://avatars1.githubusercontent.com/u/695720?s=400&v=4" width="89px;"/><br /><sub><b>Jon Koops</b></sub>](https://github.com/https://github.com/jonkoops)<br />|
|
|
264
|
+
| :---: | :---: |
|
|
265
265
|
|
|
266
266
|
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
|
267
267
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { HttpHeaders, HttpRequest } from '@angular/common/http';
|
|
2
2
|
import { Subject } from 'rxjs';
|
|
3
|
-
import Keycloak from 'keycloak-js';
|
|
4
3
|
import { ExcludedUrlRegex, KeycloakOptions } from '../interfaces/keycloak-options';
|
|
5
4
|
import { KeycloakEvent } from '../interfaces/keycloak-event';
|
|
6
5
|
import * as i0 from "@angular/core";
|
|
@@ -29,7 +28,7 @@ export declare class KeycloakService {
|
|
|
29
28
|
isLoggedIn(): Promise<boolean>;
|
|
30
29
|
isTokenExpired(minValidity?: number): boolean;
|
|
31
30
|
updateToken(minValidity?: number): Promise<boolean>;
|
|
32
|
-
loadUserProfile(forceReload?: boolean): Promise<
|
|
31
|
+
loadUserProfile(forceReload?: boolean): Promise<import("keycloak-js").KeycloakProfile>;
|
|
33
32
|
getToken(): Promise<string>;
|
|
34
33
|
getUsername(): string;
|
|
35
34
|
clearToken(): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "keycloak-angular",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "12.0.0",
|
|
4
4
|
"description": "Easy Keycloak setup for Angular applications",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@angular/common": "^14",
|
|
30
30
|
"@angular/core": "^14",
|
|
31
31
|
"@angular/router": "^14",
|
|
32
|
-
"keycloak-js": "^
|
|
32
|
+
"keycloak-js": "^18"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"tslib": "^2.3.0"
|