@multiplatform.one/keycloak 0.7.16 → 0.7.17
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/lib/@types/expoKeycloakAuth.d.d.mts +25 -0
- package/lib/@types/expoKeycloakAuth.d.d.ts +25 -0
- package/lib/@types/expoKeycloakAuth.d.js +1 -0
- package/lib/@types/expoKeycloakAuth.d.mjs +0 -0
- package/lib/Authenticated.d.mts +33 -0
- package/lib/Authenticated.d.ts +33 -0
- package/lib/Authenticated.js +20 -0
- package/lib/Authenticated.mjs +20 -0
- package/lib/authConfig.d.mts +12 -0
- package/lib/authConfig.d.ts +12 -0
- package/lib/authConfig.js +9 -0
- package/lib/authConfig.mjs +9 -0
- package/lib/chunk-2BKS6UM5.js +51 -0
- package/lib/chunk-2BSUCVXL.js +50 -0
- package/lib/chunk-2L5TXBDK.mjs +7 -0
- package/lib/chunk-2VDDEPLF.js +27 -0
- package/lib/chunk-32AVT4GA.js +9 -0
- package/lib/chunk-3ZTSLDX7.js +13 -0
- package/lib/chunk-6F4PWJZI.js +1 -0
- package/lib/chunk-6FRYV4MK.mjs +27 -0
- package/lib/chunk-A2V2S4HP.js +22 -0
- package/lib/chunk-BUZONXAW.js +1 -0
- package/lib/chunk-CGLMLNUS.mjs +245 -0
- package/lib/chunk-FU4CT24B.mjs +32 -0
- package/lib/chunk-HH32BME2.mjs +0 -0
- package/lib/chunk-HTWZLBA4.mjs +13 -0
- package/lib/chunk-I5FNGKQ6.js +16 -0
- package/lib/chunk-JAFUI2JQ.mjs +9 -0
- package/lib/chunk-JPQI72HR.mjs +0 -0
- package/lib/chunk-L3HTVJ4B.mjs +13 -0
- package/lib/chunk-MDAAMGTE.js +1 -0
- package/lib/chunk-NH335CDK.js +32 -0
- package/lib/chunk-OA5TSQWZ.mjs +50 -0
- package/lib/chunk-OAUYHIWG.mjs +0 -0
- package/lib/chunk-OBB23GPX.mjs +0 -0
- package/lib/chunk-OZLV3US5.js +245 -0
- package/lib/chunk-P57PW2II.js +11 -0
- package/lib/chunk-TUJRPTZE.js +13 -0
- package/lib/chunk-UESWAK47.mjs +0 -0
- package/lib/chunk-UH4K7HGE.mjs +163 -0
- package/lib/chunk-UKSHA3X3.mjs +16 -0
- package/lib/chunk-VS4M7GMO.js +1 -0
- package/lib/chunk-WBQAMGXK.mjs +0 -0
- package/lib/chunk-WMH347OL.mjs +22 -0
- package/lib/chunk-WS4IMGVL.js +1 -0
- package/lib/chunk-X53FOCXA.js +28 -0
- package/lib/chunk-Y23BWOII.mjs +51 -0
- package/lib/chunk-Y5MS3XVZ.mjs +28 -0
- package/lib/chunk-YACGLW5Q.js +7 -0
- package/lib/chunk-ZCBD6HWK.js +1 -0
- package/lib/chunk-ZFXKCRJC.mjs +11 -0
- package/lib/chunk-ZW4GP2I5.js +163 -0
- package/lib/hooks/index.d.mts +5 -0
- package/lib/hooks/index.d.ts +5 -0
- package/lib/hooks/index.js +19 -0
- package/lib/hooks/index.mjs +19 -0
- package/lib/hooks/useAuthConfig.d.mts +6 -0
- package/lib/hooks/useAuthConfig.d.ts +6 -0
- package/lib/hooks/useAuthConfig.js +8 -0
- package/lib/hooks/useAuthConfig.mjs +8 -0
- package/lib/hooks/useTokensFromQuery/index.d.mts +3 -0
- package/lib/hooks/useTokensFromQuery/index.d.ts +3 -0
- package/lib/hooks/useTokensFromQuery/index.js +7 -0
- package/lib/hooks/useTokensFromQuery/index.mjs +7 -0
- package/lib/hooks/useTokensFromQuery/index.native.d.mts +3 -0
- package/lib/hooks/useTokensFromQuery/index.native.d.ts +3 -0
- package/lib/hooks/useTokensFromQuery/index.native.js +7 -0
- package/lib/hooks/useTokensFromQuery/index.native.mjs +7 -0
- package/lib/hooks/useTokensFromState.d.mts +3 -0
- package/lib/hooks/useTokensFromState.d.ts +3 -0
- package/lib/hooks/useTokensFromState.js +9 -0
- package/lib/hooks/useTokensFromState.mjs +9 -0
- package/lib/index.d.mts +16 -0
- package/lib/index.d.ts +16 -0
- package/lib/index.js +62 -0
- package/lib/index.mjs +62 -0
- package/lib/keycloak/context.d.mts +12 -0
- package/lib/keycloak/context.d.ts +12 -0
- package/lib/keycloak/context.js +7 -0
- package/lib/keycloak/context.mjs +7 -0
- package/lib/keycloak/index.d.mts +7 -0
- package/lib/keycloak/index.d.ts +7 -0
- package/lib/keycloak/index.js +14 -0
- package/lib/keycloak/index.mjs +14 -0
- package/lib/keycloak/keycloak.d.mts +37 -0
- package/lib/keycloak/keycloak.d.ts +37 -0
- package/lib/keycloak/keycloak.js +13 -0
- package/lib/keycloak/keycloak.mjs +13 -0
- package/lib/keycloak/keycloak.native.d.mts +33 -0
- package/lib/keycloak/keycloak.native.d.ts +33 -0
- package/lib/keycloak/keycloak.native.js +134 -0
- package/lib/keycloak/keycloak.native.mjs +134 -0
- package/lib/provider/AfterAuth.d.mts +28 -0
- package/lib/provider/AfterAuth.d.ts +28 -0
- package/lib/provider/AfterAuth.js +18 -0
- package/lib/provider/AfterAuth.mjs +18 -0
- package/lib/provider/AuthProvider/AuthProvider.d.mts +37 -0
- package/lib/provider/AuthProvider/AuthProvider.d.ts +37 -0
- package/lib/provider/AuthProvider/AuthProvider.js +19 -0
- package/lib/provider/AuthProvider/AuthProvider.mjs +19 -0
- package/lib/provider/AuthProvider/AuthProvider.native.d.mts +29 -0
- package/lib/provider/AuthProvider/AuthProvider.native.d.ts +29 -0
- package/lib/provider/AuthProvider/AuthProvider.native.js +25 -0
- package/lib/provider/AuthProvider/AuthProvider.native.mjs +25 -0
- package/lib/provider/AuthProvider/index.d.mts +4 -0
- package/lib/provider/AuthProvider/index.d.ts +4 -0
- package/lib/provider/AuthProvider/index.js +20 -0
- package/lib/provider/AuthProvider/index.mjs +20 -0
- package/lib/provider/KeycloakProvider.d.mts +34 -0
- package/lib/provider/KeycloakProvider.d.ts +34 -0
- package/lib/provider/KeycloakProvider.js +21 -0
- package/lib/provider/KeycloakProvider.mjs +21 -0
- package/lib/provider/index.d.mts +8 -0
- package/lib/provider/index.d.ts +8 -0
- package/lib/provider/index.js +28 -0
- package/lib/provider/index.mjs +28 -0
- package/lib/routes.d.mts +28 -0
- package/lib/routes.d.ts +28 -0
- package/lib/routes.js +127 -0
- package/lib/routes.mjs +127 -0
- package/lib/session/index.d.mts +3 -0
- package/lib/session/index.d.ts +3 -0
- package/lib/session/index.js +10 -0
- package/lib/session/index.mjs +10 -0
- package/lib/session/session.d.mts +18 -0
- package/lib/session/session.d.ts +18 -0
- package/lib/session/session.js +9 -0
- package/lib/session/session.mjs +9 -0
- package/lib/session/session.native.d.mts +8 -0
- package/lib/session/session.native.d.ts +8 -0
- package/lib/session/session.native.js +13 -0
- package/lib/session/session.native.mjs +13 -0
- package/lib/state.d.mts +12 -0
- package/lib/state.d.ts +12 -0
- package/lib/state.js +9 -0
- package/lib/state.mjs +9 -0
- package/lib/token.d.mts +17 -0
- package/lib/token.d.ts +17 -0
- package/lib/token.js +9 -0
- package/lib/token.mjs +9 -0
- package/lib/types.d.mts +20 -0
- package/lib/types.d.ts +20 -0
- package/lib/types.js +1 -0
- package/lib/types.mjs +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getSession
|
|
3
|
+
} from "../chunk-FU4CT24B.mjs";
|
|
4
|
+
import "../chunk-ZFXKCRJC.mjs";
|
|
5
|
+
|
|
6
|
+
// src/keycloak/keycloak.native.ts
|
|
7
|
+
import { MultiPlatform } from "multiplatform.one";
|
|
8
|
+
import { jwtDecode } from "jwt-decode";
|
|
9
|
+
import { useKeycloak as useExpoKeycloak } from "expo-keycloak-auth";
|
|
10
|
+
var Keycloak = class {
|
|
11
|
+
token;
|
|
12
|
+
idToken;
|
|
13
|
+
refreshToken;
|
|
14
|
+
_tokenParsed;
|
|
15
|
+
_idTokenParsed;
|
|
16
|
+
_refreshTokenParsed;
|
|
17
|
+
keycloakClient;
|
|
18
|
+
mock;
|
|
19
|
+
constructor(input, idToken, refreshToken) {
|
|
20
|
+
if (typeof input === "string") {
|
|
21
|
+
this.token = input;
|
|
22
|
+
this.idToken = idToken;
|
|
23
|
+
this.refreshToken = refreshToken;
|
|
24
|
+
} else if (typeof input === "object") {
|
|
25
|
+
if (typeof input.init === "function") {
|
|
26
|
+
this.keycloakClient = input;
|
|
27
|
+
} else {
|
|
28
|
+
this.mock = input;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
if (this.token && !this._tokenParsed)
|
|
32
|
+
this._tokenParsed = jwtDecode(this.token);
|
|
33
|
+
if (this.idToken && !this._idTokenParsed)
|
|
34
|
+
this._idTokenParsed = jwtDecode(this.idToken);
|
|
35
|
+
if (this.refreshToken && !this._refreshTokenParsed) {
|
|
36
|
+
this._refreshTokenParsed = jwtDecode(this.refreshToken);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
get tokenParsed() {
|
|
40
|
+
if (this.keycloakClient)
|
|
41
|
+
return this.keycloakClient.tokenParsed;
|
|
42
|
+
return this._tokenParsed;
|
|
43
|
+
}
|
|
44
|
+
get idTokenParsed() {
|
|
45
|
+
if (this.keycloakClient)
|
|
46
|
+
return this.keycloakClient.idTokenParsed;
|
|
47
|
+
return this._idTokenParsed;
|
|
48
|
+
}
|
|
49
|
+
get refreshTokenParsed() {
|
|
50
|
+
if (this.keycloakClient)
|
|
51
|
+
return this.keycloakClient.refreshTokenParsed;
|
|
52
|
+
return this._refreshTokenParsed;
|
|
53
|
+
}
|
|
54
|
+
get clientId() {
|
|
55
|
+
if (this.keycloakClient)
|
|
56
|
+
return this.keycloakClient.clientId;
|
|
57
|
+
return this.tokenParsed?.azp;
|
|
58
|
+
}
|
|
59
|
+
get email() {
|
|
60
|
+
if (this.keycloakClient)
|
|
61
|
+
return this.keycloakClient.tokenParsed?.email;
|
|
62
|
+
if (this.mock)
|
|
63
|
+
return this.mock.email;
|
|
64
|
+
return this.tokenParsed?.email;
|
|
65
|
+
}
|
|
66
|
+
get realm() {
|
|
67
|
+
if (this.keycloakClient)
|
|
68
|
+
return this.keycloakClient.realm;
|
|
69
|
+
return this.tokenParsed?.iss?.split("/").pop();
|
|
70
|
+
}
|
|
71
|
+
get realmAccess() {
|
|
72
|
+
if (this.keycloakClient)
|
|
73
|
+
return this.keycloakClient.realmAccess;
|
|
74
|
+
return this.tokenParsed?.realm_access;
|
|
75
|
+
}
|
|
76
|
+
get resourceAccess() {
|
|
77
|
+
if (this.keycloakClient)
|
|
78
|
+
return this.keycloakClient.resourceAccess;
|
|
79
|
+
return this.tokenParsed?.resource_access;
|
|
80
|
+
}
|
|
81
|
+
get sessionId() {
|
|
82
|
+
if (this.keycloakClient)
|
|
83
|
+
return this.keycloakClient.sessionId;
|
|
84
|
+
return this.tokenParsed?.session_state;
|
|
85
|
+
}
|
|
86
|
+
get subject() {
|
|
87
|
+
if (this.keycloakClient)
|
|
88
|
+
return this.keycloakClient.subject;
|
|
89
|
+
return this.tokenParsed?.sub;
|
|
90
|
+
}
|
|
91
|
+
get username() {
|
|
92
|
+
if (this.mock)
|
|
93
|
+
return this.mock.username;
|
|
94
|
+
return this.tokenParsed?.preferred_username;
|
|
95
|
+
}
|
|
96
|
+
async login(options = {}) {
|
|
97
|
+
if (this.keycloakClient) {
|
|
98
|
+
await this.keycloakClient.login(options);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
async logout(options = {}) {
|
|
102
|
+
if (this.keycloakClient) {
|
|
103
|
+
await this.keycloakClient.logout(options);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
async isAuthenticated() {
|
|
107
|
+
if (this.mock)
|
|
108
|
+
return true;
|
|
109
|
+
if (this.keycloakClient)
|
|
110
|
+
return !!this.keycloakClient.authenticated;
|
|
111
|
+
if (MultiPlatform.isNext)
|
|
112
|
+
return !!await getSession();
|
|
113
|
+
if (!this.tokenParsed?.exp)
|
|
114
|
+
return false;
|
|
115
|
+
return this.tokenParsed.exp > Date.now() / 1e3;
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
function useKeycloak() {
|
|
119
|
+
const { token, refreshToken, idToken } = useExpoKeycloak();
|
|
120
|
+
if (MultiPlatform.isServer)
|
|
121
|
+
return;
|
|
122
|
+
if (MultiPlatform.isStorybook) {
|
|
123
|
+
return new Keycloak({
|
|
124
|
+
email: "storybook@example.com",
|
|
125
|
+
username: "storybook"
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
if (token)
|
|
129
|
+
return new Keycloak(token, idToken, refreshToken);
|
|
130
|
+
}
|
|
131
|
+
export {
|
|
132
|
+
Keycloak,
|
|
133
|
+
useKeycloak
|
|
134
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React__default, { PropsWithChildren } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* File: /src/provider/AfterAuth.tsx
|
|
5
|
+
* Project: @multiplatform.one/keycloak
|
|
6
|
+
* File Created: 10-01-2024 12:41:33
|
|
7
|
+
* Author: Clay Risser
|
|
8
|
+
* -----
|
|
9
|
+
* BitSpur (c) Copyright 2021 - 2024
|
|
10
|
+
*
|
|
11
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
12
|
+
* you may not use this file except in compliance with the License.
|
|
13
|
+
* You may obtain a copy of the License at
|
|
14
|
+
*
|
|
15
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
+
*
|
|
17
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
18
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
19
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20
|
+
* See the License for the specific language governing permissions and
|
|
21
|
+
* limitations under the License.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
interface AfterAuthProps extends PropsWithChildren {
|
|
25
|
+
}
|
|
26
|
+
declare function AfterAuth({ children }: AfterAuthProps): React__default.JSX.Element;
|
|
27
|
+
|
|
28
|
+
export { AfterAuth, type AfterAuthProps };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React__default, { PropsWithChildren } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* File: /src/provider/AfterAuth.tsx
|
|
5
|
+
* Project: @multiplatform.one/keycloak
|
|
6
|
+
* File Created: 10-01-2024 12:41:33
|
|
7
|
+
* Author: Clay Risser
|
|
8
|
+
* -----
|
|
9
|
+
* BitSpur (c) Copyright 2021 - 2024
|
|
10
|
+
*
|
|
11
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
12
|
+
* you may not use this file except in compliance with the License.
|
|
13
|
+
* You may obtain a copy of the License at
|
|
14
|
+
*
|
|
15
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
+
*
|
|
17
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
18
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
19
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20
|
+
* See the License for the specific language governing permissions and
|
|
21
|
+
* limitations under the License.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
interface AfterAuthProps extends PropsWithChildren {
|
|
25
|
+
}
|
|
26
|
+
declare function AfterAuth({ children }: AfterAuthProps): React__default.JSX.Element;
|
|
27
|
+
|
|
28
|
+
export { AfterAuth, type AfterAuthProps };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunk2BKS6UM5js = require('../chunk-2BKS6UM5.js');
|
|
4
|
+
require('../chunk-ZCBD6HWK.js');
|
|
5
|
+
require('../chunk-TUJRPTZE.js');
|
|
6
|
+
require('../chunk-3ZTSLDX7.js');
|
|
7
|
+
require('../chunk-I5FNGKQ6.js');
|
|
8
|
+
require('../chunk-VS4M7GMO.js');
|
|
9
|
+
require('../chunk-ZW4GP2I5.js');
|
|
10
|
+
require('../chunk-YACGLW5Q.js');
|
|
11
|
+
require('../chunk-NH335CDK.js');
|
|
12
|
+
require('../chunk-32AVT4GA.js');
|
|
13
|
+
require('../chunk-A2V2S4HP.js');
|
|
14
|
+
require('../chunk-2VDDEPLF.js');
|
|
15
|
+
require('../chunk-P57PW2II.js');
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
exports.AfterAuth = _chunk2BKS6UM5js.AfterAuth;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AfterAuth
|
|
3
|
+
} from "../chunk-Y23BWOII.mjs";
|
|
4
|
+
import "../chunk-HH32BME2.mjs";
|
|
5
|
+
import "../chunk-L3HTVJ4B.mjs";
|
|
6
|
+
import "../chunk-HTWZLBA4.mjs";
|
|
7
|
+
import "../chunk-UKSHA3X3.mjs";
|
|
8
|
+
import "../chunk-OBB23GPX.mjs";
|
|
9
|
+
import "../chunk-UH4K7HGE.mjs";
|
|
10
|
+
import "../chunk-2L5TXBDK.mjs";
|
|
11
|
+
import "../chunk-FU4CT24B.mjs";
|
|
12
|
+
import "../chunk-JAFUI2JQ.mjs";
|
|
13
|
+
import "../chunk-WMH347OL.mjs";
|
|
14
|
+
import "../chunk-6FRYV4MK.mjs";
|
|
15
|
+
import "../chunk-ZFXKCRJC.mjs";
|
|
16
|
+
export {
|
|
17
|
+
AfterAuth
|
|
18
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React__default, { PropsWithChildren } from 'react';
|
|
2
|
+
import { KeycloakConfig, KeycloakInitOptions } from 'keycloak-js';
|
|
3
|
+
import { SessionProviderProps } from 'next-auth/react';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* File: /src/provider/AuthProvider/AuthProvider.tsx
|
|
7
|
+
* Project: @multiplatform.one/keycloak
|
|
8
|
+
* File Created: 09-01-2024 11:29:20
|
|
9
|
+
* Author: Clay Risser
|
|
10
|
+
* -----
|
|
11
|
+
* BitSpur (c) Copyright 2021 - 2024
|
|
12
|
+
*
|
|
13
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
14
|
+
* you may not use this file except in compliance with the License.
|
|
15
|
+
* You may obtain a copy of the License at
|
|
16
|
+
*
|
|
17
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
18
|
+
*
|
|
19
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
20
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
21
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
22
|
+
* See the License for the specific language governing permissions and
|
|
23
|
+
* limitations under the License.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
interface AuthProviderProps extends PropsWithChildren {
|
|
27
|
+
keycloakConfig?: KeycloakConfig;
|
|
28
|
+
keycloakInitOptions?: KeycloakInitOptions;
|
|
29
|
+
sessionProvider?: Omit<SessionProviderProps, 'children'>;
|
|
30
|
+
}
|
|
31
|
+
declare function AuthProvider({ children, sessionProvider, keycloakInitOptions, keycloakConfig }: AuthProviderProps): React__default.JSX.Element;
|
|
32
|
+
interface MessageSchema {
|
|
33
|
+
type: string;
|
|
34
|
+
payload?: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { AuthProvider, type AuthProviderProps, type MessageSchema };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React__default, { PropsWithChildren } from 'react';
|
|
2
|
+
import { KeycloakConfig, KeycloakInitOptions } from 'keycloak-js';
|
|
3
|
+
import { SessionProviderProps } from 'next-auth/react';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* File: /src/provider/AuthProvider/AuthProvider.tsx
|
|
7
|
+
* Project: @multiplatform.one/keycloak
|
|
8
|
+
* File Created: 09-01-2024 11:29:20
|
|
9
|
+
* Author: Clay Risser
|
|
10
|
+
* -----
|
|
11
|
+
* BitSpur (c) Copyright 2021 - 2024
|
|
12
|
+
*
|
|
13
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
14
|
+
* you may not use this file except in compliance with the License.
|
|
15
|
+
* You may obtain a copy of the License at
|
|
16
|
+
*
|
|
17
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
18
|
+
*
|
|
19
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
20
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
21
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
22
|
+
* See the License for the specific language governing permissions and
|
|
23
|
+
* limitations under the License.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
interface AuthProviderProps extends PropsWithChildren {
|
|
27
|
+
keycloakConfig?: KeycloakConfig;
|
|
28
|
+
keycloakInitOptions?: KeycloakInitOptions;
|
|
29
|
+
sessionProvider?: Omit<SessionProviderProps, 'children'>;
|
|
30
|
+
}
|
|
31
|
+
declare function AuthProvider({ children, sessionProvider, keycloakInitOptions, keycloakConfig }: AuthProviderProps): React__default.JSX.Element;
|
|
32
|
+
interface MessageSchema {
|
|
33
|
+
type: string;
|
|
34
|
+
payload?: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { AuthProvider, type AuthProviderProps, type MessageSchema };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkOZLV3US5js = require('../../chunk-OZLV3US5.js');
|
|
4
|
+
require('../../chunk-2BKS6UM5.js');
|
|
5
|
+
require('../../chunk-ZCBD6HWK.js');
|
|
6
|
+
require('../../chunk-TUJRPTZE.js');
|
|
7
|
+
require('../../chunk-3ZTSLDX7.js');
|
|
8
|
+
require('../../chunk-I5FNGKQ6.js');
|
|
9
|
+
require('../../chunk-VS4M7GMO.js');
|
|
10
|
+
require('../../chunk-ZW4GP2I5.js');
|
|
11
|
+
require('../../chunk-YACGLW5Q.js');
|
|
12
|
+
require('../../chunk-NH335CDK.js');
|
|
13
|
+
require('../../chunk-32AVT4GA.js');
|
|
14
|
+
require('../../chunk-A2V2S4HP.js');
|
|
15
|
+
require('../../chunk-2VDDEPLF.js');
|
|
16
|
+
require('../../chunk-P57PW2II.js');
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
exports.AuthProvider = _chunkOZLV3US5js.AuthProvider;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AuthProvider
|
|
3
|
+
} from "../../chunk-CGLMLNUS.mjs";
|
|
4
|
+
import "../../chunk-Y23BWOII.mjs";
|
|
5
|
+
import "../../chunk-HH32BME2.mjs";
|
|
6
|
+
import "../../chunk-L3HTVJ4B.mjs";
|
|
7
|
+
import "../../chunk-HTWZLBA4.mjs";
|
|
8
|
+
import "../../chunk-UKSHA3X3.mjs";
|
|
9
|
+
import "../../chunk-OBB23GPX.mjs";
|
|
10
|
+
import "../../chunk-UH4K7HGE.mjs";
|
|
11
|
+
import "../../chunk-2L5TXBDK.mjs";
|
|
12
|
+
import "../../chunk-FU4CT24B.mjs";
|
|
13
|
+
import "../../chunk-JAFUI2JQ.mjs";
|
|
14
|
+
import "../../chunk-WMH347OL.mjs";
|
|
15
|
+
import "../../chunk-6FRYV4MK.mjs";
|
|
16
|
+
import "../../chunk-ZFXKCRJC.mjs";
|
|
17
|
+
export {
|
|
18
|
+
AuthProvider
|
|
19
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { AuthProviderProps } from './AuthProvider.mjs';
|
|
3
|
+
import 'keycloak-js';
|
|
4
|
+
import 'next-auth/react';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* File: /src/provider/AuthProvider/AuthProvider.native.tsx
|
|
8
|
+
* Project: @multiplatform.one/keycloak
|
|
9
|
+
* File Created: 09-01-2024 11:29:20
|
|
10
|
+
* Author: Clay Risser
|
|
11
|
+
* -----
|
|
12
|
+
* BitSpur (c) Copyright 2021 - 2024
|
|
13
|
+
*
|
|
14
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
15
|
+
* you may not use this file except in compliance with the License.
|
|
16
|
+
* You may obtain a copy of the License at
|
|
17
|
+
*
|
|
18
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
19
|
+
*
|
|
20
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
21
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
22
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
23
|
+
* See the License for the specific language governing permissions and
|
|
24
|
+
* limitations under the License.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
declare function AuthProvider({ children, keycloakConfig }: AuthProviderProps): React__default.JSX.Element;
|
|
28
|
+
|
|
29
|
+
export { AuthProvider };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { AuthProviderProps } from './AuthProvider.js';
|
|
3
|
+
import 'keycloak-js';
|
|
4
|
+
import 'next-auth/react';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* File: /src/provider/AuthProvider/AuthProvider.native.tsx
|
|
8
|
+
* Project: @multiplatform.one/keycloak
|
|
9
|
+
* File Created: 09-01-2024 11:29:20
|
|
10
|
+
* Author: Clay Risser
|
|
11
|
+
* -----
|
|
12
|
+
* BitSpur (c) Copyright 2021 - 2024
|
|
13
|
+
*
|
|
14
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
15
|
+
* you may not use this file except in compliance with the License.
|
|
16
|
+
* You may obtain a copy of the License at
|
|
17
|
+
*
|
|
18
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
19
|
+
*
|
|
20
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
21
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
22
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
23
|
+
* See the License for the specific language governing permissions and
|
|
24
|
+
* limitations under the License.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
declare function AuthProvider({ children, keycloakConfig }: AuthProviderProps): React__default.JSX.Element;
|
|
28
|
+
|
|
29
|
+
export { AuthProvider };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
|
+
|
|
3
|
+
var _chunk2BKS6UM5js = require('../../chunk-2BKS6UM5.js');
|
|
4
|
+
require('../../chunk-ZCBD6HWK.js');
|
|
5
|
+
require('../../chunk-TUJRPTZE.js');
|
|
6
|
+
require('../../chunk-3ZTSLDX7.js');
|
|
7
|
+
require('../../chunk-I5FNGKQ6.js');
|
|
8
|
+
require('../../chunk-VS4M7GMO.js');
|
|
9
|
+
require('../../chunk-ZW4GP2I5.js');
|
|
10
|
+
require('../../chunk-YACGLW5Q.js');
|
|
11
|
+
require('../../chunk-NH335CDK.js');
|
|
12
|
+
require('../../chunk-32AVT4GA.js');
|
|
13
|
+
require('../../chunk-A2V2S4HP.js');
|
|
14
|
+
require('../../chunk-2VDDEPLF.js');
|
|
15
|
+
require('../../chunk-P57PW2II.js');
|
|
16
|
+
|
|
17
|
+
// src/provider/AuthProvider/AuthProvider.native.tsx
|
|
18
|
+
var _react = require('react'); var _react2 = _interopRequireDefault(_react);
|
|
19
|
+
var _expokeycloakauth = require('expo-keycloak-auth');
|
|
20
|
+
function AuthProvider({ children, keycloakConfig }) {
|
|
21
|
+
return /* @__PURE__ */ _react2.default.createElement(_expokeycloakauth.KeycloakProvider, { ...keycloakConfig }, /* @__PURE__ */ _react2.default.createElement(_chunk2BKS6UM5js.AfterAuth, null, children));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
exports.AuthProvider = AuthProvider;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AfterAuth
|
|
3
|
+
} from "../../chunk-Y23BWOII.mjs";
|
|
4
|
+
import "../../chunk-HH32BME2.mjs";
|
|
5
|
+
import "../../chunk-L3HTVJ4B.mjs";
|
|
6
|
+
import "../../chunk-HTWZLBA4.mjs";
|
|
7
|
+
import "../../chunk-UKSHA3X3.mjs";
|
|
8
|
+
import "../../chunk-OBB23GPX.mjs";
|
|
9
|
+
import "../../chunk-UH4K7HGE.mjs";
|
|
10
|
+
import "../../chunk-2L5TXBDK.mjs";
|
|
11
|
+
import "../../chunk-FU4CT24B.mjs";
|
|
12
|
+
import "../../chunk-JAFUI2JQ.mjs";
|
|
13
|
+
import "../../chunk-WMH347OL.mjs";
|
|
14
|
+
import "../../chunk-6FRYV4MK.mjs";
|
|
15
|
+
import "../../chunk-ZFXKCRJC.mjs";
|
|
16
|
+
|
|
17
|
+
// src/provider/AuthProvider/AuthProvider.native.tsx
|
|
18
|
+
import React from "react";
|
|
19
|
+
import { KeycloakProvider as ExpoKeycloakProvider } from "expo-keycloak-auth";
|
|
20
|
+
function AuthProvider({ children, keycloakConfig }) {
|
|
21
|
+
return /* @__PURE__ */ React.createElement(ExpoKeycloakProvider, { ...keycloakConfig }, /* @__PURE__ */ React.createElement(AfterAuth, null, children));
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
AuthProvider
|
|
25
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../../chunk-MDAAMGTE.js');
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkOZLV3US5js = require('../../chunk-OZLV3US5.js');
|
|
5
|
+
require('../../chunk-2BKS6UM5.js');
|
|
6
|
+
require('../../chunk-ZCBD6HWK.js');
|
|
7
|
+
require('../../chunk-TUJRPTZE.js');
|
|
8
|
+
require('../../chunk-3ZTSLDX7.js');
|
|
9
|
+
require('../../chunk-I5FNGKQ6.js');
|
|
10
|
+
require('../../chunk-VS4M7GMO.js');
|
|
11
|
+
require('../../chunk-ZW4GP2I5.js');
|
|
12
|
+
require('../../chunk-YACGLW5Q.js');
|
|
13
|
+
require('../../chunk-NH335CDK.js');
|
|
14
|
+
require('../../chunk-32AVT4GA.js');
|
|
15
|
+
require('../../chunk-A2V2S4HP.js');
|
|
16
|
+
require('../../chunk-2VDDEPLF.js');
|
|
17
|
+
require('../../chunk-P57PW2II.js');
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
exports.AuthProvider = _chunkOZLV3US5js.AuthProvider;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import "../../chunk-JPQI72HR.mjs";
|
|
2
|
+
import {
|
|
3
|
+
AuthProvider
|
|
4
|
+
} from "../../chunk-CGLMLNUS.mjs";
|
|
5
|
+
import "../../chunk-Y23BWOII.mjs";
|
|
6
|
+
import "../../chunk-HH32BME2.mjs";
|
|
7
|
+
import "../../chunk-L3HTVJ4B.mjs";
|
|
8
|
+
import "../../chunk-HTWZLBA4.mjs";
|
|
9
|
+
import "../../chunk-UKSHA3X3.mjs";
|
|
10
|
+
import "../../chunk-OBB23GPX.mjs";
|
|
11
|
+
import "../../chunk-UH4K7HGE.mjs";
|
|
12
|
+
import "../../chunk-2L5TXBDK.mjs";
|
|
13
|
+
import "../../chunk-FU4CT24B.mjs";
|
|
14
|
+
import "../../chunk-JAFUI2JQ.mjs";
|
|
15
|
+
import "../../chunk-WMH347OL.mjs";
|
|
16
|
+
import "../../chunk-6FRYV4MK.mjs";
|
|
17
|
+
import "../../chunk-ZFXKCRJC.mjs";
|
|
18
|
+
export {
|
|
19
|
+
AuthProvider
|
|
20
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React__default, { PropsWithChildren } from 'react';
|
|
2
|
+
import { AuthConfig } from '../authConfig.mjs';
|
|
3
|
+
import { Session } from 'next-auth';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* File: /src/provider/KeycloakProvider.tsx
|
|
7
|
+
* Project: @multiplatform.one/keycloak
|
|
8
|
+
* File Created: 10-01-2024 13:56:05
|
|
9
|
+
* Author: Clay Risser
|
|
10
|
+
* -----
|
|
11
|
+
* BitSpur (c) Copyright 2021 - 2024
|
|
12
|
+
*
|
|
13
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
14
|
+
* you may not use this file except in compliance with the License.
|
|
15
|
+
* You may obtain a copy of the License at
|
|
16
|
+
*
|
|
17
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
18
|
+
*
|
|
19
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
20
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
21
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
22
|
+
* See the License for the specific language governing permissions and
|
|
23
|
+
* limitations under the License.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
interface KeycloakProviderProps extends PropsWithChildren, AuthConfig {
|
|
27
|
+
baseUrl?: string;
|
|
28
|
+
clientId?: string;
|
|
29
|
+
realm?: string;
|
|
30
|
+
session?: Session;
|
|
31
|
+
}
|
|
32
|
+
declare function KeycloakProvider({ children, debug, realm, clientId, baseUrl, session }: KeycloakProviderProps): React__default.JSX.Element;
|
|
33
|
+
|
|
34
|
+
export { KeycloakProvider, type KeycloakProviderProps };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React__default, { PropsWithChildren } from 'react';
|
|
2
|
+
import { AuthConfig } from '../authConfig.js';
|
|
3
|
+
import { Session } from 'next-auth';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* File: /src/provider/KeycloakProvider.tsx
|
|
7
|
+
* Project: @multiplatform.one/keycloak
|
|
8
|
+
* File Created: 10-01-2024 13:56:05
|
|
9
|
+
* Author: Clay Risser
|
|
10
|
+
* -----
|
|
11
|
+
* BitSpur (c) Copyright 2021 - 2024
|
|
12
|
+
*
|
|
13
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
14
|
+
* you may not use this file except in compliance with the License.
|
|
15
|
+
* You may obtain a copy of the License at
|
|
16
|
+
*
|
|
17
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
18
|
+
*
|
|
19
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
20
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
21
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
22
|
+
* See the License for the specific language governing permissions and
|
|
23
|
+
* limitations under the License.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
interface KeycloakProviderProps extends PropsWithChildren, AuthConfig {
|
|
27
|
+
baseUrl?: string;
|
|
28
|
+
clientId?: string;
|
|
29
|
+
realm?: string;
|
|
30
|
+
session?: Session;
|
|
31
|
+
}
|
|
32
|
+
declare function KeycloakProvider({ children, debug, realm, clientId, baseUrl, session }: KeycloakProviderProps): React__default.JSX.Element;
|
|
33
|
+
|
|
34
|
+
export { KeycloakProvider, type KeycloakProviderProps };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkX53FOCXAjs = require('../chunk-X53FOCXA.js');
|
|
4
|
+
require('../chunk-MDAAMGTE.js');
|
|
5
|
+
require('../chunk-OZLV3US5.js');
|
|
6
|
+
require('../chunk-2BKS6UM5.js');
|
|
7
|
+
require('../chunk-ZCBD6HWK.js');
|
|
8
|
+
require('../chunk-TUJRPTZE.js');
|
|
9
|
+
require('../chunk-3ZTSLDX7.js');
|
|
10
|
+
require('../chunk-I5FNGKQ6.js');
|
|
11
|
+
require('../chunk-VS4M7GMO.js');
|
|
12
|
+
require('../chunk-ZW4GP2I5.js');
|
|
13
|
+
require('../chunk-YACGLW5Q.js');
|
|
14
|
+
require('../chunk-NH335CDK.js');
|
|
15
|
+
require('../chunk-32AVT4GA.js');
|
|
16
|
+
require('../chunk-A2V2S4HP.js');
|
|
17
|
+
require('../chunk-2VDDEPLF.js');
|
|
18
|
+
require('../chunk-P57PW2II.js');
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
exports.KeycloakProvider = _chunkX53FOCXAjs.KeycloakProvider;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
KeycloakProvider
|
|
3
|
+
} from "../chunk-Y5MS3XVZ.mjs";
|
|
4
|
+
import "../chunk-JPQI72HR.mjs";
|
|
5
|
+
import "../chunk-CGLMLNUS.mjs";
|
|
6
|
+
import "../chunk-Y23BWOII.mjs";
|
|
7
|
+
import "../chunk-HH32BME2.mjs";
|
|
8
|
+
import "../chunk-L3HTVJ4B.mjs";
|
|
9
|
+
import "../chunk-HTWZLBA4.mjs";
|
|
10
|
+
import "../chunk-UKSHA3X3.mjs";
|
|
11
|
+
import "../chunk-OBB23GPX.mjs";
|
|
12
|
+
import "../chunk-UH4K7HGE.mjs";
|
|
13
|
+
import "../chunk-2L5TXBDK.mjs";
|
|
14
|
+
import "../chunk-FU4CT24B.mjs";
|
|
15
|
+
import "../chunk-JAFUI2JQ.mjs";
|
|
16
|
+
import "../chunk-WMH347OL.mjs";
|
|
17
|
+
import "../chunk-6FRYV4MK.mjs";
|
|
18
|
+
import "../chunk-ZFXKCRJC.mjs";
|
|
19
|
+
export {
|
|
20
|
+
KeycloakProvider
|
|
21
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { AfterAuth, AfterAuthProps } from './AfterAuth.mjs';
|
|
2
|
+
export { AuthProvider, AuthProviderProps, MessageSchema } from './AuthProvider/AuthProvider.mjs';
|
|
3
|
+
export { KeycloakProvider, KeycloakProviderProps } from './KeycloakProvider.mjs';
|
|
4
|
+
import 'react';
|
|
5
|
+
import 'keycloak-js';
|
|
6
|
+
import 'next-auth/react';
|
|
7
|
+
import '../authConfig.mjs';
|
|
8
|
+
import 'next-auth';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { AfterAuth, AfterAuthProps } from './AfterAuth.js';
|
|
2
|
+
export { AuthProvider, AuthProviderProps, MessageSchema } from './AuthProvider/AuthProvider.js';
|
|
3
|
+
export { KeycloakProvider, KeycloakProviderProps } from './KeycloakProvider.js';
|
|
4
|
+
import 'react';
|
|
5
|
+
import 'keycloak-js';
|
|
6
|
+
import 'next-auth/react';
|
|
7
|
+
import '../authConfig.js';
|
|
8
|
+
import 'next-auth';
|