@multiplatform.one/keycloak 0.0.6 → 0.0.8

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 (61) hide show
  1. package/esm/hooks/useKeycloak/index.js +1 -1
  2. package/esm/hooks/useKeycloak/index.js.map +1 -1
  3. package/esm/hooks/useKeycloak/useKeycloak.native.js +4 -4
  4. package/esm/hooks/useKeycloak/useKeycloak.native.js.map +1 -1
  5. package/esm/provider/keycloakProvider.native.js +1 -1
  6. package/esm/provider/keycloakProvider.native.js.map +1 -1
  7. package/lib/hooks/useKeycloak/index.d.ts +1 -1
  8. package/lib/hooks/useKeycloak/index.js.map +1 -1
  9. package/lib/hooks/useKeycloak/useKeycloak.native.d.ts +2 -4
  10. package/lib/hooks/useKeycloak/useKeycloak.native.js +10 -7
  11. package/lib/hooks/useKeycloak/useKeycloak.native.js.map +1 -1
  12. package/lib/provider/keycloakProvider.native.js +5 -5
  13. package/lib/provider/keycloakProvider.native.js.map +1 -1
  14. package/lib/tsconfig.build.tsbuildinfo +1 -1
  15. package/package.json +13 -7
  16. package/{esm/expo/index.js → src/@types/coreJsPure.d.ts} +12 -7
  17. package/src/{expo/index.ts → @types/expoKeycloakAuth.d.ts} +7 -6
  18. package/src/hooks/useKeycloak/index.ts +1 -1
  19. package/src/hooks/useKeycloak/useKeycloak.native.ts +6 -6
  20. package/src/provider/keycloakProvider.native.tsx +1 -1
  21. package/esm/expo/ExpoKeycloakContext.js +0 -28
  22. package/esm/expo/ExpoKeycloakContext.js.map +0 -1
  23. package/esm/expo/ExpoKeycloakProvider.js +0 -113
  24. package/esm/expo/ExpoKeycloakProvider.js.map +0 -1
  25. package/esm/expo/const.js +0 -42
  26. package/esm/expo/const.js.map +0 -1
  27. package/esm/expo/helpers.js +0 -56
  28. package/esm/expo/helpers.js.map +0 -1
  29. package/esm/expo/index.js.map +0 -1
  30. package/esm/expo/useExpoKeycloak.js +0 -44
  31. package/esm/expo/useExpoKeycloak.js.map +0 -1
  32. package/esm/expo/useTokenStorage.js +0 -153
  33. package/esm/expo/useTokenStorage.js.map +0 -1
  34. package/lib/expo/ExpoKeycloakContext.d.ts +0 -32
  35. package/lib/expo/ExpoKeycloakContext.js +0 -47
  36. package/lib/expo/ExpoKeycloakContext.js.map +0 -1
  37. package/lib/expo/ExpoKeycloakProvider.d.ts +0 -37
  38. package/lib/expo/ExpoKeycloakProvider.js +0 -130
  39. package/lib/expo/ExpoKeycloakProvider.js.map +0 -1
  40. package/lib/expo/const.d.ts +0 -33
  41. package/lib/expo/const.js +0 -66
  42. package/lib/expo/const.js.map +0 -1
  43. package/lib/expo/helpers.d.ts +0 -41
  44. package/lib/expo/helpers.js +0 -77
  45. package/lib/expo/helpers.js.map +0 -1
  46. package/lib/expo/index.d.ts +0 -26
  47. package/lib/expo/index.js +0 -50
  48. package/lib/expo/index.js.map +0 -1
  49. package/lib/expo/useExpoKeycloak.d.ts +0 -31
  50. package/lib/expo/useExpoKeycloak.js +0 -62
  51. package/lib/expo/useExpoKeycloak.js.map +0 -1
  52. package/lib/expo/useTokenStorage.d.ts +0 -36
  53. package/lib/expo/useTokenStorage.js +0 -166
  54. package/lib/expo/useTokenStorage.js.map +0 -1
  55. package/src/expo/ExpoKeycloakContext.ts +0 -41
  56. package/src/expo/ExpoKeycloakProvider.tsx +0 -139
  57. package/src/expo/NOTES +0 -1
  58. package/src/expo/const.ts +0 -42
  59. package/src/expo/helpers.ts +0 -74
  60. package/src/expo/useExpoKeycloak.ts +0 -44
  61. package/src/expo/useTokenStorage.ts +0 -168
