oidc-spa 7.1.10 → 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.
Files changed (172) hide show
  1. package/backend.js +235 -352
  2. package/backend.js.map +1 -1
  3. package/core/AuthResponse.js +12 -49
  4. package/core/AuthResponse.js.map +1 -1
  5. package/core/Oidc.d.ts +1 -2
  6. package/core/OidcInitializationError.d.ts +2 -2
  7. package/core/OidcInitializationError.js +230 -297
  8. package/core/OidcInitializationError.js.map +1 -1
  9. package/core/OidcMetadata.js +1 -1
  10. package/core/OidcMetadata.js.map +1 -1
  11. package/core/StateData.d.ts +5 -5
  12. package/core/StateData.js +25 -25
  13. package/core/StateData.js.map +1 -1
  14. package/core/configId.js +1 -1
  15. package/core/configId.js.map +1 -1
  16. package/core/createOidc.d.ts +8 -0
  17. package/core/createOidc.js +999 -1294
  18. package/core/createOidc.js.map +1 -1
  19. package/core/evtIsUserActive.js +26 -27
  20. package/core/evtIsUserActive.js.map +1 -1
  21. package/core/handleOidcCallback.js +99 -154
  22. package/core/handleOidcCallback.js.map +1 -1
  23. package/core/iframeMessageProtection.d.ts +1 -1
  24. package/core/iframeMessageProtection.js +40 -106
  25. package/core/iframeMessageProtection.js.map +1 -1
  26. package/core/index.d.ts +1 -1
  27. package/core/index.js +3 -3
  28. package/core/index.js.map +1 -1
  29. package/core/initialLocationHref.js +1 -1
  30. package/core/initialLocationHref.js.map +1 -1
  31. package/core/isNewBrowserSession.js +8 -8
  32. package/core/isNewBrowserSession.js.map +1 -1
  33. package/core/loginOrGoToAuthServer.d.ts +1 -1
  34. package/core/loginOrGoToAuthServer.js +188 -310
  35. package/core/loginOrGoToAuthServer.js.map +1 -1
  36. package/core/loginPropagationToOtherTabs.js +15 -16
  37. package/core/loginPropagationToOtherTabs.js.map +1 -1
  38. package/core/loginSilent.d.ts +2 -3
  39. package/core/loginSilent.js +118 -214
  40. package/core/loginSilent.js.map +1 -1
  41. package/core/logoutPropagationToOtherTabs.js +15 -16
  42. package/core/logoutPropagationToOtherTabs.js.map +1 -1
  43. package/core/oidcClientTsUserToTokens.d.ts +1 -1
  44. package/core/oidcClientTsUserToTokens.js +75 -72
  45. package/core/oidcClientTsUserToTokens.js.map +1 -1
  46. package/core/ongoingLoginOrRefreshProcesses.js +23 -89
  47. package/core/ongoingLoginOrRefreshProcesses.js.map +1 -1
  48. package/core/persistedAuthState.js +13 -13
  49. package/core/persistedAuthState.js.map +1 -1
  50. package/entrypoint.js +9 -9
  51. package/entrypoint.js.map +1 -1
  52. package/index.d.ts +1 -1
  53. package/index.js +1 -2
  54. package/index.js.map +1 -1
  55. package/keycloak/index.d.ts +3 -0
  56. package/keycloak/index.js +8 -0
  57. package/keycloak/index.js.map +1 -0
  58. package/keycloak/isKeycloak.d.ts +3 -0
  59. package/keycloak/isKeycloak.js +20 -0
  60. package/keycloak/isKeycloak.js.map +1 -0
  61. package/keycloak/keycloak-js/Keycloak.d.ts +284 -0
  62. package/keycloak/keycloak-js/Keycloak.js +778 -0
  63. package/keycloak/keycloak-js/Keycloak.js.map +1 -0
  64. package/keycloak/keycloak-js/index.d.ts +2 -0
  65. package/keycloak/keycloak-js/index.js +6 -0
  66. package/keycloak/keycloak-js/index.js.map +1 -0
  67. package/keycloak/keycloak-js/types.d.ts +361 -0
  68. package/keycloak/keycloak-js/types.js +3 -0
  69. package/keycloak/keycloak-js/types.js.map +1 -0
  70. package/keycloak/keycloakIssuerUriParsed.d.ts +9 -0
  71. package/keycloak/keycloakIssuerUriParsed.js +19 -0
  72. package/keycloak/keycloakIssuerUriParsed.js.map +1 -0
  73. package/keycloak/keycloakUtils.d.ts +37 -0
  74. package/keycloak/keycloakUtils.js +47 -0
  75. package/keycloak/keycloakUtils.js.map +1 -0
  76. package/keycloak-js.d.ts +1 -0
  77. package/keycloak-js.js +18 -0
  78. package/keycloak-js.js.map +1 -0
  79. package/mock/oidc.js +147 -194
  80. package/mock/oidc.js.map +1 -1
  81. package/mock/react.js +2 -2
  82. package/mock/react.js.map +1 -1
  83. package/package.json +38 -9
  84. package/react/react.js +133 -244
  85. package/react/react.js.map +1 -1
  86. package/src/core/AuthResponse.ts +2 -0
  87. package/src/core/Oidc.ts +1 -2
  88. package/src/core/OidcInitializationError.ts +30 -30
  89. package/src/core/OidcMetadata.ts +1 -1
  90. package/src/core/StateData.ts +24 -24
  91. package/src/core/createOidc.ts +24 -31
  92. package/src/core/handleOidcCallback.ts +44 -23
  93. package/src/core/iframeMessageProtection.ts +7 -7
  94. package/src/core/index.ts +1 -1
  95. package/src/core/loginOrGoToAuthServer.ts +1 -1
  96. package/src/core/loginSilent.ts +14 -11
  97. package/src/core/oidcClientTsUserToTokens.ts +1 -1
  98. package/src/index.ts +1 -7
  99. package/src/keycloak/index.ts +8 -0
  100. package/src/keycloak/isKeycloak.ts +23 -0
  101. package/src/keycloak/keycloak-js/Keycloak.ts +1097 -0
  102. package/src/keycloak/keycloak-js/index.ts +2 -0
  103. package/src/keycloak/keycloak-js/types.ts +442 -0
  104. package/src/keycloak/keycloakIssuerUriParsed.ts +29 -0
  105. package/src/keycloak/keycloakUtils.ts +90 -0
  106. package/src/keycloak-js.ts +1 -0
  107. package/src/react/react.tsx +17 -1
  108. package/src/tools/decodeJwt.ts +95 -2
  109. package/src/tools/parseKeycloakIssuerUri.ts +11 -30
  110. package/src/vendor/frontend/oidc-client-ts.ts +1 -0
  111. package/src/vendor/frontend/tsafe.ts +1 -0
  112. package/tools/Deferred.js +13 -35
  113. package/tools/Deferred.js.map +1 -1
  114. package/tools/EphemeralSessionStorage.js +46 -48
  115. package/tools/EphemeralSessionStorage.js.map +1 -1
  116. package/tools/Evt.js +14 -14
  117. package/tools/Evt.js.map +1 -1
  118. package/tools/StatefulEvt.js +5 -5
  119. package/tools/StatefulEvt.js.map +1 -1
  120. package/tools/asymmetricEncryption.js +81 -172
  121. package/tools/asymmetricEncryption.js.map +1 -1
  122. package/tools/base64.js +2 -2
  123. package/tools/base64.js.map +1 -1
  124. package/tools/createObjectThatThrowsIfAccessed.js +13 -61
  125. package/tools/createObjectThatThrowsIfAccessed.js.map +1 -1
  126. package/tools/decodeJwt.d.ts +25 -2
  127. package/tools/decodeJwt.js +61 -3
  128. package/tools/decodeJwt.js.map +1 -1
  129. package/tools/generateUrlSafeRandom.js +5 -30
  130. package/tools/generateUrlSafeRandom.js.map +1 -1
  131. package/tools/getDownlinkAndRtt.js +8 -30
  132. package/tools/getDownlinkAndRtt.js.map +1 -1
  133. package/tools/getIsOnline.js +3 -3
  134. package/tools/getIsOnline.js.map +1 -1
  135. package/tools/getIsValidRemoteJson.js +12 -59
  136. package/tools/getIsValidRemoteJson.js.map +1 -1
  137. package/tools/getPrUserInteraction.js +4 -4
  138. package/tools/getPrUserInteraction.js.map +1 -1
  139. package/tools/getUserEnvironmentInfo.js +17 -12
  140. package/tools/getUserEnvironmentInfo.js.map +1 -1
  141. package/tools/haveSharedParentDomain.js +5 -5
  142. package/tools/haveSharedParentDomain.js.map +1 -1
  143. package/tools/isDev.js +2 -2
  144. package/tools/isDev.js.map +1 -1
  145. package/tools/parseKeycloakIssuerUri.d.ts +2 -0
  146. package/tools/parseKeycloakIssuerUri.js +11 -42
  147. package/tools/parseKeycloakIssuerUri.js.map +1 -1
  148. package/tools/readExpirationTimeInJwt.js +4 -4
  149. package/tools/readExpirationTimeInJwt.js.map +1 -1
  150. package/tools/startCountdown.js +17 -65
  151. package/tools/startCountdown.js.map +1 -1
  152. package/tools/subscribeToUserInteraction.js +17 -66
  153. package/tools/subscribeToUserInteraction.js.map +1 -1
  154. package/tools/toFullyQualifiedUrl.js +7 -7
  155. package/tools/toFullyQualifiedUrl.js.map +1 -1
  156. package/tools/toHumanReadableDuration.js +13 -13
  157. package/tools/toHumanReadableDuration.js.map +1 -1
  158. package/tools/urlSearchParams.js +28 -50
  159. package/tools/urlSearchParams.js.map +1 -1
  160. package/tools/workerTimers.js +10 -10
  161. package/tools/workerTimers.js.map +1 -1
  162. package/vendor/frontend/oidc-client-ts.d.ts +1 -0
  163. package/vendor/frontend/oidc-client-ts.js +3686 -0
  164. package/vendor/frontend/tsafe.d.ts +1 -0
  165. package/vendor/frontend/tsafe.js +1 -1
  166. package/core/trustedFetch.d.ts +0 -2
  167. package/core/trustedFetch.js +0 -12
  168. package/core/trustedFetch.js.map +0 -1
  169. package/src/core/trustedFetch.ts +0 -9
  170. package/src/vendor/frontend/oidc-client-ts-and-jwt-decode.ts +0 -4
  171. package/vendor/frontend/oidc-client-ts-and-jwt-decode.d.ts +0 -3
  172. package/vendor/frontend/oidc-client-ts-and-jwt-decode.js +0 -3
