@multiplatform.one/keycloak 0.0.2 → 0.0.3
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/esm/Authenticated.js +8 -19
- package/esm/Authenticated.js.map +1 -1
- package/esm/authConfig.js +2 -2
- package/esm/authConfig.js.map +1 -1
- package/esm/expo/ExpoKeycloakContext.js +28 -0
- package/esm/expo/ExpoKeycloakContext.js.map +1 -0
- package/esm/expo/ExpoKeycloakProvider.js +113 -0
- package/esm/expo/ExpoKeycloakProvider.js.map +1 -0
- package/esm/expo/KeycloakContext.js +28 -0
- package/esm/expo/KeycloakContext.js.map +1 -0
- package/esm/expo/KeycloakProvider.js +142 -0
- package/esm/expo/KeycloakProvider.js.map +1 -0
- package/esm/expo/const.js +42 -0
- package/esm/expo/const.js.map +1 -0
- package/esm/expo/helpers.js +56 -0
- package/esm/expo/helpers.js.map +1 -0
- package/esm/expo/index.js +28 -0
- package/esm/expo/index.js.map +1 -0
- package/esm/expo/useExpoKeycloak.js +44 -0
- package/esm/expo/useExpoKeycloak.js.map +1 -0
- package/esm/expo/useTokenStorage.js +153 -0
- package/esm/expo/useTokenStorage.js.map +1 -0
- package/esm/hooks/useCurrentRouteName.js +2 -3
- package/esm/hooks/useCurrentRouteName.js.map +1 -1
- package/esm/hooks/useKeycloak/index.js +1 -1
- package/esm/hooks/useKeycloak/index.js.map +1 -1
- package/esm/hooks/useKeycloak/useKeycloak.js +17 -24
- package/esm/hooks/useKeycloak/useKeycloak.js.map +1 -1
- package/esm/hooks/useKeycloak/useKeycloak.native.js +39 -24
- package/esm/hooks/useKeycloak/useKeycloak.native.js.map +1 -1
- package/esm/hooks/useLogin.js +12 -30
- package/esm/hooks/useLogin.js.map +1 -1
- package/esm/provider/afterAuth.js +21 -39
- package/esm/provider/afterAuth.js.map +1 -1
- package/esm/provider/index.js +11 -28
- package/esm/provider/index.js.map +1 -1
- package/esm/provider/keycloakProvider.js +55 -100
- package/esm/provider/keycloakProvider.js.map +1 -1
- package/esm/provider/keycloakProvider.native.js +12 -11
- package/esm/provider/keycloakProvider.native.js.map +1 -1
- package/esm/state/index.js +2 -2
- package/esm/state/index.js.map +1 -1
- package/lib/Authenticated.js +38 -26
- package/lib/Authenticated.js.map +1 -1
- package/lib/authConfig.js +2 -4
- package/lib/authConfig.js.map +1 -1
- package/lib/expo/ExpoKeycloakContext.d.ts +32 -0
- package/lib/expo/ExpoKeycloakContext.js +47 -0
- package/lib/expo/ExpoKeycloakContext.js.map +1 -0
- package/lib/expo/ExpoKeycloakProvider.d.ts +37 -0
- package/lib/expo/ExpoKeycloakProvider.js +130 -0
- package/lib/expo/ExpoKeycloakProvider.js.map +1 -0
- package/lib/expo/KeycloakContext.d.ts +32 -0
- package/lib/expo/KeycloakContext.js +49 -0
- package/lib/expo/KeycloakContext.js.map +1 -0
- package/lib/expo/KeycloakProvider.d.ts +37 -0
- package/lib/expo/KeycloakProvider.js +138 -0
- package/lib/expo/KeycloakProvider.js.map +1 -0
- package/lib/expo/const.d.ts +33 -0
- package/lib/expo/const.js +66 -0
- package/lib/expo/const.js.map +1 -0
- package/lib/expo/helpers.d.ts +41 -0
- package/lib/expo/helpers.js +77 -0
- package/lib/expo/helpers.js.map +1 -0
- package/lib/expo/index.d.ts +26 -0
- package/lib/expo/index.js +50 -0
- package/lib/expo/index.js.map +1 -0
- package/lib/expo/useExpoKeycloak.d.ts +31 -0
- package/lib/expo/useExpoKeycloak.js +62 -0
- package/lib/expo/useExpoKeycloak.js.map +1 -0
- package/lib/expo/useTokenStorage.d.ts +36 -0
- package/lib/expo/useTokenStorage.js +166 -0
- package/lib/expo/useTokenStorage.js.map +1 -0
- package/lib/hooks/index.js +3 -9
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/useAuthConfig.js +0 -2
- package/lib/hooks/useAuthConfig.js.map +1 -1
- package/lib/hooks/useCurrentRouteName.js +6 -8
- package/lib/hooks/useCurrentRouteName.js.map +1 -1
- package/lib/hooks/useKeycloak/index.d.ts +6 -4
- package/lib/hooks/useKeycloak/index.js +1 -7
- package/lib/hooks/useKeycloak/index.js.map +1 -1
- package/lib/hooks/useKeycloak/useKeycloak.js +45 -30
- package/lib/hooks/useKeycloak/useKeycloak.js.map +1 -1
- package/lib/hooks/useKeycloak/useKeycloak.native.d.ts +12 -4
- package/lib/hooks/useKeycloak/useKeycloak.native.js +40 -28
- package/lib/hooks/useKeycloak/useKeycloak.native.js.map +1 -1
- package/lib/hooks/useLogin.js +16 -25
- package/lib/hooks/useLogin.js.map +1 -1
- package/lib/index.js +4 -10
- package/lib/index.js.map +1 -1
- package/lib/provider/afterAuth.js +52 -52
- package/lib/provider/afterAuth.js.map +1 -1
- package/lib/provider/index.js +44 -43
- package/lib/provider/index.js.map +1 -1
- package/lib/provider/keycloakProvider.js +93 -114
- package/lib/provider/keycloakProvider.js.map +1 -1
- package/lib/provider/keycloakProvider.native.js +39 -15
- package/lib/provider/keycloakProvider.native.js.map +1 -1
- package/lib/state/index.js +3 -5
- package/lib/state/index.js.map +1 -1
- package/lib/tsconfig.build.tsbuildinfo +1 -1
- package/lib/types.js +2 -4
- package/lib/types.js.map +1 -1
- package/package.json +3 -2
- package/src/expo/ExpoKeycloakContext.ts +41 -0
- package/src/expo/ExpoKeycloakProvider.tsx +139 -0
- package/src/expo/NOTES +1 -0
- package/src/expo/const.ts +42 -0
- package/src/expo/helpers.ts +74 -0
- package/src/{@types/expoKeycloakAuth.d.ts → expo/index.ts} +6 -7
- package/src/expo/useExpoKeycloak.ts +44 -0
- package/src/expo/useTokenStorage.ts +168 -0
- package/src/hooks/useKeycloak/index.ts +10 -4
- package/src/hooks/useKeycloak/useKeycloak.native.ts +48 -11
- package/src/provider/keycloakProvider.native.tsx +8 -4
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
(function (global, factory) {
|
|
2
|
+
if (typeof define === "function" && define.amd) {
|
|
3
|
+
define(["exports", "react", "./const"], factory);
|
|
4
|
+
} else if (typeof exports !== "undefined") {
|
|
5
|
+
factory(exports, require("react"), require("./const"));
|
|
6
|
+
} else {
|
|
7
|
+
var mod = {
|
|
8
|
+
exports: {}
|
|
9
|
+
};
|
|
10
|
+
factory(mod.exports, global.react, global._const);
|
|
11
|
+
global.ExpoKeycloakContext = mod.exports;
|
|
12
|
+
}
|
|
13
|
+
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _react, _const) {
|
|
14
|
+
"use strict";
|
|
15
|
+
|
|
16
|
+
Object.defineProperty(_exports, "__esModule", {
|
|
17
|
+
value: true
|
|
18
|
+
});
|
|
19
|
+
_exports.ExpoKeycloakContext = void 0;
|
|
20
|
+
/**
|
|
21
|
+
* File: /src/expo/ExpoKeycloakContext.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:25
|
|
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 ExpoKeycloakContext = /*#__PURE__*/(0, _react.createContext)(_const.KC_INITIAL_VALUE);
|
|
45
|
+
_exports.ExpoKeycloakContext = ExpoKeycloakContext;
|
|
46
|
+
});
|
|
47
|
+
//# sourceMappingURL=ExpoKeycloakContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpoKeycloakContext.js","names":["ExpoKeycloakContext","createContext","KC_INITIAL_VALUE"],"sources":["../../src/expo/ExpoKeycloakContext.ts"],"sourcesContent":["/**\n * File: /src/expo/ExpoKeycloakContext.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:25\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 AuthRequestPromptOptions,\n AuthSessionResult,\n TokenResponse,\n} from \"expo-auth-session\";\nimport { createContext } from \"react\";\nimport { KC_INITIAL_VALUE } from \"./const\";\n\nexport const ExpoKeycloakContext = createContext<{\n ready: boolean;\n isLoggedIn?: boolean;\n login: (\n options?: AuthRequestPromptOptions\n ) => Promise<AuthSessionResult | undefined>;\n logout: () => undefined;\n token: TokenResponse | null;\n}>(KC_INITIAL_VALUE);\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;;EAUO,MAAMA,mBAAmB,gBAAG,IAAAC,oBAAa,EAQ7CC,uBAAgB,CAAC;EAAC;AAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File: /src/expo/KeycloakProvider.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:06:40
|
|
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 { ReactNode } from "react";
|
|
25
|
+
import { AuthRequestConfig } from "expo-auth-session";
|
|
26
|
+
export interface IKeycloakConfiguration extends Partial<AuthRequestConfig> {
|
|
27
|
+
children: ReactNode;
|
|
28
|
+
clientId: string;
|
|
29
|
+
disableAutoRefresh?: boolean;
|
|
30
|
+
nativeRedirectPath?: string;
|
|
31
|
+
realm: string;
|
|
32
|
+
refreshTimeBuffer?: number;
|
|
33
|
+
scheme?: string;
|
|
34
|
+
tokenStorageKey?: string;
|
|
35
|
+
url: string;
|
|
36
|
+
}
|
|
37
|
+
export declare const ExpoKeycloakProvider: ({ realm, clientId, url, extraParams, children, ...options }: IKeycloakConfiguration) => JSX.Element;
|
|
@@ -0,0 +1,130 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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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"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File: /src/expo/KeycloakContext.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:25:18
|
|
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
|
+
/// <reference types="react" />
|
|
25
|
+
import { AuthRequestPromptOptions, AuthSessionResult, TokenResponse } from "expo-auth-session";
|
|
26
|
+
export declare const KeycloakContext: import("react").Context<{
|
|
27
|
+
ready: boolean;
|
|
28
|
+
isLoggedIn?: boolean | undefined;
|
|
29
|
+
login: (options?: AuthRequestPromptOptions) => Promise<AuthSessionResult | undefined>;
|
|
30
|
+
logout: () => undefined;
|
|
31
|
+
token: TokenResponse | null;
|
|
32
|
+
}>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
require("core-js/modules/esnext.global-this.js");
|
|
2
|
+
require("core-js/modules/es.object.define-property.js");
|
|
3
|
+
(function (global, factory) {
|
|
4
|
+
if (typeof define === "function" && define.amd) {
|
|
5
|
+
define(["exports", "react", "./const"], factory);
|
|
6
|
+
} else if (typeof exports !== "undefined") {
|
|
7
|
+
factory(exports, require("react"), require("./const"));
|
|
8
|
+
} else {
|
|
9
|
+
var mod = {
|
|
10
|
+
exports: {}
|
|
11
|
+
};
|
|
12
|
+
factory(mod.exports, global.react, global._const);
|
|
13
|
+
global.KeycloakContext = mod.exports;
|
|
14
|
+
}
|
|
15
|
+
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _react, _const) {
|
|
16
|
+
"use strict";
|
|
17
|
+
|
|
18
|
+
Object.defineProperty(_exports, "__esModule", {
|
|
19
|
+
value: true
|
|
20
|
+
});
|
|
21
|
+
_exports.KeycloakContext = void 0;
|
|
22
|
+
/**
|
|
23
|
+
* File: /src/expo/KeycloakContext.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:25:18
|
|
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
|
+
var KeycloakContext = /*#__PURE__*/(0, _react.createContext)(_const.KC_INITIAL_VALUE);
|
|
47
|
+
_exports.KeycloakContext = KeycloakContext;
|
|
48
|
+
});
|
|
49
|
+
//# sourceMappingURL=KeycloakContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeycloakContext.js","names":["KeycloakContext","createContext","KC_INITIAL_VALUE"],"sources":["../../src/expo/KeycloakContext.ts"],"sourcesContent":["/**\n * File: /src/expo/KeycloakContext.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:25:18\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 AuthRequestPromptOptions,\n AuthSessionResult,\n TokenResponse,\n} from \"expo-auth-session\";\nimport { createContext } from \"react\";\nimport { KC_INITIAL_VALUE } from \"./const\";\n\nexport const KeycloakContext = createContext<{\n ready: boolean;\n isLoggedIn?: boolean;\n login: (\n options?: AuthRequestPromptOptions\n ) => Promise<AuthSessionResult | undefined>;\n logout: () => undefined;\n token: TokenResponse | null;\n}>(KC_INITIAL_VALUE);\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;;EAUO,IAAMA,eAAe,gBAAG,IAAAC,oBAAa,EAQzCC,uBAAgB,CAAC;EAAC;AAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File: /src/expo/KeycloakProvider.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:06:40
|
|
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 { ReactNode } from "react";
|
|
25
|
+
import { AuthRequestConfig } from "expo-auth-session";
|
|
26
|
+
export interface IKeycloakConfiguration extends Partial<AuthRequestConfig> {
|
|
27
|
+
children: ReactNode;
|
|
28
|
+
clientId: string;
|
|
29
|
+
disableAutoRefresh?: boolean;
|
|
30
|
+
nativeRedirectPath?: string;
|
|
31
|
+
realm: string;
|
|
32
|
+
refreshTimeBuffer?: number;
|
|
33
|
+
scheme?: string;
|
|
34
|
+
tokenStorageKey?: string;
|
|
35
|
+
url: string;
|
|
36
|
+
}
|
|
37
|
+
export declare const KeycloakProvider: ({ realm, clientId, url, extraParams, children, ...options }: IKeycloakConfiguration) => JSX.Element;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
2
|
+
require("core-js/modules/esnext.global-this.js");
|
|
3
|
+
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
require("core-js/modules/es.array.iterator.js");
|
|
5
|
+
require("core-js/modules/es.string.iterator.js");
|
|
6
|
+
require("core-js/modules/es.weak-map.js");
|
|
7
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
8
|
+
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
9
|
+
require("core-js/modules/es.object.keys.js");
|
|
10
|
+
require("core-js/modules/es.symbol.js");
|
|
11
|
+
require("core-js/modules/es.array.filter.js");
|
|
12
|
+
require("core-js/modules/es.array.for-each.js");
|
|
13
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
|
14
|
+
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
15
|
+
require("core-js/modules/es.object.define-properties.js");
|
|
16
|
+
(function (global, factory) {
|
|
17
|
+
if (typeof define === "function" && define.amd) {
|
|
18
|
+
define(["exports", "@babel/runtime/helpers/defineProperty", "@babel/runtime/helpers/slicedToArray", "@babel/runtime/helpers/objectWithoutProperties", "core-js/modules/es.function.bind.js", "core-js/modules/es.array.concat.js", "core-js/modules/es.object.to-string.js", "core-js/modules/es.promise.js", "@babel/runtime/helpers/newArrowCheck", "react", "react-native", "expo-auth-session", "./KeycloakContext", "./useTokenStorage", "./helpers", "./const"], factory);
|
|
19
|
+
} else if (typeof exports !== "undefined") {
|
|
20
|
+
factory(exports, require("@babel/runtime/helpers/defineProperty"), require("@babel/runtime/helpers/slicedToArray"), require("@babel/runtime/helpers/objectWithoutProperties"), require("core-js/modules/es.function.bind.js"), require("core-js/modules/es.array.concat.js"), require("core-js/modules/es.object.to-string.js"), require("core-js/modules/es.promise.js"), require("@babel/runtime/helpers/newArrowCheck"), require("react"), require("react-native"), require("expo-auth-session"), require("./KeycloakContext"), require("./useTokenStorage"), require("./helpers"), require("./const"));
|
|
21
|
+
} else {
|
|
22
|
+
var mod = {
|
|
23
|
+
exports: {}
|
|
24
|
+
};
|
|
25
|
+
factory(mod.exports, global.defineProperty, global.slicedToArray, global.objectWithoutProperties, global.esFunctionBind, global.esArrayConcat, global.esObjectToString, global.esPromise, global.newArrowCheck, global.react, global.reactNative, global.expoAuthSession, global.KeycloakContext, global.useTokenStorage, global.helpers, global._const);
|
|
26
|
+
global.KeycloakProvider = mod.exports;
|
|
27
|
+
}
|
|
28
|
+
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _defineProperty2, _slicedToArray2, _objectWithoutProperties2, _esFunctionBind, _esArrayConcat, _esObjectToString, _esPromise, _newArrowCheck2, _react, _reactNative, AuthSession, _KeycloakContext, _useTokenStorage3, _helpers, _const) {
|
|
29
|
+
"use strict";
|
|
30
|
+
|
|
31
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
32
|
+
Object.defineProperty(_exports, "__esModule", {
|
|
33
|
+
value: true
|
|
34
|
+
});
|
|
35
|
+
_exports.KeycloakProvider = void 0;
|
|
36
|
+
_defineProperty2 = _interopRequireDefault(_defineProperty2);
|
|
37
|
+
_slicedToArray2 = _interopRequireDefault(_slicedToArray2);
|
|
38
|
+
_objectWithoutProperties2 = _interopRequireDefault(_objectWithoutProperties2);
|
|
39
|
+
_newArrowCheck2 = _interopRequireDefault(_newArrowCheck2);
|
|
40
|
+
_react = _interopRequireWildcard(_react);
|
|
41
|
+
AuthSession = _interopRequireWildcard(AuthSession);
|
|
42
|
+
var _excluded = ["realm", "clientId", "url", "extraParams", "children"];
|
|
43
|
+
var _this = void 0;
|
|
44
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
45
|
+
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; }
|
|
46
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
47
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
48
|
+
var KeycloakProvider = function KeycloakProvider(_ref) {
|
|
49
|
+
var _options$scheme,
|
|
50
|
+
_options$nativeRedire,
|
|
51
|
+
_this2 = this;
|
|
52
|
+
(0, _newArrowCheck2["default"])(this, _this);
|
|
53
|
+
var realm = _ref.realm,
|
|
54
|
+
clientId = _ref.clientId,
|
|
55
|
+
url = _ref.url,
|
|
56
|
+
extraParams = _ref.extraParams,
|
|
57
|
+
children = _ref.children,
|
|
58
|
+
options = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
59
|
+
var discovery = (0, AuthSession.useAutoDiscovery)((0, _helpers.getRealmURL)({
|
|
60
|
+
realm: realm,
|
|
61
|
+
url: url
|
|
62
|
+
}));
|
|
63
|
+
var redirectUri = AuthSession.makeRedirectUri({
|
|
64
|
+
"native": "".concat((_options$scheme = options.scheme) !== null && _options$scheme !== void 0 ? _options$scheme : "exp", "://").concat((_options$nativeRedire = options.nativeRedirectPath) !== null && _options$nativeRedire !== void 0 ? _options$nativeRedire : _const.NATIVE_REDIRECT_PATH),
|
|
65
|
+
useProxy: !options.scheme
|
|
66
|
+
});
|
|
67
|
+
var config = {
|
|
68
|
+
clientId: clientId,
|
|
69
|
+
extraParams: extraParams,
|
|
70
|
+
realm: realm,
|
|
71
|
+
redirectUri: redirectUri,
|
|
72
|
+
url: url
|
|
73
|
+
};
|
|
74
|
+
var _useAuthRequest = (0, AuthSession.useAuthRequest)(_objectSpread({
|
|
75
|
+
usePKCE: false
|
|
76
|
+
}, config), discovery),
|
|
77
|
+
_useAuthRequest2 = (0, _slicedToArray2["default"])(_useAuthRequest, 3),
|
|
78
|
+
request = _useAuthRequest2[0],
|
|
79
|
+
response = _useAuthRequest2[1],
|
|
80
|
+
promptAsync = _useAuthRequest2[2];
|
|
81
|
+
var _useTokenStorage = (0, _useTokenStorage3.useTokenStorage)(options, config, discovery),
|
|
82
|
+
_useTokenStorage2 = (0, _slicedToArray2["default"])(_useTokenStorage, 2),
|
|
83
|
+
currentToken = _useTokenStorage2[0],
|
|
84
|
+
updateToken = _useTokenStorage2[1];
|
|
85
|
+
var handleLogin = (0, _react.useCallback)(function () {
|
|
86
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
87
|
+
return promptAsync(options);
|
|
88
|
+
}, [request]);
|
|
89
|
+
function handleLogout() {
|
|
90
|
+
if (!currentToken) throw new Error("Not logged in.");
|
|
91
|
+
try {
|
|
92
|
+
if (discovery !== null && discovery !== void 0 && discovery.revocationEndpoint) {
|
|
93
|
+
AuthSession.revokeAsync(_objectSpread({
|
|
94
|
+
token: currentToken === null || currentToken === void 0 ? void 0 : currentToken.accessToken
|
|
95
|
+
}, config), discovery);
|
|
96
|
+
}
|
|
97
|
+
if (discovery !== null && discovery !== void 0 && discovery.endSessionEndpoint) {
|
|
98
|
+
fetch("".concat(discovery.endSessionEndpoint), {
|
|
99
|
+
method: "POST",
|
|
100
|
+
headers: {
|
|
101
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
102
|
+
},
|
|
103
|
+
body: "client_id=".concat(clientId, "&refresh_token=").concat(currentToken.refreshToken)
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
if (_reactNative.Platform.OS === "ios") {
|
|
107
|
+
AuthSession.dismiss();
|
|
108
|
+
}
|
|
109
|
+
} catch (error) {
|
|
110
|
+
console.log(error);
|
|
111
|
+
}
|
|
112
|
+
updateToken(null);
|
|
113
|
+
return undefined;
|
|
114
|
+
}
|
|
115
|
+
(0, _react.useEffect)(function () {
|
|
116
|
+
(0, _newArrowCheck2["default"])(this, _this2);
|
|
117
|
+
if (response) {
|
|
118
|
+
(0, _helpers.handleTokenExchange)({
|
|
119
|
+
response: response,
|
|
120
|
+
discovery: discovery,
|
|
121
|
+
config: config
|
|
122
|
+
}).then(updateToken);
|
|
123
|
+
}
|
|
124
|
+
}.bind(this), [response]);
|
|
125
|
+
return /*#__PURE__*/_react["default"].createElement(_KeycloakContext.KeycloakContext.Provider, {
|
|
126
|
+
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
127
|
+
value: {
|
|
128
|
+
isLoggedIn: currentToken === undefined ? undefined : !!currentToken,
|
|
129
|
+
login: handleLogin,
|
|
130
|
+
logout: handleLogout,
|
|
131
|
+
ready: discovery !== null && request !== null && currentToken !== undefined,
|
|
132
|
+
token: currentToken
|
|
133
|
+
}
|
|
134
|
+
}, children);
|
|
135
|
+
}.bind(void 0);
|
|
136
|
+
_exports.KeycloakProvider = KeycloakProvider;
|
|
137
|
+
});
|
|
138
|
+
//# sourceMappingURL=KeycloakProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeycloakProvider.js","names":["KeycloakProvider","realm","clientId","url","extraParams","children","options","discovery","useAutoDiscovery","getRealmURL","redirectUri","AuthSession","makeRedirectUri","scheme","nativeRedirectPath","NATIVE_REDIRECT_PATH","useProxy","config","useAuthRequest","usePKCE","request","response","promptAsync","useTokenStorage","currentToken","updateToken","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/KeycloakProvider.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 { KeycloakContext } from \"./KeycloakContext\";\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 KeycloakProvider = ({\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 <KeycloakContext.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 </KeycloakContext.Provider>\n );\n};\n"],"mappings":"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"}
|
|
@@ -0,0 +1,33 @@
|
|
|
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;
|
|
@@ -0,0 +1,66 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|