oidc-spa 7.1.10 → 7.2.0-rc.2
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/Oidc.js.map +1 -1
- package/core/OidcInitializationError.d.ts +0 -13
- package/core/OidcInitializationError.js +8 -318
- 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 +1030 -1292
- package/core/createOidc.js.map +1 -1
- package/core/diagnostic.d.ts +14 -0
- package/core/diagnostic.js +214 -0
- package/core/diagnostic.js.map +1 -0
- 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 +40 -106
- 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/esm/core/AuthResponse.d.ts +5 -0
- package/{src/core/AuthResponse.ts → esm/core/AuthResponse.js} +3 -9
- package/esm/core/AuthResponse.js.map +1 -0
- package/esm/core/Oidc.d.ts +126 -0
- package/esm/core/Oidc.js +2 -0
- package/esm/core/Oidc.js.map +1 -0
- package/esm/core/OidcInitializationError.d.ts +7 -0
- package/esm/core/OidcInitializationError.js +17 -0
- package/esm/core/OidcInitializationError.js.map +1 -0
- package/{src/core/OidcMetadata.ts → esm/core/OidcMetadata.d.ts} +0 -5
- package/esm/core/OidcMetadata.js +3 -0
- package/esm/core/OidcMetadata.js.map +1 -0
- package/esm/core/StateData.d.ts +42 -0
- package/esm/core/StateData.js +55 -0
- package/esm/core/StateData.js.map +1 -0
- package/esm/core/configId.d.ts +4 -0
- package/esm/core/configId.js +4 -0
- package/esm/core/configId.js.map +1 -0
- package/esm/core/createOidc.d.ts +132 -0
- package/{src/core/createOidc.ts → esm/core/createOidc.js} +282 -826
- package/esm/core/createOidc.js.map +1 -0
- package/esm/core/diagnostic.d.ts +14 -0
- package/{src/core/OidcInitializationError.ts → esm/core/diagnostic.js} +40 -117
- package/esm/core/diagnostic.js.map +1 -0
- package/esm/core/evtIsUserActive.d.ts +5 -0
- package/{src/core/evtIsUserActive.ts → esm/core/evtIsUserActive.js} +14 -46
- package/esm/core/evtIsUserActive.js.map +1 -0
- package/esm/core/handleOidcCallback.d.ts +13 -0
- package/{src/core/handleOidcCallback.ts → esm/core/handleOidcCallback.js} +56 -131
- package/esm/core/handleOidcCallback.js.map +1 -0
- package/esm/core/iframeMessageProtection.d.ts +20 -0
- package/{src/core/iframeMessageProtection.ts → esm/core/iframeMessageProtection.js} +14 -49
- package/esm/core/iframeMessageProtection.js.map +1 -0
- package/{src/core/index.ts → esm/core/index.d.ts} +1 -1
- package/esm/core/index.js +4 -0
- package/esm/core/index.js.map +1 -0
- package/esm/core/initialLocationHref.d.ts +1 -0
- package/{src/core/initialLocationHref.ts → esm/core/initialLocationHref.js} +1 -1
- package/esm/core/initialLocationHref.js.map +1 -0
- package/esm/core/isNewBrowserSession.d.ts +9 -0
- package/{src/core/isNewBrowserSession.ts → esm/core/isNewBrowserSession.js} +3 -15
- package/esm/core/isNewBrowserSession.js.map +1 -0
- package/esm/core/loginOrGoToAuthServer.d.ts +40 -0
- package/{src/core/loginOrGoToAuthServer.ts → esm/core/loginOrGoToAuthServer.js} +60 -168
- package/esm/core/loginOrGoToAuthServer.js.map +1 -0
- package/esm/core/loginPropagationToOtherTabs.d.ts +8 -0
- package/{src/core/loginPropagationToOtherTabs.ts → esm/core/loginPropagationToOtherTabs.js} +7 -25
- package/esm/core/loginPropagationToOtherTabs.js.map +1 -0
- package/esm/core/loginSilent.d.ts +28 -0
- package/esm/core/loginSilent.js +125 -0
- package/esm/core/loginSilent.js.map +1 -0
- package/esm/core/logoutPropagationToOtherTabs.d.ts +10 -0
- package/{src/core/logoutPropagationToOtherTabs.ts → esm/core/logoutPropagationToOtherTabs.js} +8 -28
- package/esm/core/logoutPropagationToOtherTabs.js.map +1 -0
- package/esm/core/oidcClientTsUserToTokens.d.ts +11 -0
- package/esm/core/oidcClientTsUserToTokens.js +155 -0
- package/esm/core/oidcClientTsUserToTokens.js.map +1 -0
- package/esm/core/ongoingLoginOrRefreshProcesses.d.ts +6 -0
- package/{src/core/ongoingLoginOrRefreshProcesses.ts → esm/core/ongoingLoginOrRefreshProcesses.js} +6 -24
- package/esm/core/ongoingLoginOrRefreshProcesses.js.map +1 -0
- package/esm/core/persistedAuthState.d.ts +28 -0
- package/esm/core/persistedAuthState.js +64 -0
- package/esm/core/persistedAuthState.js.map +1 -0
- package/esm/entrypoint.d.ts +7 -0
- package/{src/entrypoint.ts → esm/entrypoint.js} +3 -26
- package/esm/entrypoint.js.map +1 -0
- package/esm/index.d.ts +1 -0
- package/esm/index.js +2 -0
- package/esm/index.js.map +1 -0
- package/esm/keycloak/index.d.ts +3 -0
- package/esm/keycloak/index.js +3 -0
- package/esm/keycloak/index.js.map +1 -0
- package/esm/keycloak/isKeycloak.d.ts +3 -0
- package/esm/keycloak/isKeycloak.js +17 -0
- package/esm/keycloak/isKeycloak.js.map +1 -0
- package/esm/keycloak/keycloak-js/Keycloak.d.ts +284 -0
- package/esm/keycloak/keycloak-js/Keycloak.js +774 -0
- package/esm/keycloak/keycloak-js/Keycloak.js.map +1 -0
- package/esm/keycloak/keycloak-js/index.d.ts +2 -0
- package/esm/keycloak/keycloak-js/index.js +2 -0
- package/esm/keycloak/keycloak-js/index.js.map +1 -0
- package/esm/keycloak/keycloak-js/types.d.ts +361 -0
- package/esm/keycloak/keycloak-js/types.js +2 -0
- package/esm/keycloak/keycloak-js/types.js.map +1 -0
- package/esm/keycloak/keycloakIssuerUriParsed.d.ts +9 -0
- package/esm/keycloak/keycloakIssuerUriParsed.js +16 -0
- package/esm/keycloak/keycloakIssuerUriParsed.js.map +1 -0
- package/esm/keycloak/keycloakUtils.d.ts +37 -0
- package/esm/keycloak/keycloakUtils.js +44 -0
- package/esm/keycloak/keycloakUtils.js.map +1 -0
- package/esm/keycloak-js.d.ts +1 -0
- package/esm/keycloak-js.js +2 -0
- package/esm/keycloak-js.js.map +1 -0
- package/esm/mock/index.js +2 -0
- package/esm/mock/index.js.map +1 -0
- package/esm/mock/oidc.d.ts +19 -0
- package/{src/mock/oidc.ts → esm/mock/oidc.js} +28 -88
- package/esm/mock/oidc.js.map +1 -0
- package/esm/mock/react.d.ts +58 -0
- package/esm/mock/react.js +7 -0
- package/esm/mock/react.js.map +1 -0
- package/esm/react/index.js +2 -0
- package/esm/react/index.js.map +1 -0
- package/esm/react/react.d.ts +102 -0
- package/esm/react/react.js +221 -0
- package/esm/react/react.js.map +1 -0
- package/esm/tools/Deferred.d.ts +14 -0
- package/esm/tools/Deferred.js +23 -0
- package/esm/tools/Deferred.js.map +1 -0
- package/esm/tools/EphemeralSessionStorage.d.ts +12 -0
- package/{src/tools/EphemeralSessionStorage.ts → esm/tools/EphemeralSessionStorage.js} +30 -112
- package/esm/tools/EphemeralSessionStorage.js.map +1 -0
- package/esm/tools/Evt.d.ts +11 -0
- package/{src/tools/Evt.ts → esm/tools/Evt.js} +7 -25
- package/esm/tools/Evt.js.map +1 -0
- package/esm/tools/StatefulEvt.d.ts +12 -0
- package/esm/tools/StatefulEvt.js +21 -0
- package/esm/tools/StatefulEvt.js.map +1 -0
- package/esm/tools/ValueOrAsyncGetter.js +2 -0
- package/esm/tools/ValueOrAsyncGetter.js.map +1 -0
- package/esm/tools/asymmetricEncryption.d.ts +18 -0
- package/esm/tools/asymmetricEncryption.js +85 -0
- package/esm/tools/asymmetricEncryption.js.map +1 -0
- package/esm/tools/base64.d.ts +2 -0
- package/{src/tools/base64.ts → esm/tools/base64.js} +3 -3
- package/esm/tools/base64.js.map +1 -0
- package/esm/tools/createObjectThatThrowsIfAccessed.d.ts +8 -0
- package/{src/tools/createObjectThatThrowsIfAccessed.ts → esm/tools/createObjectThatThrowsIfAccessed.js} +7 -18
- package/esm/tools/createObjectThatThrowsIfAccessed.js.map +1 -0
- package/esm/tools/decodeJwt.d.ts +25 -0
- package/esm/tools/decodeJwt.js +60 -0
- package/esm/tools/decodeJwt.js.map +1 -0
- package/esm/tools/generateUrlSafeRandom.d.ts +3 -0
- package/{src/tools/generateUrlSafeRandom.ts → esm/tools/generateUrlSafeRandom.js} +5 -8
- package/esm/tools/generateUrlSafeRandom.js.map +1 -0
- package/esm/tools/getDownlinkAndRtt.d.ts +4 -0
- package/{src/tools/getDownlinkAndRtt.ts → esm/tools/getDownlinkAndRtt.js} +6 -10
- package/esm/tools/getDownlinkAndRtt.js.map +1 -0
- package/esm/tools/getIsOnline.d.ts +7 -0
- package/{src/tools/getIsOnline.ts → esm/tools/getIsOnline.js} +3 -9
- package/esm/tools/getIsOnline.js.map +1 -0
- package/esm/tools/getIsValidRemoteJson.d.ts +1 -0
- package/esm/tools/getIsValidRemoteJson.js +15 -0
- package/esm/tools/getIsValidRemoteJson.js.map +1 -0
- package/esm/tools/getPrUserInteraction.d.ts +4 -0
- package/{src/tools/getPrUserInteraction.ts → esm/tools/getPrUserInteraction.js} +2 -6
- package/esm/tools/getPrUserInteraction.js.map +1 -0
- package/esm/tools/getUserEnvironmentInfo.d.ts +1 -0
- package/esm/tools/getUserEnvironmentInfo.js +50 -0
- package/esm/tools/getUserEnvironmentInfo.js.map +1 -0
- package/esm/tools/haveSharedParentDomain.d.ts +4 -0
- package/{src/tools/haveSharedParentDomain.ts → esm/tools/haveSharedParentDomain.js} +3 -5
- package/esm/tools/haveSharedParentDomain.js.map +1 -0
- package/esm/tools/isDev.d.ts +1 -0
- package/{src/tools/isDev.ts → esm/tools/isDev.js} +5 -12
- package/esm/tools/isDev.js.map +1 -0
- package/esm/tools/parseKeycloakIssuerUri.d.ts +30 -0
- package/esm/tools/parseKeycloakIssuerUri.js +33 -0
- package/esm/tools/parseKeycloakIssuerUri.js.map +1 -0
- package/esm/tools/readExpirationTimeInJwt.d.ts +1 -0
- package/{src/tools/readExpirationTimeInJwt.ts → esm/tools/readExpirationTimeInJwt.js} +6 -7
- package/esm/tools/readExpirationTimeInJwt.js.map +1 -0
- package/esm/tools/startCountdown.d.ts +11 -0
- package/{src/tools/startCountdown.ts → esm/tools/startCountdown.js} +6 -17
- package/esm/tools/startCountdown.js.map +1 -0
- package/esm/tools/subscribeToUserInteraction.d.ts +6 -0
- package/{src/tools/subscribeToUserInteraction.ts → esm/tools/subscribeToUserInteraction.js} +4 -13
- package/esm/tools/subscribeToUserInteraction.js.map +1 -0
- package/esm/tools/toFullyQualifiedUrl.d.ts +10 -0
- package/{src/tools/toFullyQualifiedUrl.ts → esm/tools/toFullyQualifiedUrl.js} +7 -25
- package/esm/tools/toFullyQualifiedUrl.js.map +1 -0
- package/esm/tools/toHumanReadableDuration.d.ts +1 -0
- package/{src/tools/toHumanReadableDuration.ts → esm/tools/toHumanReadableDuration.js} +8 -5
- package/esm/tools/toHumanReadableDuration.js.map +1 -0
- package/esm/tools/urlSearchParams.d.ts +19 -0
- package/{src/tools/urlSearchParams.ts → esm/tools/urlSearchParams.js} +24 -70
- package/esm/tools/urlSearchParams.js.map +1 -0
- package/esm/tools/workerTimers.d.ts +5 -0
- package/{src/tools/workerTimers.ts → esm/tools/workerTimers.js} +7 -27
- package/esm/tools/workerTimers.js.map +1 -0
- package/esm/vendor/frontend/oidc-client-ts.d.ts +1 -0
- package/esm/vendor/frontend/oidc-client-ts.js +3636 -0
- package/{src/vendor/frontend/tsafe.ts → esm/vendor/frontend/tsafe.d.ts} +1 -0
- package/esm/vendor/frontend/tsafe.js +1 -0
- package/esm/vendor/frontend/worker-timers.js +1 -0
- 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/index.js.map +1 -1
- 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 +74 -299
- package/react/index.js.map +1 -1
- package/react/react.js +133 -244
- package/react/react.js.map +1 -1
- 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/ValueOrAsyncGetter.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/LICENSE +0 -21
- package/README.md +0 -185
- package/core/trustedFetch.d.ts +0 -2
- package/core/trustedFetch.js +0 -12
- package/core/trustedFetch.js.map +0 -1
- package/src/backend.ts +0 -391
- package/src/core/Oidc.ts +0 -141
- package/src/core/StateData.ts +0 -118
- package/src/core/configId.ts +0 -3
- package/src/core/loginSilent.ts +0 -206
- package/src/core/oidcClientTsUserToTokens.ts +0 -229
- package/src/core/persistedAuthState.ts +0 -122
- package/src/core/trustedFetch.ts +0 -9
- package/src/index.ts +0 -7
- package/src/mock/react.tsx +0 -11
- package/src/react/react.tsx +0 -460
- package/src/tools/Deferred.ts +0 -39
- package/src/tools/StatefulEvt.ts +0 -38
- package/src/tools/asymmetricEncryption.ts +0 -184
- package/src/tools/decodeJwt.ts +0 -2
- package/src/tools/getIsValidRemoteJson.ts +0 -18
- package/src/tools/getUserEnvironmentInfo.ts +0 -42
- package/src/tools/parseKeycloakIssuerUri.ts +0 -68
- package/src/vendor/backend/evt.ts +0 -2
- package/src/vendor/backend/jsonwebtoken.ts +0 -1
- package/src/vendor/backend/node-fetch.ts +0 -2
- package/src/vendor/backend/node-jose.ts +0 -1
- package/src/vendor/backend/tsafe.ts +0 -5
- package/src/vendor/backend/zod.ts +0 -1
- 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/{src/mock/index.ts → esm/mock/index.d.ts} +0 -0
- /package/{src/react/index.ts → esm/react/index.d.ts} +0 -0
- /package/{src/tools/ValueOrAsyncGetter.ts → esm/tools/ValueOrAsyncGetter.d.ts} +0 -0
- /package/{src/vendor/frontend/worker-timers.ts → esm/vendor/frontend/worker-timers.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t={d:(r,e)=>{for(var n in e)t.o(e,n)&&!t.o(r,n)&&Object.defineProperty(r,n,{enumerable:!0,get:e[n]})},o:(t,r)=>Object.prototype.hasOwnProperty.call(t,r)},r={};t.d(r,{vA:()=>d,id:()=>e,is:()=>w,FB:()=>j,AG:()=>O,Jc:()=>u,Ew:()=>m});var e=function(t){return t};function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),e.push.apply(e,n)}return e}function i(t){for(var r=1;r<arguments.length;r++){var e=null!=arguments[r]?arguments[r]:{};r%2?o(Object(e),!0).forEach((function(r){c(t,r,e[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):o(Object(e)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}))}return t}function c(t,r,e){return(r=function(t){var r=function(t){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var e=r.call(t,"string");if("object"!=n(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(r)?r:r+""}(r))in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}var u=function(t,r,e){try{t[r]=e}catch(t){}if(t[r]===e)return e;var n=void 0,o=Object.getOwnPropertyDescriptor(t,r)||{enumerable:!0,configurable:!0};if(o.get)throw new Error("Probably a wrong ides to overwrite ".concat(String(r)," getter"));try{Object.defineProperty(t,r,i(i({},o),{},{value:e}))}catch(t){n=t}if(t[r]!==e)throw n||new Error("Can't assign");return e};function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}function a(t,r){if(r&&("object"==f(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function l(t){var r="function"==typeof Map?new Map:void 0;return l=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(r){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,e)}function e(){return function(t,r,e){if(s())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,r);var o=new(t.bind.apply(t,n));return e&&p(o,e.prototype),o}(t,arguments,y(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),p(e,t)},l(t)}function s(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(s=function(){return!!t})()}function p(t,r){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},p(t,r)}function y(t){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},y(t)}var b=function(){function t(r){var e,n,o,i;if(function(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,t),n=this,o=t,i=["Wrong assertion encountered"+(r?': "'.concat(r,'"'):"")],o=y(o),(e=a(n,s()?Reflect.construct(o,i||[],y(n).constructor):o.apply(n,i))).originalMessage=r,Object.setPrototypeOf(e,(this instanceof t?this.constructor:void 0).prototype),!e.stack)return a(e);try{u(e,"stack",e.stack.split("\n").filter((function(){for(var t=arguments.length,r=new Array(t),e=0;e<t;e++)r[e]=arguments[e];var n=r[1];return 1!==n&&2!==n})).join("\n"))}catch(t){}return e}return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),r&&p(t,r)}(t,l(Error)),r=t,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(),v=void 0;function d(t,r){if(0===arguments.length&&(t=!0),void 0===v){if(!t)throw new b("function"==typeof r?r():r)}else v=void 0}var h="Wrong usage of the `is` function refer to https://docs.tsafe.dev/is";function w(t){var r={};if(void 0!==v)throw v=void 0,new Error(h);return v=r,Promise.resolve().then((function(){if(v===r)throw new Error(h)})),null}function m(t,r){return r}function O(t){var r={};for(var e in t)void 0!==t[e]&&(r[e]=t[e]);return r}function g(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}function j(t,r){var e,n=function(t,r){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=function(t,r){if(t){if("string"==typeof t)return g(t,r);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?g(t,r):void 0}}(t))||r&&t&&"number"==typeof t.length){e&&(t=e);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,u=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return c=t.done,t},e:function(t){u=!0,i=t},f:function(){try{c||null==e.return||e.return()}finally{if(u)throw i}}}}(t);try{for(n.s();!(e=n.n()).done;)if(e.value===r)return!0}catch(t){n.e(t)}finally{n.f()}return!1}var P=r.vA,S=r.id,E=r.is,A=r.FB,_=r.AG,D=r.Jc,T=r.Ew;export{P as assert,S as id,E as is,A as isAmong,_ as noUndefined,D as overwriteReadonlyProp,T as typeGuard};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={455:function(e,t){var r,n,i,o;function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}o=function(e){var t,r=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,n=1073741824,i=new WeakMap,o=function(e,t){return function(i){var o=t.get(i),a=void 0===o?i.size:o<n?o+1:0;if(!i.has(a))return e(i,a);if(i.size<536870912){for(;i.has(a);)a=Math.floor(Math.random()*n);return e(i,a)}if(i.size>r)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;i.has(a);)a=Math.floor(Math.random()*r);return e(i,a)}}((t=i,function(e,r){return t.set(e,r),r}),i),a=function(e){return function(t){var r=e(t);return t.add(r),r}}(o);e.addUniqueNumber=a,e.generateUniqueNumber=o},"object"===a(t)?o(t):(n=[t],void 0===(i="function"==typeof(r=o)?r.apply(t,n):r)||(e.exports=i))}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,r),o.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};r.d(n,{F:()=>i});var i={};r.r(i),r.d(i,{clearInterval:()=>u,clearTimeout:()=>m,setInterval:()=>d,setTimeout:()=>l});var o,a=r(455),s=(o=null,function(){if(null!==o)return o;var e=new Blob(['(()=>{"use strict";const e=new Map,t=new Map,r=(e,t)=>{let r,o;const i=performance.now();r=i,o=e-Math.max(0,i-t);return{expected:r+o,remainingDelay:o}},o=(e,t,r,i)=>{const s=performance.now();s>r?postMessage({id:null,method:"call",params:{timerId:t,timerType:i}}):e.set(t,setTimeout(o,r-s,e,t,r,i))};addEventListener("message",(i=>{let{data:s}=i;try{if("clear"===s.method){const{id:r,params:{timerId:o,timerType:i}}=s;if("interval"===i)(t=>{const r=e.get(t);if(void 0===r)throw new Error(\'There is no interval scheduled with the given id "\'.concat(t,\'".\'));clearTimeout(r),e.delete(t)})(o),postMessage({error:null,id:r});else{if("timeout"!==i)throw new Error(\'The given type "\'.concat(i,\'" is not supported\'));(e=>{const r=t.get(e);if(void 0===r)throw new Error(\'There is no timeout scheduled with the given id "\'.concat(e,\'".\'));clearTimeout(r),t.delete(e)})(o),postMessage({error:null,id:r})}}else{if("set"!==s.method)throw new Error(\'The given method "\'.concat(s.method,\'" is not supported\'));{const{params:{delay:i,now:n,timerId:a,timerType:d}}=s;if("interval"===d)((t,i,s)=>{const{expected:n,remainingDelay:a}=r(t,s);e.set(i,setTimeout(o,a,e,i,n,"interval"))})(i,a,n);else{if("timeout"!==d)throw new Error(\'The given type "\'.concat(d,\'" is not supported\'));((e,i,s)=>{const{expected:n,remainingDelay:a}=r(e,s);t.set(i,setTimeout(o,a,t,i,n,"timeout"))})(i,a,n)}}}}catch(e){postMessage({error:{message:e.message},id:s.id,result:null})}}))})();'],{type:"application/javascript; charset=utf-8"}),t=URL.createObjectURL(e);return o=function(e){var t=new Map([[0,function(){}]]),r=new Map([[0,function(){}]]),n=new Map,i=new Worker(e);return i.addEventListener("message",(function(e){var i=e.data;if(function(e){return void 0!==e.method&&"call"===e.method}(i)){var o=i.params,a=o.timerId,s=o.timerType;if("interval"===s){var u=t.get(a);if("number"==typeof u){var m=n.get(u);if(void 0===m||m.timerId!==a||m.timerType!==s)throw new Error("The timer is in an undefined state.")}else{if(void 0===u)throw new Error("The timer is in an undefined state.");u()}}else if("timeout"===s){var d=r.get(a);if("number"==typeof d){var l=n.get(d);if(void 0===l||l.timerId!==a||l.timerType!==s)throw new Error("The timer is in an undefined state.")}else{if(void 0===d)throw new Error("The timer is in an undefined state.");d(),r.delete(a)}}}else{if(!function(e){return null===e.error&&"number"==typeof e.id}(i)){var c=i.error.message;throw new Error(c)}var p=i.id,f=n.get(p);if(void 0===f)throw new Error("The timer is in an undefined state.");var v=f.timerId,y=f.timerType;n.delete(p),"interval"===y?t.delete(v):r.delete(v)}})),{clearInterval:function(e){var r=(0,a.generateUniqueNumber)(n);n.set(r,{timerId:e,timerType:"interval"}),t.set(e,r),i.postMessage({id:r,method:"clear",params:{timerId:e,timerType:"interval"}})},clearTimeout:function(e){var t=(0,a.generateUniqueNumber)(n);n.set(t,{timerId:e,timerType:"timeout"}),r.set(e,t),i.postMessage({id:t,method:"clear",params:{timerId:e,timerType:"timeout"}})},setInterval:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(0,a.generateUniqueNumber)(t);return t.set(n,(function(){e(),"function"==typeof t.get(n)&&i.postMessage({id:null,method:"set",params:{delay:r,now:performance.now(),timerId:n,timerType:"interval"}})})),i.postMessage({id:null,method:"set",params:{delay:r,now:performance.now(),timerId:n,timerType:"interval"}}),n},setTimeout:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(0,a.generateUniqueNumber)(r);return r.set(n,e),i.postMessage({id:null,method:"set",params:{delay:t,now:performance.now(),timerId:n,timerType:"timeout"}}),n}}}(t),setTimeout((function(){return URL.revokeObjectURL(t)})),o}),u=function(e){return s().clearInterval(e)},m=function(e){return s().clearTimeout(e)},d=function(){var e;return(e=s()).setInterval.apply(e,arguments)},l=function(){var e;return(e=s()).setTimeout.apply(e,arguments)},c=n.F;export{c as workerTimers};
|
package/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { type Oidc, OidcInitializationError, type ParamsOfCreateOidc, createOidc
|
|
1
|
+
export { type Oidc, OidcInitializationError, type ParamsOfCreateOidc, createOidc } from "./core";
|
package/index.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.createOidc = exports.OidcInitializationError = void 0;
|
|
4
4
|
var core_1 = require("./core");
|
|
5
5
|
Object.defineProperty(exports, "OidcInitializationError", { enumerable: true, get: function () { return core_1.OidcInitializationError; } });
|
|
6
6
|
Object.defineProperty(exports, "createOidc", { enumerable: true, get: function () { return core_1.createOidc; } });
|
|
7
|
-
Object.defineProperty(exports, "trustedFetch", { enumerable: true, get: function () { return core_1.trustedFetch; } });
|
|
8
7
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":";;;AAAA,+
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,+BAAiG;AAA7E,+GAAA,uBAAuB,OAAA;AAA2B,kGAAA,UAAU,OAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createKeycloakUtils = exports.isKeycloak = void 0;
|
|
4
|
+
var isKeycloak_1 = require("./isKeycloak");
|
|
5
|
+
Object.defineProperty(exports, "isKeycloak", { enumerable: true, get: function () { return isKeycloak_1.isKeycloak; } });
|
|
6
|
+
var keycloakUtils_1 = require("./keycloakUtils");
|
|
7
|
+
Object.defineProperty(exports, "createKeycloakUtils", { enumerable: true, get: function () { return keycloakUtils_1.createKeycloakUtils; } });
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/keycloak/index.ts"],"names":[],"mappings":";;;AAAA,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AAEnB,iDAKyB;AADrB,oHAAA,mBAAmB,OAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isKeycloak = isKeycloak;
|
|
4
|
+
function isKeycloak(params) {
|
|
5
|
+
const { issuerUri } = params;
|
|
6
|
+
const url = new URL(issuerUri.replace(/\/$/, ""));
|
|
7
|
+
const split = url.pathname.split("/realms/");
|
|
8
|
+
if (split.length !== 2) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
const [, realm] = split;
|
|
12
|
+
if (realm === "") {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
if (realm.includes("/")) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=isKeycloak.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isKeycloak.js","sourceRoot":"","sources":["../../src/keycloak/isKeycloak.ts"],"names":[],"mappings":";;AAAA,gCAsBC;AAtBD,SAAgB,UAAU,CAAC,MAA6B;IACpD,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;IAE7B,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;IAElD,MAAM,KAAK,GAAG,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAE7C,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,KAAK,CAAC;IAExB,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;QACf,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACtB,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import type { KeycloakServerConfig, KeycloakInitOptions, KeycloakError, KeycloakLogoutOptions, KeycloakRoles, KeycloakTokenParsed, KeycloakResourceAccess, KeycloakProfile, KeycloakUserInfo, KeycloakLoginOptions, KeycloakRegisterOptions, KeycloakAccountOptions } from "./types";
|
|
2
|
+
type ConstructorParams = KeycloakServerConfig & {
|
|
3
|
+
homeUrl: string;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* This module provides a drop-in replacement for `keycloak-js`,
|
|
7
|
+
* designed for teams migrating to `oidc-spa` with minimal changes.
|
|
8
|
+
*
|
|
9
|
+
* ⚠️ While the import path is `oidc-spa/keycloak-js`, this is *not* a re-export or patch —
|
|
10
|
+
* it is a full alternative implementation aligned with the `keycloak-js` API.
|
|
11
|
+
*/
|
|
12
|
+
export declare class Keycloak {
|
|
13
|
+
/**
|
|
14
|
+
* Creates a new Keycloak client instance.
|
|
15
|
+
* @param config A configuration object or path to a JSON config file.
|
|
16
|
+
*
|
|
17
|
+
* NOTE oidc-spa: Currently not supporting GenericOidcConfig (providing explicitly authorization_endpoint ect)
|
|
18
|
+
* But we could if with the __metadata parameter of oidc-spa.
|
|
19
|
+
* I'm not seeing the usecase when ran against keycloak right now so not doing it.
|
|
20
|
+
*/
|
|
21
|
+
constructor(params: ConstructorParams);
|
|
22
|
+
/**
|
|
23
|
+
* Called to initialize the adapter.
|
|
24
|
+
* @param initOptions Initialization options.
|
|
25
|
+
* @returns A promise to set functions to be invoked on success or error.
|
|
26
|
+
*/
|
|
27
|
+
init(initOptions?: KeycloakInitOptions): Promise<boolean>;
|
|
28
|
+
/**
|
|
29
|
+
* Is true if the user is authenticated, false otherwise.
|
|
30
|
+
*/
|
|
31
|
+
get authenticated(): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* The user id.
|
|
34
|
+
*/
|
|
35
|
+
get subject(): string | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Response mode passed in init (default value is `'fragment'`).
|
|
38
|
+
*
|
|
39
|
+
* NOTE oidc-spa: Can only be fragment.
|
|
40
|
+
*/
|
|
41
|
+
responseMode: string;
|
|
42
|
+
/**
|
|
43
|
+
* Response type sent to Keycloak with login requests. This is determined
|
|
44
|
+
* based on the flow value used during initialization, but can be overridden
|
|
45
|
+
* by setting this value.
|
|
46
|
+
*
|
|
47
|
+
* NOTE oidc-spa: Can only be 'code'
|
|
48
|
+
*/
|
|
49
|
+
responseType: string;
|
|
50
|
+
/**
|
|
51
|
+
* Flow passed in init.
|
|
52
|
+
*
|
|
53
|
+
* NOTE oidc-spa: Can only be 'standard'
|
|
54
|
+
*/
|
|
55
|
+
flow: string;
|
|
56
|
+
/**
|
|
57
|
+
* The realm roles associated with the token.
|
|
58
|
+
*/
|
|
59
|
+
get realmAccess(): KeycloakRoles | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* The resource roles associated with the token.
|
|
62
|
+
*/
|
|
63
|
+
get resourceAccess(): KeycloakResourceAccess | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* The base64 encoded token that can be sent in the Authorization header in
|
|
66
|
+
* requests to services.
|
|
67
|
+
*/
|
|
68
|
+
get token(): string | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* The parsed token as a JavaScript object.
|
|
71
|
+
*/
|
|
72
|
+
get tokenParsed(): KeycloakTokenParsed | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* The base64 encoded refresh token that can be used to retrieve a new token.
|
|
75
|
+
*/
|
|
76
|
+
get refreshToken(): string | undefined;
|
|
77
|
+
/**
|
|
78
|
+
* The parsed refresh token as a JavaScript object.
|
|
79
|
+
*/
|
|
80
|
+
get refreshTokenParsed(): KeycloakTokenParsed | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* The base64 encoded ID token.
|
|
83
|
+
*/
|
|
84
|
+
get idToken(): string | undefined;
|
|
85
|
+
/**
|
|
86
|
+
* The parsed id token as a JavaScript object.
|
|
87
|
+
*/
|
|
88
|
+
get idTokenParsed(): KeycloakTokenParsed | undefined;
|
|
89
|
+
/**
|
|
90
|
+
* The estimated time difference between the browser time and the Keycloak
|
|
91
|
+
* server in seconds. This value is just an estimation, but is accurate
|
|
92
|
+
* enough when determining if a token is expired or not.
|
|
93
|
+
*
|
|
94
|
+
* NOTE oidc-spa: Not supported.
|
|
95
|
+
*/
|
|
96
|
+
timeSkew: null;
|
|
97
|
+
/**
|
|
98
|
+
* Whether the instance has been initialized by calling `.init()`.
|
|
99
|
+
*/
|
|
100
|
+
get didInitialize(): boolean;
|
|
101
|
+
/**
|
|
102
|
+
* @private Undocumented.
|
|
103
|
+
*/
|
|
104
|
+
get loginRequired(): boolean;
|
|
105
|
+
/**
|
|
106
|
+
* @private Undocumented.
|
|
107
|
+
*/
|
|
108
|
+
get authServerUrl(): string;
|
|
109
|
+
/**
|
|
110
|
+
* @private Undocumented.
|
|
111
|
+
*/
|
|
112
|
+
get realm(): string;
|
|
113
|
+
/**
|
|
114
|
+
* @private Undocumented.
|
|
115
|
+
*/
|
|
116
|
+
get clientId(): string;
|
|
117
|
+
/**
|
|
118
|
+
* @private Undocumented.
|
|
119
|
+
*/
|
|
120
|
+
get redirectUri(): string | undefined;
|
|
121
|
+
/**
|
|
122
|
+
* @private Undocumented.
|
|
123
|
+
*/
|
|
124
|
+
get sessionId(): string | undefined;
|
|
125
|
+
/**
|
|
126
|
+
* @private Undocumented.
|
|
127
|
+
*/
|
|
128
|
+
get profile(): KeycloakProfile | undefined;
|
|
129
|
+
/**
|
|
130
|
+
* @private Undocumented.
|
|
131
|
+
*/
|
|
132
|
+
get userInfo(): KeycloakUserInfo | undefined;
|
|
133
|
+
/**
|
|
134
|
+
* Called when the adapter is initialized.
|
|
135
|
+
*/
|
|
136
|
+
onReady?(authenticated: boolean): void;
|
|
137
|
+
/**
|
|
138
|
+
* Called when a user is successfully authenticated.
|
|
139
|
+
*/
|
|
140
|
+
onAuthSuccess?(): void;
|
|
141
|
+
/**
|
|
142
|
+
* Called if there was an error during authentication.
|
|
143
|
+
*/
|
|
144
|
+
onAuthError?(errorData: KeycloakError): void;
|
|
145
|
+
/**
|
|
146
|
+
* Called when the token is refreshed.
|
|
147
|
+
*/
|
|
148
|
+
onAuthRefreshSuccess?(): void;
|
|
149
|
+
/**
|
|
150
|
+
* Called if there was an error while trying to refresh the token.
|
|
151
|
+
*
|
|
152
|
+
* NOTE oidc-spa: In oidc-spa an auth refresh error always triggers a page refresh.
|
|
153
|
+
*/
|
|
154
|
+
/**
|
|
155
|
+
* Called if the user is logged out (will only be called if the session
|
|
156
|
+
* status iframe is enabled, or in Cordova mode).
|
|
157
|
+
*
|
|
158
|
+
* NOTE oidc-spa: In oidc-spa a logout always triggers a page refresh.
|
|
159
|
+
*/
|
|
160
|
+
/**
|
|
161
|
+
* Called when the access token is expired. If a refresh token is available
|
|
162
|
+
* the token can be refreshed with Keycloak#updateToken, or in cases where
|
|
163
|
+
* it's not (ie. with implicit flow) you can redirect to login screen to
|
|
164
|
+
* obtain a new access token.
|
|
165
|
+
*/
|
|
166
|
+
set onTokenExpired(value: (() => void) | undefined);
|
|
167
|
+
get onTokenExpired(): (() => void) | undefined;
|
|
168
|
+
/**
|
|
169
|
+
* Called when a AIA has been requested by the application.
|
|
170
|
+
* @param status the outcome of the required action
|
|
171
|
+
* @param action the alias name of the required action, e.g. UPDATE_PASSWORD, CONFIGURE_TOTP etc.
|
|
172
|
+
*/
|
|
173
|
+
onActionUpdate?(status: "success" | "cancelled" | "error", action?: string): void;
|
|
174
|
+
/**
|
|
175
|
+
* Redirects to login form.
|
|
176
|
+
* @param options Login options.
|
|
177
|
+
*/
|
|
178
|
+
login(options?: KeycloakLoginOptions & {
|
|
179
|
+
doesCurrentHrefRequiresAuth?: boolean;
|
|
180
|
+
}): Promise<never>;
|
|
181
|
+
/**
|
|
182
|
+
* Redirects to logout.
|
|
183
|
+
* @param options Logout options.
|
|
184
|
+
*/
|
|
185
|
+
logout(options?: KeycloakLogoutOptions): Promise<never>;
|
|
186
|
+
/**
|
|
187
|
+
* Redirects to registration form.
|
|
188
|
+
* @param options The options used for the registration.
|
|
189
|
+
*/
|
|
190
|
+
register(options?: KeycloakRegisterOptions): Promise<never>;
|
|
191
|
+
/**
|
|
192
|
+
* Redirects to the Account Management Console.
|
|
193
|
+
*/
|
|
194
|
+
accountManagement(options?: {
|
|
195
|
+
/**
|
|
196
|
+
* Specifies the uri to redirect to when redirecting back to the application.
|
|
197
|
+
*/
|
|
198
|
+
redirectUri?: string;
|
|
199
|
+
locale?: string;
|
|
200
|
+
}): Promise<never>;
|
|
201
|
+
/**
|
|
202
|
+
* Returns the URL to login form.
|
|
203
|
+
* @param options Supports same options as Keycloak#login.
|
|
204
|
+
*
|
|
205
|
+
* NOTE oidc-spa: Not supported, please use login() method.
|
|
206
|
+
*/
|
|
207
|
+
/**
|
|
208
|
+
* Returns the URL to logout the user.
|
|
209
|
+
* @param options Logout options.
|
|
210
|
+
*
|
|
211
|
+
* NOTE oidc-spa: Not supported, please use logout() method.
|
|
212
|
+
*/
|
|
213
|
+
/**
|
|
214
|
+
* Returns the URL to registration page.
|
|
215
|
+
* @param options The options used for creating the registration URL.
|
|
216
|
+
*
|
|
217
|
+
* NOTE oidc-spa: Not supported please user login({ action: "register" })
|
|
218
|
+
*/
|
|
219
|
+
/**
|
|
220
|
+
* Returns the URL to the Account Management Console.
|
|
221
|
+
* @param options The options used for creating the account URL.
|
|
222
|
+
*/
|
|
223
|
+
createAccountUrl(options?: KeycloakAccountOptions & {
|
|
224
|
+
locale?: string;
|
|
225
|
+
}): string;
|
|
226
|
+
/**
|
|
227
|
+
* Returns true if the token has less than `minValidity` seconds left before
|
|
228
|
+
* it expires.
|
|
229
|
+
* @param minValidity If not specified, `0` is used.
|
|
230
|
+
*/
|
|
231
|
+
isTokenExpired(minValidity?: number): boolean;
|
|
232
|
+
/**
|
|
233
|
+
* If the token expires within `minValidity` seconds, the token is refreshed.
|
|
234
|
+
* If the session status iframe is enabled, the session status is also
|
|
235
|
+
* checked.
|
|
236
|
+
* @param minValidity If not specified, `5` is used.
|
|
237
|
+
* @returns A promise to set functions that can be invoked if the token is
|
|
238
|
+
* still valid, or if the token is no longer valid.
|
|
239
|
+
* @example
|
|
240
|
+
* ```js
|
|
241
|
+
* keycloak.updateToken(5).then(function(refreshed) {
|
|
242
|
+
* if (refreshed) {
|
|
243
|
+
* alert('Token was successfully refreshed');
|
|
244
|
+
* } else {
|
|
245
|
+
* alert('Token is still valid');
|
|
246
|
+
* }
|
|
247
|
+
* }).catch(function() {
|
|
248
|
+
* alert('Failed to refresh the token, or the session has expired');
|
|
249
|
+
* });
|
|
250
|
+
*/
|
|
251
|
+
updateToken(minValidity?: number): Promise<boolean>;
|
|
252
|
+
/**
|
|
253
|
+
* Clears authentication state, including tokens. This can be useful if
|
|
254
|
+
* the application has detected the session was expired, for example if
|
|
255
|
+
* updating token fails. Invoking this results in Keycloak#onAuthLogout
|
|
256
|
+
* callback listener being invoked.
|
|
257
|
+
*
|
|
258
|
+
* NOTE oidc-spa: In this implementation we never end up in the kind of
|
|
259
|
+
* state where calling this makes sense.
|
|
260
|
+
* oidc-spa take more control and exposes less complexity to the user of the
|
|
261
|
+
* adapter.
|
|
262
|
+
*/
|
|
263
|
+
/**
|
|
264
|
+
* Returns true if the token has the given realm role.
|
|
265
|
+
* @param role A realm role name.
|
|
266
|
+
*/
|
|
267
|
+
hasRealmRole(role: string): boolean;
|
|
268
|
+
/**
|
|
269
|
+
* Returns true if the token has the given role for the resource.
|
|
270
|
+
* @param role A role name.
|
|
271
|
+
* @param resource If not specified, `clientId` is used.
|
|
272
|
+
*/
|
|
273
|
+
hasResourceRole(role: string, resource?: string): boolean;
|
|
274
|
+
/**
|
|
275
|
+
* Loads the user's profile.
|
|
276
|
+
* @returns A promise to set functions to be invoked on success or error.
|
|
277
|
+
*/
|
|
278
|
+
loadUserProfile(): Promise<KeycloakProfile>;
|
|
279
|
+
/**
|
|
280
|
+
* @private Undocumented.
|
|
281
|
+
*/
|
|
282
|
+
loadUserInfo(): Promise<KeycloakUserInfo>;
|
|
283
|
+
}
|
|
284
|
+
export {};
|