@@ -1,331 +1,264 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
8
26
  };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
15
33
  };
16
34
  })();
17
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
- return new (P || (P = Promise))(function (resolve, reject) {
20
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
- step((generator = generator.apply(thisArg, _arguments || [])).next());
24
- });
25
- };
26
- var __generator = (this && this.__generator) || function (thisArg, body) {
27
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
28
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
- function verb(n) { return function (v) { return step([n, v]); }; }
30
- function step(op) {
31
- if (f) throw new TypeError("Generator is already executing.");
32
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
- 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;
34
- if (y = 0, t) op = [op[0] & 2, t.value];
35
- switch (op[0]) {
36
- case 0: case 1: t = op; break;
37
- case 4: _.label++; return { value: op[1], done: false };
38
- case 5: _.label++; y = op[1]; op = [0]; continue;
39
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
- default:
41
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
- if (t[2]) _.ops.pop();
46
- _.trys.pop(); continue;
47
- }
48
- op = body.call(thisArg, _);
49
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
- }
52
- };
53
- var __read = (this && this.__read) || function (o, n) {
54
- var m = typeof Symbol === "function" && o[Symbol.iterator];
55
- if (!m) return o;
56
- var i = m.call(o), r, ar = [], e;
57
- try {
58
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
59
- }
60
- catch (error) { e = { error: error }; }
61
- finally {
62
- try {
63
- if (r && !r.done && (m = i["return"])) m.call(i);
64
- }
65
- finally { if (e) throw e.error; }
66
- }
67
- return ar;
68
- };
69
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
70
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
71
- if (ar || !(i in from)) {
72
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
73
- ar[i] = from[i];
74
- }
75
- }
76
- return to.concat(ar || Array.prototype.slice.call(from));
77
- };
78
35
  Object.defineProperty(exports, "__esModule", { value: true });
