oidc-spa 7.1.9 → 7.2.0-rc.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/backend.js +235 -352
- package/backend.js.map +1 -1
- package/core/AuthResponse.js +12 -49
- package/core/AuthResponse.js.map +1 -1
- package/core/Oidc.d.ts +1 -2
- package/core/OidcInitializationError.d.ts +2 -2
- package/core/OidcInitializationError.js +230 -297
- package/core/OidcInitializationError.js.map +1 -1
- package/core/OidcMetadata.js +1 -1
- package/core/OidcMetadata.js.map +1 -1
- package/core/StateData.d.ts +5 -5
- package/core/StateData.js +25 -25
- package/core/StateData.js.map +1 -1
- package/core/configId.js +1 -1
- package/core/configId.js.map +1 -1
- package/core/createOidc.d.ts +8 -0
- package/core/createOidc.js +999 -1294
- package/core/createOidc.js.map +1 -1
- package/core/evtIsUserActive.js +26 -27
- package/core/evtIsUserActive.js.map +1 -1
- package/core/handleOidcCallback.js +99 -154
- package/core/handleOidcCallback.js.map +1 -1
- package/core/iframeMessageProtection.d.ts +1 -1
- package/core/iframeMessageProtection.js +43 -108
- package/core/iframeMessageProtection.js.map +1 -1
- package/core/index.d.ts +1 -1
- package/core/index.js +3 -3
- package/core/index.js.map +1 -1
- package/core/initialLocationHref.js +1 -1
- package/core/initialLocationHref.js.map +1 -1
- package/core/isNewBrowserSession.js +8 -8
- package/core/isNewBrowserSession.js.map +1 -1
- package/core/loginOrGoToAuthServer.d.ts +1 -1
- package/core/loginOrGoToAuthServer.js +188 -310
- package/core/loginOrGoToAuthServer.js.map +1 -1
- package/core/loginPropagationToOtherTabs.js +15 -16
- package/core/loginPropagationToOtherTabs.js.map +1 -1
- package/core/loginSilent.d.ts +2 -3
- package/core/loginSilent.js +118 -214
- package/core/loginSilent.js.map +1 -1
- package/core/logoutPropagationToOtherTabs.js +15 -16
- package/core/logoutPropagationToOtherTabs.js.map +1 -1
- package/core/oidcClientTsUserToTokens.d.ts +1 -1
- package/core/oidcClientTsUserToTokens.js +75 -72
- package/core/oidcClientTsUserToTokens.js.map +1 -1
- package/core/ongoingLoginOrRefreshProcesses.js +23 -89
- package/core/ongoingLoginOrRefreshProcesses.js.map +1 -1
- package/core/persistedAuthState.js +13 -13
- package/core/persistedAuthState.js.map +1 -1
- package/entrypoint.js +9 -9
- package/entrypoint.js.map +1 -1
- package/index.d.ts +1 -1
- package/index.js +1 -2
- package/index.js.map +1 -1
- package/keycloak/index.d.ts +3 -0
- package/keycloak/index.js +8 -0
- package/keycloak/index.js.map +1 -0
- package/keycloak/isKeycloak.d.ts +3 -0
- package/keycloak/isKeycloak.js +20 -0
- package/keycloak/isKeycloak.js.map +1 -0
- package/keycloak/keycloak-js/Keycloak.d.ts +284 -0
- package/keycloak/keycloak-js/Keycloak.js +778 -0
- package/keycloak/keycloak-js/Keycloak.js.map +1 -0
- package/keycloak/keycloak-js/index.d.ts +2 -0
- package/keycloak/keycloak-js/index.js +6 -0
- package/keycloak/keycloak-js/index.js.map +1 -0
- package/keycloak/keycloak-js/types.d.ts +361 -0
- package/keycloak/keycloak-js/types.js +3 -0
- package/keycloak/keycloak-js/types.js.map +1 -0
- package/keycloak/keycloakIssuerUriParsed.d.ts +9 -0
- package/keycloak/keycloakIssuerUriParsed.js +19 -0
- package/keycloak/keycloakIssuerUriParsed.js.map +1 -0
- package/keycloak/keycloakUtils.d.ts +37 -0
- package/keycloak/keycloakUtils.js +47 -0
- package/keycloak/keycloakUtils.js.map +1 -0
- package/keycloak-js.d.ts +1 -0
- package/keycloak-js.js +18 -0
- package/keycloak-js.js.map +1 -0
- package/mock/oidc.js +147 -194
- package/mock/oidc.js.map +1 -1
- package/mock/react.js +2 -2
- package/mock/react.js.map +1 -1
- package/package.json +38 -9
- package/react/react.js +133 -244
- package/react/react.js.map +1 -1
- package/src/core/AuthResponse.ts +2 -0
- package/src/core/Oidc.ts +1 -2
- package/src/core/OidcInitializationError.ts +30 -30
- package/src/core/OidcMetadata.ts +1 -1
- package/src/core/StateData.ts +24 -24
- package/src/core/createOidc.ts +24 -31
- package/src/core/handleOidcCallback.ts +44 -23
- package/src/core/iframeMessageProtection.ts +11 -10
- package/src/core/index.ts +1 -1
- package/src/core/loginOrGoToAuthServer.ts +1 -1
- package/src/core/loginSilent.ts +14 -11
- package/src/core/oidcClientTsUserToTokens.ts +1 -1
- package/src/index.ts +1 -7
- package/src/keycloak/index.ts +8 -0
- package/src/keycloak/isKeycloak.ts +23 -0
- package/src/keycloak/keycloak-js/Keycloak.ts +1097 -0
- package/src/keycloak/keycloak-js/index.ts +2 -0
- package/src/keycloak/keycloak-js/types.ts +442 -0
- package/src/keycloak/keycloakIssuerUriParsed.ts +29 -0
- package/src/keycloak/keycloakUtils.ts +90 -0
- package/src/keycloak-js.ts +1 -0
- package/src/react/react.tsx +17 -1
- package/src/tools/decodeJwt.ts +95 -2
- package/src/tools/parseKeycloakIssuerUri.ts +11 -30
- package/src/vendor/frontend/oidc-client-ts.ts +1 -0
- package/src/vendor/frontend/tsafe.ts +1 -0
- package/tools/Deferred.js +13 -35
- package/tools/Deferred.js.map +1 -1
- package/tools/EphemeralSessionStorage.js +46 -48
- package/tools/EphemeralSessionStorage.js.map +1 -1
- package/tools/Evt.js +14 -14
- package/tools/Evt.js.map +1 -1
- package/tools/StatefulEvt.js +5 -5
- package/tools/StatefulEvt.js.map +1 -1
- package/tools/asymmetricEncryption.js +81 -172
- package/tools/asymmetricEncryption.js.map +1 -1
- package/tools/base64.js +2 -2
- package/tools/base64.js.map +1 -1
- package/tools/createObjectThatThrowsIfAccessed.js +13 -61
- package/tools/createObjectThatThrowsIfAccessed.js.map +1 -1
- package/tools/decodeJwt.d.ts +25 -2
- package/tools/decodeJwt.js +61 -3
- package/tools/decodeJwt.js.map +1 -1
- package/tools/generateUrlSafeRandom.js +5 -30
- package/tools/generateUrlSafeRandom.js.map +1 -1
- package/tools/getDownlinkAndRtt.js +8 -30
- package/tools/getDownlinkAndRtt.js.map +1 -1
- package/tools/getIsOnline.js +3 -3
- package/tools/getIsOnline.js.map +1 -1
- package/tools/getIsValidRemoteJson.js +12 -59
- package/tools/getIsValidRemoteJson.js.map +1 -1
- package/tools/getPrUserInteraction.js +4 -4
- package/tools/getPrUserInteraction.js.map +1 -1
- package/tools/getUserEnvironmentInfo.js +17 -12
- package/tools/getUserEnvironmentInfo.js.map +1 -1
- package/tools/haveSharedParentDomain.js +5 -5
- package/tools/haveSharedParentDomain.js.map +1 -1
- package/tools/isDev.js +2 -2
- package/tools/isDev.js.map +1 -1
- package/tools/parseKeycloakIssuerUri.d.ts +2 -0
- package/tools/parseKeycloakIssuerUri.js +11 -42
- package/tools/parseKeycloakIssuerUri.js.map +1 -1
- package/tools/readExpirationTimeInJwt.js +4 -4
- package/tools/readExpirationTimeInJwt.js.map +1 -1
- package/tools/startCountdown.js +17 -65
- package/tools/startCountdown.js.map +1 -1
- package/tools/subscribeToUserInteraction.js +17 -66
- package/tools/subscribeToUserInteraction.js.map +1 -1
- package/tools/toFullyQualifiedUrl.js +7 -7
- package/tools/toFullyQualifiedUrl.js.map +1 -1
- package/tools/toHumanReadableDuration.js +13 -13
- package/tools/toHumanReadableDuration.js.map +1 -1
- package/tools/urlSearchParams.js +28 -50
- package/tools/urlSearchParams.js.map +1 -1
- package/tools/workerTimers.js +10 -10
- package/tools/workerTimers.js.map +1 -1
- package/vendor/frontend/oidc-client-ts.d.ts +1 -0
- package/vendor/frontend/oidc-client-ts.js +3686 -0
- package/vendor/frontend/tsafe.d.ts +1 -0
- package/vendor/frontend/tsafe.js +1 -1
- package/core/trustedFetch.d.ts +0 -2
- package/core/trustedFetch.js +0 -12
- package/core/trustedFetch.js.map +0 -1
- package/src/core/trustedFetch.ts +0 -9
- package/src/vendor/frontend/oidc-client-ts-and-jwt-decode.ts +0 -4
- package/vendor/frontend/oidc-client-ts-and-jwt-decode.d.ts +0 -3
- package/vendor/frontend/oidc-client-ts-and-jwt-decode.js +0 -3
package/core/AuthResponse.js
CHANGED
|
@@ -1,58 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __values = (this && this.__values) || function(o) {
|
|
3
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
4
|
-
if (m) return m.call(o);
|
|
5
|
-
if (o && typeof o.length === "number") return {
|
|
6
|
-
next: function () {
|
|
7
|
-
if (o && i >= o.length) o = void 0;
|
|
8
|
-
return { value: o && o[i++], done: !o };
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
12
|
-
};
|
|
13
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
14
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
15
|
-
if (!m) return o;
|
|
16
|
-
var i = m.call(o), r, ar = [], e;
|
|
17
|
-
try {
|
|
18
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
19
|
-
}
|
|
20
|
-
catch (error) { e = { error: error }; }
|
|
21
|
-
finally {
|
|
22
|
-
try {
|
|
23
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
24
|
-
}
|
|
25
|
-
finally { if (e) throw e.error; }
|
|
26
|
-
}
|
|
27
|
-
return ar;
|
|
28
|
-
};
|
|
29
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
3
|
exports.authResponseToUrl = authResponseToUrl;
|
|
31
|
-
|
|
4
|
+
const urlSearchParams_1 = require("../tools/urlSearchParams");
|
|
32
5
|
function authResponseToUrl(authResponse) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
var _d = __read(_c.value, 2), name_1 = _d[0], value = _d[1];
|
|
38
|
-
if (value === undefined) {
|
|
39
|
-
continue;
|
|
40
|
-
}
|
|
41
|
-
authResponseUrl = (0, urlSearchParams_1.addOrUpdateSearchParam)({
|
|
42
|
-
url: authResponseUrl,
|
|
43
|
-
name: name_1,
|
|
44
|
-
value: value,
|
|
45
|
-
encodeMethod: "www-form"
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
50
|
-
finally {
|
|
51
|
-
try {
|
|
52
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
6
|
+
let authResponseUrl = "https://dummy.com";
|
|
7
|
+
for (const [name, value] of Object.entries(authResponse)) {
|
|
8
|
+
if (value === undefined) {
|
|
9
|
+
continue;
|
|
53
10
|
}
|
|
54
|
-
|
|
11
|
+
authResponseUrl = (0, urlSearchParams_1.addOrUpdateSearchParam)({
|
|
12
|
+
url: authResponseUrl,
|
|
13
|
+
name,
|
|
14
|
+
value,
|
|
15
|
+
encodeMethod: "www-form"
|
|
16
|
+
});
|
|
55
17
|
}
|
|
18
|
+
authResponseUrl = `${authResponseUrl}#${authResponseUrl.split("?")[1]}`;
|
|
56
19
|
return authResponseUrl;
|
|
57
20
|
}
|
|
58
21
|
//# sourceMappingURL=AuthResponse.js.map
|
package/core/AuthResponse.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthResponse.js","sourceRoot":"","sources":["../src/core/AuthResponse.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AuthResponse.js","sourceRoot":"","sources":["../src/core/AuthResponse.ts"],"names":[],"mappings":";;AAOA,8CAkBC;AAzBD,8DAAkE;AAOlE,SAAgB,iBAAiB,CAAC,YAA0B;IACxD,IAAI,eAAe,GAAG,mBAAmB,CAAC;IAE1C,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC;QACvD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACtB,SAAS;QACb,CAAC;QACD,eAAe,GAAG,IAAA,wCAAsB,EAAC;YACrC,GAAG,EAAE,eAAe;YACpB,IAAI;YACJ,KAAK;YACL,YAAY,EAAE,UAAU;SAC3B,CAAC,CAAC;IACP,CAAC;IAED,eAAe,GAAG,GAAG,eAAe,IAAI,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAExE,OAAO,eAAe,CAAC;AAC3B,CAAC"}
|
package/core/Oidc.d.ts
CHANGED
|
@@ -47,7 +47,7 @@ export declare namespace Oidc {
|
|
|
47
47
|
url: string;
|
|
48
48
|
}) => Promise<never>;
|
|
49
49
|
goToAuthServer: (params: {
|
|
50
|
-
extraQueryParams?: Record<string, string>;
|
|
50
|
+
extraQueryParams?: Record<string, string | undefined>;
|
|
51
51
|
redirectUrl?: string;
|
|
52
52
|
transformUrlBeforeRedirect?: (url: string) => string;
|
|
53
53
|
}) => Promise<never>;
|
|
@@ -57,7 +57,6 @@ export declare namespace Oidc {
|
|
|
57
57
|
unsubscribeFromAutoLogoutCountdown: () => void;
|
|
58
58
|
};
|
|
59
59
|
/**
|
|
60
|
-
* Defined when authMethod is "back from auth server".
|
|
61
60
|
* If you called `goToAuthServer` or `login` with extraQueryParams, this object let you know the outcome of the
|
|
62
61
|
* of the action that was intended.
|
|
63
62
|
*
|
|
@@ -9,7 +9,7 @@ export declare function createWellKnownOidcConfigurationEndpointUnreachableIniti
|
|
|
9
9
|
issuerUri: string;
|
|
10
10
|
}): Promise<OidcInitializationError>;
|
|
11
11
|
export declare function createIframeTimeoutInitializationError(params: {
|
|
12
|
-
|
|
12
|
+
redirectUri: string;
|
|
13
13
|
issuerUri: string;
|
|
14
14
|
clientId: string;
|
|
15
15
|
noIframe: boolean;
|
|
@@ -17,4 +17,4 @@ export declare function createIframeTimeoutInitializationError(params: {
|
|
|
17
17
|
export declare function createFailedToFetchTokenEndpointInitializationError(params: {
|
|
18
18
|
issuerUri: string;
|
|
19
19
|
clientId: string;
|
|
20
|
-
}): OidcInitializationError
|
|
20
|
+
}): Promise<OidcInitializationError>;
|