oidc-spa 7.3.0 → 8.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/core/AuthResponse.d.ts +5 -0
- package/core/AuthResponse.js +25 -0
- package/core/AuthResponse.js.map +1 -1
- package/core/StateData.d.ts +2 -6
- package/core/StateData.js +0 -13
- package/core/StateData.js.map +1 -1
- package/core/createOidc.d.ts +2 -2
- package/core/createOidc.js +70 -19
- package/core/createOidc.js.map +1 -1
- package/core/diagnostic.js +3 -3
- package/core/earlyInit.d.ts +16 -0
- package/core/earlyInit.js +157 -0
- package/core/earlyInit.js.map +1 -0
- package/core/index.d.ts +0 -1
- package/core/index.js +1 -3
- package/core/index.js.map +1 -1
- package/core/loginOrGoToAuthServer.js +19 -6
- package/core/loginOrGoToAuthServer.js.map +1 -1
- package/entrypoint.d.ts +1 -7
- package/entrypoint.js +3 -46
- package/entrypoint.js.map +1 -1
- package/esm/core/AuthResponse.d.ts +5 -0
- package/esm/core/AuthResponse.js +23 -0
- package/esm/core/AuthResponse.js.map +1 -1
- package/esm/core/StateData.d.ts +2 -6
- package/esm/core/StateData.js +0 -12
- package/esm/core/StateData.js.map +1 -1
- package/esm/core/createOidc.d.ts +2 -2
- package/esm/core/createOidc.js +72 -21
- package/esm/core/createOidc.js.map +1 -1
- package/esm/core/diagnostic.js +3 -3
- package/esm/core/earlyInit.d.ts +16 -0
- package/esm/core/earlyInit.js +152 -0
- package/esm/core/earlyInit.js.map +1 -0
- package/esm/core/index.d.ts +0 -1
- package/esm/core/index.js +0 -1
- package/esm/core/index.js.map +1 -1
- package/esm/core/loginOrGoToAuthServer.js +19 -6
- package/esm/core/loginOrGoToAuthServer.js.map +1 -1
- package/esm/entrypoint.d.ts +1 -7
- package/esm/entrypoint.js +1 -45
- package/esm/entrypoint.js.map +1 -1
- package/esm/keycloak/keycloak-js/Keycloak.d.ts +4 -0
- package/esm/keycloak/keycloak-js/Keycloak.js +148 -173
- package/esm/keycloak/keycloak-js/Keycloak.js.map +1 -1
- package/esm/mock/oidc.js +15 -4
- package/esm/mock/oidc.js.map +1 -1
- package/esm/mock/react.d.ts +1 -1
- package/esm/mock/react.js +1 -1
- package/esm/react/react.d.ts +1 -1
- package/esm/react/react.js +2 -10
- package/esm/react/react.js.map +1 -1
- package/keycloak/keycloak-js/Keycloak.d.ts +4 -0
- package/keycloak/keycloak-js/Keycloak.js +148 -173
- package/keycloak/keycloak-js/Keycloak.js.map +1 -1
- package/mock/oidc.js +15 -4
- package/mock/oidc.js.map +1 -1
- package/mock/react.d.ts +1 -1
- package/mock/react.js +1 -1
- package/package.json +1 -1
- package/react/react.d.ts +1 -1
- package/react/react.js +1 -9
- package/react/react.js.map +1 -1
- package/src/core/AuthResponse.ts +36 -0
- package/src/core/StateData.ts +2 -22
- package/src/core/createOidc.ts +108 -24
- package/src/core/diagnostic.ts +3 -3
- package/src/core/earlyInit.ts +213 -0
- package/src/core/index.ts +0 -1
- package/src/core/loginOrGoToAuthServer.ts +24 -6
- package/src/entrypoint.ts +1 -69
- package/src/keycloak/keycloak-js/Keycloak.ts +167 -228
- package/src/mock/oidc.ts +15 -4
- package/src/mock/react.tsx +1 -1
- package/src/react/react.tsx +2 -18
- package/core/handleOidcCallback.d.ts +0 -13
- package/core/handleOidcCallback.js +0 -228
- package/core/handleOidcCallback.js.map +0 -1
- package/core/initialLocationHref.d.ts +0 -1
- package/core/initialLocationHref.js +0 -8
- package/core/initialLocationHref.js.map +0 -1
- package/esm/core/handleOidcCallback.d.ts +0 -13
- package/esm/core/handleOidcCallback.js +0 -223
- package/esm/core/handleOidcCallback.js.map +0 -1
- package/esm/core/initialLocationHref.d.ts +0 -1
- package/esm/core/initialLocationHref.js +0 -5
- package/esm/core/initialLocationHref.js.map +0 -1
- package/src/core/handleOidcCallback.ts +0 -318
- package/src/core/initialLocationHref.ts +0 -5
package/esm/entrypoint.d.ts
CHANGED
package/esm/entrypoint.js
CHANGED
|
@@ -1,46 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { preventSessionStorageSetItemOfPublicKeyByThirdParty } from "./core/iframeMessageProtection";
|
|
3
|
-
export function oidcEarlyInit(params) {
|
|
4
|
-
const { freezeFetch, freezeXMLHttpRequest, freezeWebSocket = false } = params ?? {};
|
|
5
|
-
const { isHandled } = handleOidcCallback();
|
|
6
|
-
const shouldLoadApp = !isHandled;
|
|
7
|
-
if (shouldLoadApp) {
|
|
8
|
-
moveRedirectAuthResponseFromSessionStorageToMemory();
|
|
9
|
-
if (freezeXMLHttpRequest) {
|
|
10
|
-
const XMLHttpRequest_trusted = globalThis.XMLHttpRequest;
|
|
11
|
-
Object.freeze(XMLHttpRequest_trusted.prototype);
|
|
12
|
-
Object.freeze(XMLHttpRequest_trusted);
|
|
13
|
-
Object.defineProperty(globalThis, "XMLHttpRequest", {
|
|
14
|
-
configurable: false,
|
|
15
|
-
writable: false,
|
|
16
|
-
enumerable: true,
|
|
17
|
-
value: XMLHttpRequest_trusted
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
if (freezeFetch) {
|
|
21
|
-
const fetch_trusted = globalThis.fetch;
|
|
22
|
-
Object.freeze(fetch_trusted.prototype);
|
|
23
|
-
Object.freeze(fetch_trusted);
|
|
24
|
-
Object.defineProperty(globalThis, "fetch", {
|
|
25
|
-
configurable: false,
|
|
26
|
-
writable: false,
|
|
27
|
-
enumerable: true,
|
|
28
|
-
value: fetch_trusted
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
if (freezeWebSocket) {
|
|
32
|
-
const WebSocket_trusted = globalThis.WebSocket;
|
|
33
|
-
Object.freeze(WebSocket_trusted.prototype);
|
|
34
|
-
Object.freeze(WebSocket_trusted);
|
|
35
|
-
Object.defineProperty(globalThis, "WebSocket", {
|
|
36
|
-
configurable: false,
|
|
37
|
-
writable: false,
|
|
38
|
-
enumerable: true,
|
|
39
|
-
value: WebSocket_trusted
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
preventSessionStorageSetItemOfPublicKeyByThirdParty();
|
|
43
|
-
}
|
|
44
|
-
return { shouldLoadApp };
|
|
45
|
-
}
|
|
1
|
+
export { oidcEarlyInit } from "./core/earlyInit";
|
|
46
2
|
//# sourceMappingURL=entrypoint.js.map
|
package/esm/entrypoint.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entrypoint.js","sourceRoot":"","sources":["../src/entrypoint.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"entrypoint.js","sourceRoot":"","sources":["../src/entrypoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { KeycloakServerConfig, KeycloakInitOptions, KeycloakError, KeycloakLogoutOptions, KeycloakRoles, KeycloakTokenParsed, KeycloakResourceAccess, KeycloakProfile, KeycloakUserInfo, KeycloakLoginOptions, KeycloakRegisterOptions, KeycloakAccountOptions } from "./types";
|
|
2
|
+
import { type Oidc } from "../../core";
|
|
2
3
|
type ConstructorParams = KeycloakServerConfig & {
|
|
3
4
|
homeUrl: string;
|
|
4
5
|
};
|
|
@@ -10,6 +11,7 @@ type ConstructorParams = KeycloakServerConfig & {
|
|
|
10
11
|
* it is a full alternative implementation aligned with the `keycloak-js` API.
|
|
11
12
|
*/
|
|
12
13
|
export declare class Keycloak {
|
|
14
|
+
#private;
|
|
13
15
|
/**
|
|
14
16
|
* Creates a new Keycloak client instance.
|
|
15
17
|
* @param config A configuration object or path to a JSON config file.
|
|
@@ -278,5 +280,7 @@ export declare class Keycloak {
|
|
|
278
280
|
* @private Undocumented.
|
|
279
281
|
*/
|
|
280
282
|
loadUserInfo(): Promise<KeycloakUserInfo>;
|
|
283
|
+
/** Get the underlying oidc-spa instance */
|
|
284
|
+
get oidc(): Oidc<Record<string, unknown>>;
|
|
281
285
|
}
|
|
282
286
|
export {};
|