79
36
  exports.OidcInitializationError = void 0;
80
37
  exports.createWellKnownOidcConfigurationEndpointUnreachableInitializationError = createWellKnownOidcConfigurationEndpointUnreachableInitializationError;
81
38
  exports.createIframeTimeoutInitializationError = createIframeTimeoutInitializationError;
82
39
  exports.createFailedToFetchTokenEndpointInitializationError = createFailedToFetchTokenEndpointInitializationError;
83
- var getIsValidRemoteJson_1 = require("../tools/getIsValidRemoteJson");
84
- var parseKeycloakIssuerUri_1 = require("../tools/parseKeycloakIssuerUri");
85
- var OidcInitializationError = /** @class */ (function (_super) {
86
- __extends(OidcInitializationError, _super);
87
- function OidcInitializationError(params) {
88
- var _newTarget = this.constructor;
89
- var _this = _super.call(this, (function () {
40
+ const getIsValidRemoteJson_1 = require("../tools/getIsValidRemoteJson");
41
+ const isKeycloak_1 = require("../keycloak/isKeycloak");
42
+ class OidcInitializationError extends Error {
43
+ constructor(params) {
44
+ super((() => {
90
45
  if (typeof params.messageOrCause === "string") {
91
46
  return params.messageOrCause;
92
47
  }
93
48
  else {
94
- return "Unknown initialization error: ".concat(params.messageOrCause.message);
49
+ return `Unknown initialization error: ${params.messageOrCause.message}`;
95
50
  }
96
51
  })(),
97
52
  // @ts-expect-error
98
- { cause: typeof params.messageOrCause === "string" ? undefined : params.messageOrCause }) || this;
99
- _this.isAuthServerLikelyDown = params.isAuthServerLikelyDown;
100
- Object.setPrototypeOf(_this, _newTarget.prototype);
101
- return _this;
53
+ { cause: typeof params.messageOrCause === "string" ? undefined : params.messageOrCause });
54
+ this.isAuthServerLikelyDown = params.isAuthServerLikelyDown;
55
+ Object.setPrototypeOf(this, new.target.prototype);
102
56
  }
103
- return OidcInitializationError;
104
- }(Error));
57
+ }
105
58
  exports.OidcInitializationError = OidcInitializationError;
106
- function createWellKnownOidcConfigurationEndpointUnreachableInitializationError(params) {
107
- return __awaiter(this, void 0, void 0, function () {
108
- var issuerUri, issuerUri_parsed, WELL_KNOWN_PATH, commonFallbackMessagePart, getCandidateIssuerUri, issuerUri_candidate, isValid, issuerUri_candidate, isValid;
109
- return __generator(this, function (_a) {
110
- switch (_a.label) {
111
- case 0:
112
- issuerUri = params.issuerUri;
113
- issuerUri_parsed = (0, parseKeycloakIssuerUri_1.parseKeycloakIssuerUri)(issuerUri);
114
- WELL_KNOWN_PATH = "/.well-known/openid-configuration";
115
- commonFallbackMessagePart = [
116
- "The OIDC server is either down or the issuerUri you provided is incorrect.",
117
- "You provided the issuerUri: ".concat(issuerUri),
118
- "Endpoint that couldn't be reached: ".concat(issuerUri).concat(WELL_KNOWN_PATH)
119
- ].join("\n");
120
- if (issuerUri_parsed === undefined) {
121
- return [2 /*return*/, new OidcInitializationError({
122
- messageOrCause: [
123
- commonFallbackMessagePart,
124
- "",
125
- "If you happen to be using Keycloak, be aware that the issuerUri you provided doesn't match the expected shape.",
126
- "It should look like: https://<YOUR_KEYCLOAK_DOMAIN><KC_HTTP_RELATIVE_PATH>/realms/<YOUR_REALM>",
127
- "Unless configured otherwise the KC_HTTP_RELATIVE_PATH is '/' by default on recent version of Keycloak."
128
- ].join("\n"),
129
- isAuthServerLikelyDown: true
130
- })];
131
- }
132
- getCandidateIssuerUri = function (params) {
133
- var kcHttpRelativePath = params.kcHttpRelativePath;
134
- return "".concat(issuerUri_parsed.origin).concat(kcHttpRelativePath === undefined ? "" : kcHttpRelativePath, "/realms/").concat(issuerUri_parsed.realm);
135
- };
136
- if (!(issuerUri_parsed.kcHttpRelativePath === undefined)) return [3 /*break*/, 2];
137
- issuerUri_candidate = getCandidateIssuerUri({ kcHttpRelativePath: "/auth" });
138
- return [4 /*yield*/, (0, getIsValidRemoteJson_1.getIsValidRemoteJson)("".concat(issuerUri_candidate).concat(WELL_KNOWN_PATH))];
139
- case 1:
140
- isValid = _a.sent();
141
- if (isValid) {
142
- return [2 /*return*/, new OidcInitializationError({
143
- messageOrCause: [
144
- "Your Keycloak server is configured with KC_HTTP_RELATIVE_PATH=/auth",
145
- "The issuerUri you provided: ".concat(issuerUri),
146
- "The correct issuerUri is: ".concat(issuerUri_candidate),
147
- "(You are missing the /auth portion)"
148
- ].join("\n"),
149
- isAuthServerLikelyDown: false
150
- })];
151
- }
152
- return [3 /*break*/, 4];
153
- case 2:
154
- issuerUri_candidate = getCandidateIssuerUri({ kcHttpRelativePath: undefined });
155
- return [4 /*yield*/, (0, getIsValidRemoteJson_1.getIsValidRemoteJson)("".concat(issuerUri_candidate).concat(WELL_KNOWN_PATH))];
156
- case 3:
157
- isValid = _a.sent();
158
- if (isValid) {
159
- return [2 /*return*/, new OidcInitializationError({
160
- messageOrCause: [
161
- "Your Keycloak server is configured with KC_HTTP_RELATIVE_PATH=/",
162
- "The issuerUri you provided: ".concat(issuerUri),
163
- "The correct issuerUri is: ".concat(issuerUri_candidate),
164
- "(You should remove the ".concat(issuerUri_parsed.kcHttpRelativePath, " portion.)")
165
- ].join("\n"),
166
- isAuthServerLikelyDown: false
167
- })];
168
- }
169
- _a.label = 4;
170
- case 4: return [2 /*return*/, new OidcInitializationError({
171
- messageOrCause: [
172
- commonFallbackMessagePart,
173
- "",
174
- "Given the shape of the issuerUri you provided, it seems that you are using Keycloak.",
175
- "- Make sure the realm '".concat(issuerUri_parsed.realm, "' exists."),
176
- "- Check the KC_HTTP_RELATIVE_PATH that you might have configured your keycloak server with.",
177
- " For example if you have KC_HTTP_RELATIVE_PATH=/xxx the issuerUri should be ".concat(getCandidateIssuerUri({ kcHttpRelativePath: "/xxx" }))
178
- ].join("\n"),
179
- isAuthServerLikelyDown: true
180
- })];
181
- }
59
+ async function createWellKnownOidcConfigurationEndpointUnreachableInitializationError(params) {
60
+ const { issuerUri } = params;
61
+ const WELL_KNOWN_PATH = "/.well-known/openid-configuration";
62
+ const commonFallbackMessagePart = [
63
+ `The OIDC server is either down or the issuerUri you provided is incorrect.`,
64
+ `You provided the issuerUri: ${issuerUri}`,
65
+ `Endpoint that couldn't be reached: ${issuerUri}${WELL_KNOWN_PATH}`
66
+ ].join("\n");
67
+ if (!(0, isKeycloak_1.isKeycloak)({ issuerUri })) {
68
+ return new OidcInitializationError({
69
+ messageOrCause: [
70
+ commonFallbackMessagePart,
71
+ ``,
72
+ `If you happen to be using Keycloak, be aware that the issuerUri you provided doesn't match the expected shape.`,
73
+ `It should look like: https://<YOUR_KEYCLOAK_DOMAIN><KC_HTTP_RELATIVE_PATH>/realms/<YOUR_REALM>`,
74
+ `Unless configured otherwise the KC_HTTP_RELATIVE_PATH is '/' by default on recent version of Keycloak.`
75
+ ].join("\n"),
76
+ isAuthServerLikelyDown: true
182
77
  });
78
+ }
79
+ const keycloakUtils = (await Promise.resolve().then(() => __importStar(require("../keycloak")))).createKeycloakUtils({ issuerUri });
80
+ const getCandidateIssuerUri = (params) => {
81
+ const { kcHttpRelativePath } = params;
82
+ return `${keycloakUtils.issuerUriParsed.origin}${kcHttpRelativePath ?? ""}/realms/${encodeURIComponent(keycloakUtils.issuerUriParsed.realm)}`;
83
+ };
84
+ if (keycloakUtils.issuerUriParsed.kcHttpRelativePath === undefined) {
85
+ const issuerUri_candidate = getCandidateIssuerUri({ kcHttpRelativePath: "/auth" });
86
+ const isValid = await (0, getIsValidRemoteJson_1.getIsValidRemoteJson)(`${issuerUri_candidate}${WELL_KNOWN_PATH}`);
87
+ if (isValid) {
88
+ return new OidcInitializationError({
89
+ messageOrCause: [
90
+ `Your Keycloak server is configured with KC_HTTP_RELATIVE_PATH=/auth`,
91
+ `The issuerUri you provided: ${issuerUri}`,
92
+ `The correct issuerUri is: ${issuerUri_candidate}`,
93
+ `(You are missing the /auth portion)`
94
+ ].join("\n"),
95
+ isAuthServerLikelyDown: false
96
+ });
97
+ }
98
+ }
99
+ else {
100
+ const issuerUri_candidate = getCandidateIssuerUri({ kcHttpRelativePath: undefined });
101
+ const isValid = await (0, getIsValidRemoteJson_1.getIsValidRemoteJson)(`${issuerUri_candidate}${WELL_KNOWN_PATH}`);
102
+ if (isValid) {
103
+ return new OidcInitializationError({
104
+ messageOrCause: [
105
+ `Your Keycloak server is configured with KC_HTTP_RELATIVE_PATH=/`,
106
+ `The issuerUri you provided: ${issuerUri}`,
107
+ `The correct issuerUri is: ${issuerUri_candidate}`,
108
+ `(You should remove the ${keycloakUtils.issuerUriParsed.kcHttpRelativePath} portion.)`
109
+ ].join("\n"),
110
+ isAuthServerLikelyDown: false
111
+ });
112
+ }
113
+ }
114
+ return new OidcInitializationError({
115
+ messageOrCause: [
116
+ commonFallbackMessagePart,
117
+ ``,
118
+ `Given the shape of the issuerUri you provided, it seems that you are using Keycloak.`,
119
+ `- Make sure the realm '${keycloakUtils.issuerUriParsed.realm}' exists.`,
120
+ `- Check the KC_HTTP_RELATIVE_PATH that you might have configured your keycloak server with.`,
121
+ ` For example if you have KC_HTTP_RELATIVE_PATH=/xxx the issuerUri should be ${getCandidateIssuerUri({ kcHttpRelativePath: "/xxx" })}`
122
+ ].join("\n"),
123
+ isAuthServerLikelyDown: true
183
124
  });
184
125
  }
185
- function createIframeTimeoutInitializationError(params) {
186
- return __awaiter(this, void 0, void 0, function () {
187
- var callbackUri, issuerUri, clientId, noIframe, headersOrError, headers_1, key_problem;
188
- return __generator(this, function (_a) {
189
- switch (_a.label) {
190
- case 0:
191
- callbackUri = params.callbackUri, issuerUri = params.issuerUri, clientId = params.clientId, noIframe = params.noIframe;
192
- if (noIframe) {
193
- return [3 /*break*/, 2];
194
- }
195
- return [4 /*yield*/, fetch(callbackUri).then(function (response) {
196
- if (!response.ok) {
197
- return new Error("".concat(callbackUri, " responded with a ").concat(response.status, " status code."));
198
- }
199
- return {
200
- "Content-Security-Policy": response.headers.get("Content-Security-Policy"),
201
- "X-Frame-Options": response.headers.get("X-Frame-Options")
202
- };
203
- }, function (error) { return error; })];
204
- case 1:
205
- headersOrError = _a.sent();
206
- if (headersOrError instanceof Error) {
207
- return [2 /*return*/, new OidcInitializationError({
208
- isAuthServerLikelyDown: false,
209
- messageOrCause: new Error("Unexpected error while trying to diagnose why the silent sign-in process timed out.",
210
- // @ts-expect-error
211
- { cause: cspOrError })
212
- })];
213
- }
214
- headers_1 = headersOrError;
215
- key_problem = (function () {
216
- block: {
217
- var key = "Content-Security-Policy";
218
- var header = headers_1[key];
219
- if (header === null) {
220
- break block;
221
- }
222
- var hasFrameAncestorsNone = header
223
- .replace(/["']/g, "")
224
- .replace(/\s+/g, " ")
225
- .toLowerCase()
226
- .includes("frame-ancestors none");
227
- if (!hasFrameAncestorsNone) {
228
- break block;
229
- }
230
- return key;
231
- }
232
- block: {
233
- var key = "X-Frame-Options";
234
- var header = headers_1[key];
235
- if (header === null) {
236
- break block;
237
- }
238
- var hasFrameAncestorsNone = header.toLowerCase().includes("deny");
239
- if (!hasFrameAncestorsNone) {
240
- break block;
241
- }
242
- return key;
243
- }
244
- return undefined;
245
- })();
246
- if (key_problem === undefined) {
247
- return [3 /*break*/, 2];
248
- }
249
- return [2 /*return*/, new OidcInitializationError({
250
- isAuthServerLikelyDown: false,
251
- messageOrCause: [
252
- "".concat(callbackUri, " is currently served by your web server with the HTTP header `").concat(key_problem, ": ").concat(headers_1[key_problem], "`.\n"),
253
- "This header prevents the silent sign-in process from working.\n",
254
- "Refer to this documentation page to fix this issue: https://docs.oidc-spa.dev/v/v7/resources/iframe-related-issues"
255
- ].join(" ")
256
- })];
257
- case 2:
258
- // Here we know that the server is not down and that the issuer_uri is correct
259
- // otherwise we would have had a fetch error earlier on the well-known endpoint.
260
- // So this means that it's very likely a OIDC client misconfiguration.
261
- // It could also be a very slow network but this risk is mitigated by the fact that we check
262
- // for the network speed to adjust the timeout delay.
263
- return [2 /*return*/, new OidcInitializationError({
264
- isAuthServerLikelyDown: false,
265
- messageOrCause: __spreadArray(__spreadArray([
266
- "The silent sign-in process timed out.\n",
267
- "Based on the diagnostic performed by oidc-spa the more likely causes are:\n",
268
- "- Either the client ID \"".concat(clientId, "\" does not exist, or\n"),
269
- "- You forgot to add the OIDC callback URL to the list of Valid Redirect URIs.\n",
270
- "Client ID: \"".concat(clientId, "\"\n"),
271
- "Callback URL to add to the list of Valid Redirect URIs: \"".concat(callbackUri, "\"\n\n")
272
- ], __read((function () {
273
- var kc = (0, parseKeycloakIssuerUri_1.parseKeycloakIssuerUri)(issuerUri);
274
- if (!kc) {
275
- return [
276
- "Check the documentation of your OIDC server to learn how to configure the public client (Authorization Code Flow + PKCE) properly."
277
- ];
278
- }
279
- return [
280
- "It seems you are using Keycloak. Follow these steps to resolve the issue:\n\n",
281
- "1. Go to the Keycloak admin console: ".concat(kc.adminConsoleUrl_master, "\n"),
282
- "2. Log in as an admin user.\n",
283
- "3. In the top left corner select the realm \"".concat(kc.realm, "\".\n"),
284
- "4. In the left menu, click on \"Clients\".\n",
285
- "5. Locate the client \"".concat(clientId, "\" in the list and click on it.\n"),
286
- "6. Find \"Valid Redirect URIs\" and add \"".concat(callbackUri, "\" to the list.\n"),
287
- "7. Save the changes.\n\n",
288
- "For more information, refer to the documentation: https://docs.oidc-spa.dev/v/v7/providers-configuration/keycloak"
289
- ];
290
- })()), false), [
291
- "\n\n",
292
- "If nothing works, you can try disabling the use of iframe: https://docs.oidc-spa.dev/resources/iframe-related-issues\n",
293
- "with some OIDC provider it might solve the issue."
294
- ], false).join(" ")
295
- })];
126
+ async function createIframeTimeoutInitializationError(params) {
127
+ const { redirectUri, issuerUri, clientId, noIframe } = params;
128
+ iframe_blocked: {
129
+ if (noIframe) {
130
+ break iframe_blocked;
131
+ }
132
+ const headersOrError = await fetch(redirectUri).then(response => {
133
+ if (!response.ok) {
134
+ return new Error(`${redirectUri} responded with a ${response.status} status code.`);
135
+ }
136
+ return {
137
+ "Content-Security-Policy": response.headers.get("Content-Security-Policy"),
138
+ "X-Frame-Options": response.headers.get("X-Frame-Options")
139
+ };
140
+ }, (error) => error);
141
+ if (headersOrError instanceof Error) {
142
+ return new OidcInitializationError({
143
+ isAuthServerLikelyDown: false,
144
+ messageOrCause: new Error(`Unexpected error while trying to diagnose why the silent sign-in process timed out.`,
145
+ // @ts-expect-error
146
+ { cause: cspOrError })
147
+ });
148
+ }
149
+ const headers = headersOrError;
150
+ let key_problem = (() => {
151
+ block: {
152
+ const key = "Content-Security-Policy";
153
+ const header = headers[key];
154
+ if (header === null) {
155
+ break block;
156
+ }
157
+ const hasFrameAncestorsNone = header
158
+ .replace(/["']/g, "")
159
+ .replace(/\s+/g, " ")
160
+ .toLowerCase()
161
+ .includes("frame-ancestors none");
162
+ if (!hasFrameAncestorsNone) {
163
+ break block;
164
+ }
165
+ return key;
166
+ }
167
+ block: {
168
+ const key = "X-Frame-Options";
169
+ const header = headers[key];
170
+ if (header === null) {
171
+ break block;
172
+ }
173
+ const hasFrameAncestorsNone = header.toLowerCase().includes("deny");
174
+ if (!hasFrameAncestorsNone) {
175
+ break block;
176
+ }
177
+ return key;
296
178
  }
179
+ return undefined;
180
+ })();
181
+ if (key_problem === undefined) {
182
+ break iframe_blocked;
183
+ }
184
+ return new OidcInitializationError({
185
+ isAuthServerLikelyDown: false,
186
+ messageOrCause: [
187
+ `${redirectUri} is currently served by your web server with the HTTP header \`${key_problem}: ${headers[key_problem]}\`.\n`,
188
+ "This header prevents the silent sign-in process from working.\n",
189
+ "Refer to this documentation page to fix this issue: https://docs.oidc-spa.dev/v/v7/resources/iframe-related-issues"
190
+ ].join(" ")
297
191
  });
192
+ }
193
+ // Here we know that the server is not down and that the issuer_uri is correct
194
+ // otherwise we would have had a fetch error earlier on the well-known endpoint.
195
+ // So this means that it's very likely a OIDC client misconfiguration.
196
+ // It could also be a very slow network but this risk is mitigated by the fact that we check
197
+ // for the network speed to adjust the timeout delay.
198
+ return new OidcInitializationError({
199
+ isAuthServerLikelyDown: false,
200
+ messageOrCause: [
201
+ `The silent sign-in process timed out.\n`,
202
+ `Based on the diagnostic performed by oidc-spa the more likely causes are:\n`,
203
+ `- Either the client ID "${clientId}" does not exist, or\n`,
204
+ `- You forgot to add the OIDC callback URL to the list of Valid Redirect URIs.\n`,
205
+ `Client ID: "${clientId}"\n`,
206
+ `Callback URL to add to the list of Valid Redirect URIs: "${redirectUri}"\n\n`,
207
+ ...(await (async () => {
208
+ if (!(0, isKeycloak_1.isKeycloak)({ issuerUri })) {
209
+ return [
210
+ "Check the documentation of your OIDC server to learn how to configure the public client (Authorization Code Flow + PKCE) properly."
211
+ ];
212
+ }
213
+ const kc = (await Promise.resolve().then(() => __importStar(require("../keycloak")))).createKeycloakUtils({ issuerUri });
214
+ return [
215
+ `It seems you are using Keycloak. Follow these steps to resolve the issue:\n\n`,
216
+ `1. Go to the Keycloak admin console: ${kc.adminConsoleUrl_master}\n`,
217
+ `2. Log in as an admin user.\n`,
218
+ `3. In the top left corner select the realm "${kc.issuerUriParsed.realm}".\n`,
219
+ `4. In the left menu, click on "Clients".\n`,
220
+ `5. Locate the client "${clientId}" in the list and click on it.\n`,
221
+ `6. Find "Valid Redirect URIs" and add "${redirectUri}" to the list.\n`,
222
+ `7. Save the changes.\n\n`,
223
+ `For more information, refer to the documentation: https://docs.oidc-spa.dev/v/v7/providers-configuration/keycloak`
224
+ ];
225
+ })()),
226
+ "\n\n",
227
+ "If nothing works, you can try disabling the use of iframe: https://docs.oidc-spa.dev/resources/iframe-related-issues\n",
228
+ "with some OIDC provider it might solve the issue."
229
+ ].join(" ")
298
230
  });
299
231
  }
300
- function createFailedToFetchTokenEndpointInitializationError(params) {
301
- var issuerUri = params.issuerUri, clientId = params.clientId;
232
+ async function createFailedToFetchTokenEndpointInitializationError(params) {
233
+ const { issuerUri, clientId } = params;
302
234
  return new OidcInitializationError({
303
235
  isAuthServerLikelyDown: false,
304
- messageOrCause: __spreadArray([
236
+ messageOrCause: [
305
237
  "Failed to fetch the token endpoint.\n",
306
238
  "This is usually due to a CORS issue.\n",
307
- "Make sure you have added '".concat(window.location.origin, "' to the list of Web Origins"),
308
- "in the '".concat(clientId, "' client configuration of your OIDC server.\n"),
309
- "\n"
310
- ], __read((function () {
311
- var kc = (0, parseKeycloakIssuerUri_1.parseKeycloakIssuerUri)(issuerUri);
312
- if (kc === undefined) {
239
+ `Make sure you have added '${window.location.origin}' to the list of Web Origins`,
240
+ `in the '${clientId}' client configuration of your OIDC server.\n`,
241
+ "\n",
242
+ ...(await (async () => {
243
+ if (!(0, isKeycloak_1.isKeycloak)({ issuerUri })) {
244
+ return [
245
+ "Check the documentation of your OIDC server to learn how to configure the public client (Authorization Code Flow + PKCE) properly."
246
+ ];
247
+ }
248
+ const kc = (await Promise.resolve().then(() => __importStar(require("../keycloak")))).createKeycloakUtils({ issuerUri });
313
249
  return [
314
- "Check the documentation of your OIDC server to learn how to configure the public client (Authorization Code Flow + PKCE) properly."
250
+ `Since it seems that you are using Keycloak, here are the steps to follow:\n`,
251
+ `1. Go to the Keycloak admin console: ${kc.adminConsoleUrl_master}\n`,
252
+ `2. Log in as an admin user.\n`,
253
+ `3. In the top left corner select the realm "${kc.issuerUriParsed.realm}".\n`,
254
+ `4. In the left menu, click on "Clients".\n`,
255
+ `5. Find '${clientId}' in the list of clients and click on it.\n`,
256
+ `6. Find 'Web Origins' and add '${window.location.origin}' to the list.\n`,
257
+ `7. Save the changes.\n\n`,
258
+ `More info: https://docs.oidc-spa.dev/v/v7/providers-configuration/keycloak`
315
259
  ];
316
- }
317
- return [
318
- "Since it seems that you are using Keycloak, here are the steps to follow:\n",
319
- "1. Go to the Keycloak admin console: ".concat(kc.adminConsoleUrl_master, "\n"),
320
- "2. Log in as an admin user.\n",
321
- "3. In the top left corner select the realm \"".concat(kc.realm, "\".\n"),
322
- "4. In the left menu, click on \"Clients\".\n",
323
- "5. Find '".concat(clientId, "' in the list of clients and click on it.\n"),
324
- "6. Find 'Web Origins' and add '".concat(window.location.origin, "' to the list.\n"),
325
- "7. Save the changes.\n\n",
326
- "More info: https://docs.oidc-spa.dev/v/v7/providers-configuration/keycloak"
327
- ];
328
- })()), false).join(" ")
260
+ })())
261
+ ].join(" ")
329
262
  });
330
263
  }
331
264
  //# sourceMappingURL=OidcInitializationError.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OidcInitializationError.js","sourceRoot":"","sources":["../src/core/OidcInitializationError.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,wJAmFC;AAED,wFA0IC;AAED,kHAqCC;AA7RD,sE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Q,+CAA+C;YAClE,IAAI;YACJ,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE;gBAClB,IAAI,CAAC,IAAA,uBAAU,EAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;oBAC7B,OAAO;wBACH,oIAAoI;qBACvI,CAAC;gBACN,CAAC;gBAED,MAAM,EAAE,GAAG,CAAC,wDAAa,aAAa,GAAC,CAAC,CAAC,mBAAmB,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC;gBAE5E,OAAO;oBACH,6EAA6E;oBAC7E,wCAAwC,EAAE,CAAC,sBAAsB,IAAI;oBACrE,+BAA+B;oBAC/B,+CAA+C,EAAE,CAAC,eAAe,CAAC,KAAK,MAAM;oBAC7E,4CAA4C;oBAC5C,YAAY,QAAQ,6CAA6C;oBACjE,kCAAkC,MAAM,CAAC,QAAQ,CAAC,MAAM,kBAAkB;oBAC1E,0BAA0B;oBAC1B,4EAA4E;iBAC/E,CAAC;YACN,CAAC,CAAC,EAAE,CAAC;SACR,CAAC,IAAI,CAAC,GAAG,CAAC;KACd,CAAC,CAAC;AACP,CAAC"}
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var tsafe_1 = require("../vendor/frontend/tsafe");
3
+ const tsafe_1 = require("../vendor/frontend/tsafe");
4
4
  tsafe_1.assert;
5
5
  //# sourceMappingURL=OidcMetadata.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OidcMetadata.js","sourceRoot":"","sources":["../src/core/OidcMetadata.ts"],"names":[],"mappings":";;AACA,kDAA+D;AA6Q/D,cAAsD,CAAC"}
1
+ {"version":3,"file":"OidcMetadata.js","sourceRoot":"","sources":["../src/core/OidcMetadata.ts"],"names":[],"mappings":";;AACA,oDAA+D;AA6Q/D,cAAsD,CAAC"}