@@ -1,130 +0,0 @@
1
- (function (global, factory) {
2
- if (typeof define === "function" && define.amd) {
3
- define(["exports", "react", "react-native", "expo-auth-session", "./ExpoKeycloakContext", "./useTokenStorage", "./helpers", "./const"], factory);
4
- } else if (typeof exports !== "undefined") {
5
- factory(exports, require("react"), require("react-native"), require("expo-auth-session"), require("./ExpoKeycloakContext"), require("./useTokenStorage"), require("./helpers"), require("./const"));
6
- } else {
7
- var mod = {
8
- exports: {}
9
- };
10
- factory(mod.exports, global.react, global.reactNative, global.expoAuthSession, global.ExpoKeycloakContext, global.useTokenStorage, global.helpers, global._const);
11
- global.ExpoKeycloakProvider = mod.exports;
12
- }
13
- })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _react, _reactNative, AuthSession, _ExpoKeycloakContext, _useTokenStorage, _helpers, _const) {
14
- "use strict";
15
-
16
- Object.defineProperty(_exports, "__esModule", {
17
- value: true
18
- });
19
- _exports.ExpoKeycloakProvider = void 0;
20
- _react = _interopRequireWildcard(_react);
21
- AuthSession = _interopRequireWildcard(AuthSession);
22
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
24
- /**
25
- * File: /src/expo/KeycloakProvider.ts
26
- * Project: @multiplatform.one/keycloak
27
- * File Created: 26-11-2022 06:58:16
28
- * Author: Clay Risser
29
- * -----
30
- * Last Modified: 26-11-2022 08:06:40
31
- * Modified By: Clay Risser
32
- * -----
33
- * Risser Labs LLC (c) Copyright 2022
34
- *
35
- * Licensed under the Apache License, Version 2.0 (the "License");
36
- * you may not use this file except in compliance with the License.
37
- * You may obtain a copy of the License at
38
- *
39
- * http://www.apache.org/licenses/LICENSE-2.0
40
- *
41
- * Unless required by applicable law or agreed to in writing, software
42
- * distributed under the License is distributed on an "AS IS" BASIS,
43
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
44
- * See the License for the specific language governing permissions and
45
- * limitations under the License.
46
- */
47
-
48
- const ExpoKeycloakProvider = _ref => {
49
- let {
50
- realm,
51
- clientId,
52
- url,
53
- extraParams,
54
- children,
55
- ...options
56
- } = _ref;
57
- const discovery = (0, AuthSession.useAutoDiscovery)((0, _helpers.getRealmURL)({
58
- realm,
59
- url
60
- }));
61
- const redirectUri = AuthSession.makeRedirectUri({
62
- native: `${options.scheme ?? "exp"}://${options.nativeRedirectPath ?? _const.NATIVE_REDIRECT_PATH}`,
63
- useProxy: !options.scheme
64
- });
65
- const config = {
66
- clientId,
67
- extraParams,
68
- realm,
69
- redirectUri,
70
- url
71
- };
72
- const [request, response, promptAsync] = (0, AuthSession.useAuthRequest)({
73
- usePKCE: false,
74
- ...config
75
- }, discovery);
76
- const [currentToken, updateToken] = (0, _useTokenStorage.useTokenStorage)(options, config, discovery);
77
- const handleLogin = (0, _react.useCallback)(function () {
78
- let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
79
- return promptAsync(options);
80
- }, [request]);
81
- function handleLogout() {
82
- if (!currentToken) throw new Error("Not logged in.");
83
- try {
84
- if (discovery !== null && discovery !== void 0 && discovery.revocationEndpoint) {
85
- AuthSession.revokeAsync({
86
- token: currentToken === null || currentToken === void 0 ? void 0 : currentToken.accessToken,
87
- ...config
88
- }, discovery);
89
- }
90
- if (discovery !== null && discovery !== void 0 && discovery.endSessionEndpoint) {
91
- fetch(`${discovery.endSessionEndpoint}`, {
92
- method: "POST",
93
- headers: {
94
- "Content-Type": "application/x-www-form-urlencoded"
95
- },
96
- body: `client_id=${clientId}&refresh_token=${currentToken.refreshToken}`
97
- });
98
- }
99
- if (_reactNative.Platform.OS === "ios") {
100
- AuthSession.dismiss();
101
- }
102
- } catch (error) {
103
- console.log(error);
104
- }
105
- updateToken(null);
106
- return undefined;
107
- }
108
- (0, _react.useEffect)(() => {
109
- if (response) {
110
- (0, _helpers.handleTokenExchange)({
111
- response,
112
- discovery: discovery,
113
- config
114
- }).then(updateToken);
115
- }
116
- }, [response]);
117
- return /*#__PURE__*/_react.default.createElement(_ExpoKeycloakContext.ExpoKeycloakContext.Provider, {
118
- // eslint-disable-next-line react/jsx-no-constructed-context-values
119
- value: {
120
- isLoggedIn: currentToken === undefined ? undefined : !!currentToken,
121
- login: handleLogin,
122
- logout: handleLogout,
123
- ready: discovery !== null && request !== null && currentToken !== undefined,
124
- token: currentToken
125
- }
126
- }, children);
127
- };
128
- _exports.ExpoKeycloakProvider = ExpoKeycloakProvider;
129
- });
130
- //# sourceMappingURL=ExpoKeycloakProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExpoKeycloakProvider.js","names":["ExpoKeycloakProvider","realm","clientId","url","extraParams","children","options","discovery","useAutoDiscovery","getRealmURL","redirectUri","AuthSession","makeRedirectUri","native","scheme","nativeRedirectPath","NATIVE_REDIRECT_PATH","useProxy","config","request","response","promptAsync","useAuthRequest","usePKCE","currentToken","updateToken","useTokenStorage","handleLogin","useCallback","handleLogout","Error","revocationEndpoint","revokeAsync","token","accessToken","endSessionEndpoint","fetch","method","headers","body","refreshToken","Platform","OS","dismiss","error","console","log","undefined","useEffect","handleTokenExchange","then","isLoggedIn","login","logout","ready"],"sources":["../../src/expo/ExpoKeycloakProvider.tsx"],"sourcesContent":["/**\n * File: /src/expo/KeycloakProvider.ts\n * Project: @multiplatform.one/keycloak\n * File Created: 26-11-2022 06:58:16\n * Author: Clay Risser\n * -----\n * Last Modified: 26-11-2022 08:06:40\n * Modified By: Clay Risser\n * -----\n * Risser Labs LLC (c) Copyright 2022\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { ReactNode, useCallback, useEffect } from \"react\";\nimport { Platform } from \"react-native\";\nimport * as AuthSession from \"expo-auth-session\";\nimport {\n useAuthRequest,\n useAutoDiscovery,\n AuthRequestConfig,\n} from \"expo-auth-session\";\nimport { ExpoKeycloakContext } from \"./ExpoKeycloakContext\";\nimport { useTokenStorage } from \"./useTokenStorage\";\nimport { handleTokenExchange, getRealmURL } from \"./helpers\";\nimport { NATIVE_REDIRECT_PATH } from \"./const\";\n\nexport interface IKeycloakConfiguration extends Partial<AuthRequestConfig> {\n children: ReactNode;\n clientId: string;\n disableAutoRefresh?: boolean;\n nativeRedirectPath?: string;\n realm: string;\n refreshTimeBuffer?: number;\n scheme?: string;\n tokenStorageKey?: string;\n url: string;\n}\n\nexport const ExpoKeycloakProvider = ({\n realm,\n clientId,\n url,\n extraParams,\n children,\n ...options\n}: IKeycloakConfiguration) => {\n const discovery = useAutoDiscovery(getRealmURL({ realm, url }));\n const redirectUri = AuthSession.makeRedirectUri({\n native: `${options.scheme ?? \"exp\"}://${\n options.nativeRedirectPath ?? NATIVE_REDIRECT_PATH\n }`,\n useProxy: !options.scheme,\n });\n const config = {\n clientId,\n extraParams,\n realm,\n redirectUri,\n url,\n };\n const [request, response, promptAsync] = useAuthRequest(\n { usePKCE: false, ...config },\n discovery\n );\n const [currentToken, updateToken] = useTokenStorage(\n options,\n config,\n discovery!\n );\n\n const handleLogin = useCallback(\n (options: AuthSession.AuthRequestPromptOptions = {}) =>\n promptAsync(options),\n [request]\n );\n\n function handleLogout() {\n if (!currentToken) throw new Error(\"Not logged in.\");\n try {\n if (discovery?.revocationEndpoint) {\n AuthSession.revokeAsync(\n { token: currentToken?.accessToken, ...config },\n discovery\n );\n }\n if (discovery?.endSessionEndpoint) {\n fetch(`${discovery.endSessionEndpoint}`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n },\n body: `client_id=${clientId}&refresh_token=${currentToken.refreshToken}`,\n });\n }\n if (Platform.OS === \"ios\") {\n AuthSession.dismiss();\n }\n } catch (error) {\n console.log(error);\n }\n updateToken(null);\n return undefined;\n }\n\n useEffect(() => {\n if (response) {\n handleTokenExchange({ response, discovery: discovery!, config }).then(\n updateToken\n );\n }\n }, [response]);\n\n return (\n <ExpoKeycloakContext.Provider\n // eslint-disable-next-line react/jsx-no-constructed-context-values\n value={{\n isLoggedIn: currentToken === undefined ? undefined : !!currentToken,\n login: handleLogin,\n logout: handleLogout,\n ready:\n discovery !== null && request !== null && currentToken !== undefined,\n token: currentToken,\n }}\n >\n {children}\n </ExpoKeycloakContext.Provider>\n );\n};\n"],"mappings":"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"}
@@ -1,33 +0,0 @@
1
- /**
2
- * File: /src/expo/const.ts
3
- * Project: @multiplatform.one/keycloak
4
- * File Created: 26-11-2022 06:58:16
5
- * Author: Clay Risser
6
- * -----
7
- * Last Modified: 26-11-2022 08:17:10
8
- * Modified By: Clay Risser
9
- * -----
10
- * Risser Labs LLC (c) Copyright 2022
11
- *
12
- * Licensed under the Apache License, Version 2.0 (the "License");
13
- * you may not use this file except in compliance with the License.
14
- * You may obtain a copy of the License at
15
- *
16
- * http://www.apache.org/licenses/LICENSE-2.0
17
- *
18
- * Unless required by applicable law or agreed to in writing, software
19
- * distributed under the License is distributed on an "AS IS" BASIS,
20
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21
- * See the License for the specific language governing permissions and
22
- * limitations under the License.
23
- */
24
- export declare const KC_INITIAL_VALUE: {
25
- ready: boolean;
26
- isLoggedIn: boolean;
27
- login: () => Promise<undefined>;
28
- logout: () => undefined;
29
- token: null;
30
- };
31
- export declare const NATIVE_REDIRECT_PATH = "auth/redirect";
32
- export declare const TOKEN_STORAGE_KEY = "keycloak_token";
33
- export declare const REFRESH_TIME_BUFFER = 20;
package/lib/expo/const.js DELETED
@@ -1,66 +0,0 @@
1
- (function (global, factory) {
2
- if (typeof define === "function" && define.amd) {
3
- define(["exports"], factory);
4
- } else if (typeof exports !== "undefined") {
5
- factory(exports);
6
- } else {
7
- var mod = {
8
- exports: {}
9
- };
10
- factory(mod.exports);
11
- global._const = mod.exports;
12
- }
13
- })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports) {
14
- "use strict";
15
-
16
- Object.defineProperty(_exports, "__esModule", {
17
- value: true
18
- });
19
- _exports.TOKEN_STORAGE_KEY = _exports.REFRESH_TIME_BUFFER = _exports.NATIVE_REDIRECT_PATH = _exports.KC_INITIAL_VALUE = void 0;
20
- /**
21
- * File: /src/expo/const.ts
22
- * Project: @multiplatform.one/keycloak
23
- * File Created: 26-11-2022 06:58:16
24
- * Author: Clay Risser
25
- * -----
26
- * Last Modified: 26-11-2022 08:17:10
27
- * Modified By: Clay Risser
28
- * -----
29
- * Risser Labs LLC (c) Copyright 2022
30
- *
31
- * Licensed under the Apache License, Version 2.0 (the "License");
32
- * you may not use this file except in compliance with the License.
33
- * You may obtain a copy of the License at
34
- *
35
- * http://www.apache.org/licenses/LICENSE-2.0
36
- *
37
- * Unless required by applicable law or agreed to in writing, software
38
- * distributed under the License is distributed on an "AS IS" BASIS,
39
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
40
- * See the License for the specific language governing permissions and
41
- * limitations under the License.
42
- */
43
-
44
- const logger = console;
45
- const KC_INITIAL_VALUE = {
46
- ready: false,
47
- isLoggedIn: false,
48
- login: async () => {
49
- logger.error("kc not initialized");
50
- return undefined;
51
- },
52
- logout: () => {
53
- logger.error("not logged in");
54
- return undefined;
55
- },
56
- token: null
57
- };
58
- _exports.KC_INITIAL_VALUE = KC_INITIAL_VALUE;
59
- const NATIVE_REDIRECT_PATH = "auth/redirect";
60
- _exports.NATIVE_REDIRECT_PATH = NATIVE_REDIRECT_PATH;
61
- const TOKEN_STORAGE_KEY = "keycloak_token";
62
- _exports.TOKEN_STORAGE_KEY = TOKEN_STORAGE_KEY;
63
- const REFRESH_TIME_BUFFER = 20;
64
- _exports.REFRESH_TIME_BUFFER = REFRESH_TIME_BUFFER;
65
- });
66
- //# sourceMappingURL=const.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"const.js","names":["logger","console","KC_INITIAL_VALUE","ready","isLoggedIn","login","error","undefined","logout","token","NATIVE_REDIRECT_PATH","TOKEN_STORAGE_KEY","REFRESH_TIME_BUFFER"],"sources":["../../src/expo/const.ts"],"sourcesContent":["/**\n * File: /src/expo/const.ts\n * Project: @multiplatform.one/keycloak\n * File Created: 26-11-2022 06:58:16\n * Author: Clay Risser\n * -----\n * Last Modified: 26-11-2022 08:17:10\n * Modified By: Clay Risser\n * -----\n * Risser Labs LLC (c) Copyright 2022\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst logger = console;\n\nexport const KC_INITIAL_VALUE = {\n ready: false,\n isLoggedIn: false,\n login: async () => {\n logger.error(\"kc not initialized\");\n return undefined;\n },\n logout: () => {\n logger.error(\"not logged in\");\n return undefined;\n },\n token: null,\n};\nexport const NATIVE_REDIRECT_PATH = \"auth/redirect\";\nexport const TOKEN_STORAGE_KEY = \"keycloak_token\";\nexport const REFRESH_TIME_BUFFER = 20;\n"],"mappings":";;;;;;;;;;;;;;;;;;;EAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;EAEA,MAAMA,MAAM,GAAGC,OAAO;EAEf,MAAMC,gBAAgB,GAAG;IAC9BC,KAAK,EAAE,KAAK;IACZC,UAAU,EAAE,KAAK;IACjBC,KAAK,EAAE,YAAY;MACjBL,MAAM,CAACM,KAAK,CAAC,oBAAoB,CAAC;MAClC,OAAOC,SAAS;IAClB,CAAC;IACDC,MAAM,EAAE,MAAM;MACZR,MAAM,CAACM,KAAK,CAAC,eAAe,CAAC;MAC7B,OAAOC,SAAS;IAClB,CAAC;IACDE,KAAK,EAAE;EACT,CAAC;EAAC;EACK,MAAMC,oBAAoB,GAAG,eAAe;EAAC;EAC7C,MAAMC,iBAAiB,GAAG,gBAAgB;EAAC;EAC3C,MAAMC,mBAAmB,GAAG,EAAE;EAAC;AAAA"}
@@ -1,41 +0,0 @@
1
- /**
2
- * File: /src/expo/helpers.ts
3
- * Project: @multiplatform.one/keycloak
4
- * File Created: 26-11-2022 06:58:16
5
- * Author: Clay Risser
6
- * -----
7
- * Last Modified: 26-11-2022 08:11:15
8
- * Modified By: Clay Risser
9
- * -----
10
- * Risser Labs LLC (c) Copyright 2022
11
- *
12
- * Licensed under the Apache License, Version 2.0 (the "License");
13
- * you may not use this file except in compliance with the License.
14
- * You may obtain a copy of the License at
15
- *
16
- * http://www.apache.org/licenses/LICENSE-2.0
17
- *
18
- * Unless required by applicable law or agreed to in writing, software
19
- * distributed under the License is distributed on an "AS IS" BASIS,
20
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21
- * See the License for the specific language governing permissions and
22
- * limitations under the License.
23
- */
24
- import { AccessTokenRequestConfig, DiscoveryDocument, AuthSessionResult } from "expo-auth-session";
25
- export declare function getRealmURL(config: RealmURLConfig): string;
26
- export declare function getCurrentTimeInSeconds(): number;
27
- export declare function handleTokenExchange({ response, discovery, config, }: TokenExchange): Promise<import("expo-auth-session").TokenResponse | null>;
28
- export interface TokenExchange {
29
- response: AuthSessionResult;
30
- discovery: Pick<DiscoveryDocument, "tokenEndpoint">;
31
- config: Omit<AccessTokenRequestConfig, "code"> & {
32
- code?: string;
33
- };
34
- }
35
- export interface TokenExchangeDiscovery {
36
- tokenEndpoint?: string;
37
- }
38
- export interface RealmURLConfig {
39
- realm: string;
40
- url: string;
41
- }
@@ -1,77 +0,0 @@
1
- (function (global, factory) {
2
- if (typeof define === "function" && define.amd) {
3
- define(["exports", "expo-auth-session"], factory);
4
- } else if (typeof exports !== "undefined") {
5
- factory(exports, require("expo-auth-session"));
6
- } else {
7
- var mod = {
8
- exports: {}
9
- };
10
- factory(mod.exports, global.expoAuthSession);
11
- global.helpers = mod.exports;
12
- }
13
- })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _expoAuthSession) {
14
- "use strict";
15
-
16
- Object.defineProperty(_exports, "__esModule", {
17
- value: true
18
- });
19
- _exports.getCurrentTimeInSeconds = getCurrentTimeInSeconds;
20
- _exports.getRealmURL = getRealmURL;
21
- _exports.handleTokenExchange = handleTokenExchange;
22
- /**
23
- * File: /src/expo/helpers.ts
24
- * Project: @multiplatform.one/keycloak
25
- * File Created: 26-11-2022 06:58:16
26
- * Author: Clay Risser
27
- * -----
28
- * Last Modified: 26-11-2022 08:11:15
29
- * Modified By: Clay Risser
30
- * -----
31
- * Risser Labs LLC (c) Copyright 2022
32
- *
33
- * Licensed under the Apache License, Version 2.0 (the "License");
34
- * you may not use this file except in compliance with the License.
35
- * You may obtain a copy of the License at
36
- *
37
- * http://www.apache.org/licenses/LICENSE-2.0
38
- *
39
- * Unless required by applicable law or agreed to in writing, software
40
- * distributed under the License is distributed on an "AS IS" BASIS,
41
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
42
- * See the License for the specific language governing permissions and
43
- * limitations under the License.
44
- */
45
-
46
- function getRealmURL(config) {
47
- const {
48
- url,
49
- realm
50
- } = config;
51
- const slash = url.endsWith("/") ? "" : "/";
52
- return `${url + slash}realms/${encodeURIComponent(realm)}`;
53
- }
54
- function getCurrentTimeInSeconds() {
55
- return Math.floor(Date.now() / 1000);
56
- }
57
- async function handleTokenExchange(_ref) {
58
- let {
59
- response,
60
- discovery,
61
- config
62
- } = _ref;
63
- try {
64
- if ((response === null || response === void 0 ? void 0 : response.type) === "success" && !!(discovery !== null && discovery !== void 0 && discovery.tokenEndpoint)) {
65
- return (0, _expoAuthSession.exchangeCodeAsync)({
66
- code: response.params.code,
67
- ...config
68
- }, discovery);
69
- }
70
- if ((response === null || response === void 0 ? void 0 : response.type) === "error") return null;
71
- return null;
72
- } catch (error) {
73
- return null;
74
- }
75
- }
76
- });
77
- //# sourceMappingURL=helpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.js","names":["getRealmURL","config","url","realm","slash","endsWith","encodeURIComponent","getCurrentTimeInSeconds","Math","floor","Date","now","handleTokenExchange","response","discovery","type","tokenEndpoint","exchangeCodeAsync","code","params","error"],"sources":["../../src/expo/helpers.ts"],"sourcesContent":["/**\n * File: /src/expo/helpers.ts\n * Project: @multiplatform.one/keycloak\n * File Created: 26-11-2022 06:58:16\n * Author: Clay Risser\n * -----\n * Last Modified: 26-11-2022 08:11:15\n * Modified By: Clay Risser\n * -----\n * Risser Labs LLC (c) Copyright 2022\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n AccessTokenRequestConfig,\n exchangeCodeAsync,\n DiscoveryDocument,\n AuthSessionResult,\n} from \"expo-auth-session\";\n\nexport function getRealmURL(config: RealmURLConfig) {\n const { url, realm } = config;\n const slash = url.endsWith(\"/\") ? \"\" : \"/\";\n return `${url + slash}realms/${encodeURIComponent(realm)}`;\n}\n\nexport function getCurrentTimeInSeconds() {\n return Math.floor(Date.now() / 1000);\n}\n\nexport async function handleTokenExchange({\n response,\n discovery,\n config,\n}: TokenExchange) {\n try {\n if (response?.type === \"success\" && !!discovery?.tokenEndpoint) {\n return exchangeCodeAsync(\n { code: response.params.code, ...config },\n discovery\n );\n }\n if (response?.type === \"error\") return null;\n return null;\n } catch (error) {\n return null;\n }\n}\n\nexport interface TokenExchange {\n response: AuthSessionResult;\n discovery: Pick<DiscoveryDocument, \"tokenEndpoint\">;\n config: Omit<AccessTokenRequestConfig, \"code\"> & { code?: string };\n}\n\nexport interface TokenExchangeDiscovery {\n tokenEndpoint?: string;\n}\n\nexport interface RealmURLConfig {\n realm: string;\n url: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;EASO,SAASA,WAAW,CAACC,MAAsB,EAAE;IAClD,MAAM;MAAEC,GAAG;MAAEC;IAAM,CAAC,GAAGF,MAAM;IAC7B,MAAMG,KAAK,GAAGF,GAAG,CAACG,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,GAAG;IAC1C,OAAQ,GAAEH,GAAG,GAAGE,KAAM,UAASE,kBAAkB,CAACH,KAAK,CAAE,EAAC;EAC5D;EAEO,SAASI,uBAAuB,GAAG;IACxC,OAAOC,IAAI,CAACC,KAAK,CAACC,IAAI,CAACC,GAAG,EAAE,GAAG,IAAI,CAAC;EACtC;EAEO,eAAeC,mBAAmB,OAIvB;IAAA,IAJwB;MACxCC,QAAQ;MACRC,SAAS;MACTb;IACa,CAAC;IACd,IAAI;MACF,IAAI,CAAAY,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAEE,IAAI,MAAK,SAAS,IAAI,CAAC,EAACD,SAAS,aAATA,SAAS,eAATA,SAAS,CAAEE,aAAa,GAAE;QAC9D,OAAO,IAAAC,kCAAiB,EACtB;UAAEC,IAAI,EAAEL,QAAQ,CAACM,MAAM,CAACD,IAAI;UAAE,GAAGjB;QAAO,CAAC,EACzCa,SAAS,CACV;MACH;MACA,IAAI,CAAAD,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAEE,IAAI,MAAK,OAAO,EAAE,OAAO,IAAI;MAC3C,OAAO,IAAI;IACb,CAAC,CAAC,OAAOK,KAAK,EAAE;MACd,OAAO,IAAI;IACb;EACF;AAAC"}
@@ -1,26 +0,0 @@
1
- /**
2
- * File: /src/expo/index.ts
3
- * Project: @multiplatform.one/keycloak
4
- * File Created: 26-11-2022 06:58:16
5
- * Author: Clay Risser
6
- * -----
7
- * Last Modified: 26-11-2022 08:38:41
8
- * Modified By: Clay Risser
9
- * -----
10
- * Risser Labs LLC (c) Copyright 2022
11
- *
12
- * Licensed under the Apache License, Version 2.0 (the "License");
13
- * you may not use this file except in compliance with the License.
14
- * You may obtain a copy of the License at
15
- *
16
- * http://www.apache.org/licenses/LICENSE-2.0
17
- *
18
- * Unless required by applicable law or agreed to in writing, software
19
- * distributed under the License is distributed on an "AS IS" BASIS,
20
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21
- * See the License for the specific language governing permissions and
22
- * limitations under the License.
23
- */
24
- export * from "./ExpoKeycloakProvider";
25
- export * from "./useExpoKeycloak";
26
- export * from "./const";
package/lib/expo/index.js DELETED
@@ -1,50 +0,0 @@
1
- (function (global, factory) {
2
- if (typeof define === "function" && define.amd) {
3
- define(["exports", "./ExpoKeycloakProvider", "./useExpoKeycloak", "./const"], factory);
4
- } else if (typeof exports !== "undefined") {
5
- factory(exports, require("./ExpoKeycloakProvider"), require("./useExpoKeycloak"), require("./const"));
6
- } else {
7
- var mod = {
8
- exports: {}
9
- };
10
- factory(mod.exports, global.ExpoKeycloakProvider, global.useExpoKeycloak, global._const);
11
- global.index = mod.exports;
12
- }
13
- })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _ExpoKeycloakProvider, _useExpoKeycloak, _const) {
14
- "use strict";
15
-
16
- Object.defineProperty(_exports, "__esModule", {
17
- value: true
18
- });
19
- Object.keys(_ExpoKeycloakProvider).forEach(function (key) {
20
- if (key === "default" || key === "__esModule") return;
21
- if (key in _exports && _exports[key] === _ExpoKeycloakProvider[key]) return;
22
- Object.defineProperty(_exports, key, {
23
- enumerable: true,
24
- get: function () {
25
- return _ExpoKeycloakProvider[key];
26
- }
27
- });
28
- });
29
- Object.keys(_useExpoKeycloak).forEach(function (key) {
30
- if (key === "default" || key === "__esModule") return;
31
- if (key in _exports && _exports[key] === _useExpoKeycloak[key]) return;
32
- Object.defineProperty(_exports, key, {
33
- enumerable: true,
34
- get: function () {
35
- return _useExpoKeycloak[key];
36
- }
37
- });
38
- });
39
- Object.keys(_const).forEach(function (key) {
40
- if (key === "default" || key === "__esModule") return;
41
- if (key in _exports && _exports[key] === _const[key]) return;
42
- Object.defineProperty(_exports, key, {
43
- enumerable: true,
44
- get: function () {
45
- return _const[key];
46
- }
47
- });
48
- });
49
- });
50
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/expo/index.ts"],"sourcesContent":["/**\n * File: /src/expo/index.ts\n * Project: @multiplatform.one/keycloak\n * File Created: 26-11-2022 06:58:16\n * Author: Clay Risser\n * -----\n * Last Modified: 26-11-2022 08:38:41\n * Modified By: Clay Risser\n * -----\n * Risser Labs LLC (c) Copyright 2022\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from \"./ExpoKeycloakProvider\";\nexport * from \"./useExpoKeycloak\";\nexport * from \"./const\";\n"],"mappings":";;;;;;;;;;;;;;;;;;EAwBA;IAAA;IAAA;IAAA;MAAA;MAAA;QAAA;MAAA;IAAA;EAAA;EACA;IAAA;IAAA;IAAA;MAAA;MAAA;QAAA;MAAA;IAAA;EAAA;EACA;IAAA;IAAA;IAAA;MAAA;MAAA;QAAA;MAAA;IAAA;EAAA;AAAwB"}
@@ -1,31 +0,0 @@
1
- /**
2
- * File: /src/expo/useExpoKeycloak.ts
3
- * Project: @multiplatform.one/keycloak
4
- * File Created: 26-11-2022 06:58:16
5
- * Author: Clay Risser
6
- * -----
7
- * Last Modified: 26-11-2022 08:38:57
8
- * Modified By: Clay Risser
9
- * -----
10
- * Risser Labs LLC (c) Copyright 2022
11
- *
12
- * Licensed under the Apache License, Version 2.0 (the "License");
13
- * you may not use this file except in compliance with the License.
14
- * You may obtain a copy of the License at
15
- *
16
- * http://www.apache.org/licenses/LICENSE-2.0
17
- *
18
- * Unless required by applicable law or agreed to in writing, software
19
- * distributed under the License is distributed on an "AS IS" BASIS,
20
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21
- * See the License for the specific language governing permissions and
22
- * limitations under the License.
23
- */
24
- export declare function useExpoKeycloak(): {
25
- isLoggedIn: boolean | undefined;
26
- login: (options?: import("expo-auth-session").AuthRequestPromptOptions | undefined) => Promise<import("expo-auth-session").AuthSessionResult | undefined>;
27
- logout: () => undefined;
28
- ready: boolean;
29
- token: string | null;
30
- refreshToken: string | null;
31
- };
@@ -1,62 +0,0 @@
1
- (function (global, factory) {
2
- if (typeof define === "function" && define.amd) {
3
- define(["exports", "react", "./ExpoKeycloakContext"], factory);
4
- } else if (typeof exports !== "undefined") {
5
- factory(exports, require("react"), require("./ExpoKeycloakContext"));
6
- } else {
7
- var mod = {
8
- exports: {}
9
- };
10
- factory(mod.exports, global.react, global.ExpoKeycloakContext);
11
- global.useExpoKeycloak = mod.exports;
12
- }
13
- })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _react, _ExpoKeycloakContext) {
14
- "use strict";
15
-
16
- Object.defineProperty(_exports, "__esModule", {
17
- value: true
18
- });
19
- _exports.useExpoKeycloak = useExpoKeycloak;
20
- /**
21
- * File: /src/expo/useExpoKeycloak.ts
22
- * Project: @multiplatform.one/keycloak
23
- * File Created: 26-11-2022 06:58:16
24
- * Author: Clay Risser
25
- * -----
26
- * Last Modified: 26-11-2022 08:38:57
27
- * Modified By: Clay Risser
28
- * -----
29
- * Risser Labs LLC (c) Copyright 2022
30
- *
31
- * Licensed under the Apache License, Version 2.0 (the "License");
32
- * you may not use this file except in compliance with the License.
33
- * You may obtain a copy of the License at
34
- *
35
- * http://www.apache.org/licenses/LICENSE-2.0
36
- *
37
- * Unless required by applicable law or agreed to in writing, software
38
- * distributed under the License is distributed on an "AS IS" BASIS,
39
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
40
- * See the License for the specific language governing permissions and
41
- * limitations under the License.
42
- */
43
-
44
- function useExpoKeycloak() {
45
- const {
46
- isLoggedIn,
47
- login,
48
- logout,
49
- ready = false,
50
- token = null
51
- } = (0, _react.useContext)(_ExpoKeycloakContext.ExpoKeycloakContext);
52
- return {
53
- isLoggedIn,
54
- login,
55
- logout,
56
- ready,
57
- token: (token === null || token === void 0 ? void 0 : token.accessToken) ?? null,
58
- refreshToken: (token === null || token === void 0 ? void 0 : token.refreshToken) ?? null
59
- };
60
- }
61
- });
62
- //# sourceMappingURL=useExpoKeycloak.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useExpoKeycloak.js","names":["useExpoKeycloak","isLoggedIn","login","logout","ready","token","useContext","ExpoKeycloakContext","accessToken","refreshToken"],"sources":["../../src/expo/useExpoKeycloak.ts"],"sourcesContent":["/**\n * File: /src/expo/useExpoKeycloak.ts\n * Project: @multiplatform.one/keycloak\n * File Created: 26-11-2022 06:58:16\n * Author: Clay Risser\n * -----\n * Last Modified: 26-11-2022 08:38:57\n * Modified By: Clay Risser\n * -----\n * Risser Labs LLC (c) Copyright 2022\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useContext } from \"react\";\nimport { ExpoKeycloakContext } from \"./ExpoKeycloakContext\";\n\nexport function useExpoKeycloak() {\n const {\n isLoggedIn,\n login,\n logout,\n ready = false,\n token = null,\n } = useContext(ExpoKeycloakContext);\n return {\n isLoggedIn,\n login,\n logout,\n ready,\n token: token?.accessToken ?? null,\n refreshToken: token?.refreshToken ?? null,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;EAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;EAKO,SAASA,eAAe,GAAG;IAChC,MAAM;MACJC,UAAU;MACVC,KAAK;MACLC,MAAM;MACNC,KAAK,GAAG,KAAK;MACbC,KAAK,GAAG;IACV,CAAC,GAAG,IAAAC,iBAAU,EAACC,wCAAmB,CAAC;IACnC,OAAO;MACLN,UAAU;MACVC,KAAK;MACLC,MAAM;MACNC,KAAK;MACLC,KAAK,EAAE,CAAAA,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEG,WAAW,KAAI,IAAI;MACjCC,YAAY,EAAE,CAAAJ,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEI,YAAY,KAAI;IACvC,CAAC;EACH;AAAC"}
@@ -1,36 +0,0 @@
1
- /**
2
- * File: /src/expo/useTokenStorage.ts
3
- * Project: @multiplatform.one/keycloak
4
- * File Created: 26-11-2022 06:58:16
5
- * Author: Clay Risser
6
- * -----
7
- * Last Modified: 26-11-2022 08:08:00
8
- * Modified By: Clay Risser
9
- * -----
10
- * Risser Labs LLC (c) Copyright 2022
11
- *
12
- * Licensed under the Apache License, Version 2.0 (the "License");
13
- * you may not use this file except in compliance with the License.
14
- * You may obtain a copy of the License at
15
- *
16
- * http://www.apache.org/licenses/LICENSE-2.0
17
- *
18
- * Unless required by applicable law or agreed to in writing, software
19
- * distributed under the License is distributed on an "AS IS" BASIS,
20
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21
- * See the License for the specific language governing permissions and
22
- * limitations under the License.
23
- */
24
- import { DiscoveryDocument } from "expo-auth-session";
25
- import { TokenResponse } from "expo-auth-session";
26
- export declare function useTokenStorage({ disableAutoRefresh, refreshTimeBuffer, tokenStorageKey, }: {
27
- disableAutoRefresh?: boolean | undefined;
28
- refreshTimeBuffer?: number | undefined;
29
- tokenStorageKey?: string | undefined;
30
- }, config: {
31
- clientId: string;
32
- extraParams?: Record<string, string>;
33
- realm: string;
34
- redirectUri: string;
35
- url: string;
36
- }, discovery: DiscoveryDocument): [TokenResponse | null, (token: TokenResponse | null) => Promise<void>];