@react-keycloak-refork/core 6.0.0 → 8.0.0

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/LICENSE.md CHANGED
@@ -1,24 +1,24 @@
1
- MIT License
2
-
3
- Copyright (c) 2019-present, Mattia Panzeri <mattia.panzeri93@gmail.com>
4
-
5
- Permission is hereby granted, free of charge, to any person
6
- obtaining a copy of this software and associated documentation
7
- files (the "Software"), to deal in the Software without
8
- restriction, including without limitation the rights to use,
9
- copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- copies of the Software, and to permit persons to whom the
11
- Software is furnished to do so, subject to the following
12
- conditions:
13
-
14
- The above copyright notice and this permission notice shall be
15
- included in all copies or substantial portions of the Software.
16
-
17
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
19
- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24
- OTHER DEALINGS IN THE SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2019-present, Mattia Panzeri <mattia.panzeri93@gmail.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person
6
+ obtaining a copy of this software and associated documentation
7
+ files (the "Software"), to deal in the Software without
8
+ restriction, including without limitation the rights to use,
9
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the
11
+ Software is furnished to do so, subject to the following
12
+ conditions:
13
+
14
+ The above copyright notice and this permission notice shall be
15
+ included in all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
19
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24
+ OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -1,150 +1,149 @@
1
- ![React Keycloak](/art/react-keycloak-logo.png?raw=true 'React Keycloak Logo')
2
-
3
- # React Keycloak (Keycloak >=v26 Fork) <!-- omit in toc -->
4
-
5
- > React bindings for [Keycloak](https://www.keycloak.org/). Fork of https://github.com/react-keycloak/react-keycloak.git with updated packages for keycloak >=26 support.
6
-
7
- ⚠️ **IMPORTANT NOTICE**: This fork has been updated to support Keycloak 26, but it is **NOT MAINTAINED**. We strongly recommend migrating to [NextAuth.js](https://next-auth.js.org/) for new projects, as it provides better maintenance, security updates, and broader OAuth provider support.
8
-
9
- [![NPM (scoped)](https://img.shields.io/npm/v/@react-keycloak-refork/core?label=npm%20%7C%20core)](https://www.npmjs.com/package/@react-keycloak-refork/core)
10
- [![NPM (scoped)](https://img.shields.io/npm/v/@react-keycloak-refork/web?label=npm%20%7C%20web)](https://www.npmjs.com/package/@react-keycloak-refork/web)
11
- [![NPM (scoped)](https://img.shields.io/npm/v/@react-keycloak-refork/ssr?label=npm%20%7C%20ssr)](https://www.npmjs.com/package/@react-keycloak-refork/ssr)
12
- [![NPM (scoped)](https://img.shields.io/npm/v/@react-keycloak-refork/native?label=npm%20%7C%20native)](https://www.npmjs.com/package/@react-keycloak-refork/native)
13
-
14
- [![License](https://img.shields.io/github/license/react-keycloak/react-keycloak.svg)](https://github.com/react-keycloak/react-keycloak-fork/blob/master/LICENSE.md)
15
- [![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org/)
16
- [![GitHub contributors](https://img.shields.io/github/contributors/react-keycloak/react-keycloak)](https://github.com/react-keycloak/react-keycloak-fork/graphs/contributors)
17
- [![Github Issues](https://img.shields.io/github/issues/react-keycloak/react-keycloak.svg)](https://github.com/react-keycloak/react-keycloak/issues) ![npm](https://img.shields.io/npm/dm/@react-keycloak-refork/core)
18
-
19
- [![Gitter](https://img.shields.io/gitter/room/react-keycloak/community)](https://gitter.im/react-keycloak/community)
20
-
21
- ---
22
-
23
- ## Table of Contents <!-- omit in toc -->
24
-
25
- - [Integrations](#integrations)
26
- - [React](#react)
27
- - [SSR](#ssr)
28
- - [React Native](#react-native)
29
- - [Support](#support)
30
- - [Examples](#examples)
31
- - [Alternatives](#alternatives)
32
- - [Contributing](#contributing)
33
- - [License](#license)
34
-
35
- ---
36
-
37
- ## Integrations
38
-
39
- ### React
40
-
41
- React Keycloak for Web requires:
42
-
43
- - React **16.0** or later
44
- - `keycloak-js` **26.0.0** or later
45
-
46
- ```shell
47
- yarn add @react-keycloak-refork/web
48
- ```
49
-
50
- or
51
-
52
- ```shell
53
- npm install --save @react-keycloak-refork/web
54
- ```
55
-
56
- or as a `UMD` package through `unpkg`
57
-
58
- See `@react-keycloak-refork/web` package [README](https://github.com/react-keycloak/react-keycloak/blob/master/packages/web/README.md) for complete documentation.
59
-
60
- ### SSR
61
-
62
- React Keycloak for SSR frameworks requires:
63
-
64
- - React **16.0** or later
65
- - SSR Framework:
66
- - NextJS **9** or later
67
- - Razzle **3** or later
68
- - `keycloak-js` **26.0.0** or later
69
-
70
- ```shell
71
- yarn add @react-keycloak-refork/ssr
72
- ```
73
-
74
- or
75
-
76
- ```shell
77
- npm install --save @react-keycloak-refork/ssr
78
- ```
79
-
80
- See `@react-keycloak-refork/ssr` package [README](https://github.com/react-keycloak/react-keycloak/blob/master/packages/ssr/README.md) for complete documentation.
81
-
82
- ### React Native
83
-
84
- React Keycloak for React Native requires React Native **61.0** or later
85
-
86
- To install run
87
-
88
- ```shell
89
- yarn add @react-keycloak-refork/native
90
- ```
91
-
92
- or
93
-
94
- ```shell
95
- npm install --save @react-keycloak-refork/native
96
- ```
97
-
98
- See `@react-keycloak-refork/native` package [README](https://github.com/react-keycloak/react-native-keycloak/blob/master/README.md) for complete documentation.
99
-
100
- ## Support
101
-
102
- | version | keycloak-js version | notes |
103
- | ------- | ------------------- | ------ |
104
- | v6.0.0+ | 26.0.0+ | (fork) |
105
- | v4.0.3+ | 26.0.0+ | (fork) |
106
- | v4.0.1+ | 17.0.0+ | (fork) |
107
- | v2.0.0+ | 9.0.2+ |
108
- | v1.x | >=8.0.2 <9.0.2 |
109
-
110
- ## Examples
111
-
112
- See [`@react-keycloak-refork/react-keycloak-examples`](https://github.com/react-keycloak/react-keycloak-examples) repository for various demo implementing this library main features.
113
-
114
- ## Alternatives
115
-
116
- If you need to connect using a more generic OIDC client instead of `keycloak.js`, consider using one of the following libraries:
117
-
118
- - [bjerkio/oidc-react](https://github.com/bjerkio/oidc-react)
119
- - [thchia/react-oidc](https://github.com/thchia/react-oidc)
120
- - [@axa-fr/react-oidc](https://github.com/AxaGuilDEv/react-oidc)
121
-
122
- ## Migration Notice
123
-
124
- ⚠️ **This project is no longer maintained**. For new projects, we strongly recommend using [NextAuth.js](https://next-auth.js.org/) instead, which provides:
125
-
126
- - ✅ Active maintenance and security updates
127
- - ✅ Support for 50+ OAuth providers including Keycloak
128
- - ✅ Better TypeScript support
129
- - ✅ Modern React patterns and hooks
130
- - ✅ Comprehensive documentation and examples
131
- - ✅ Active community and support
132
-
133
- ### Migrating to NextAuth.js
134
-
135
- To migrate from this library to NextAuth.js with Keycloak:
136
-
137
- 1. Install NextAuth.js: `npm install next-auth`
138
- 2. Configure Keycloak as a provider in your NextAuth configuration
139
- 3. Replace `useKeycloak()` hooks with NextAuth's `useSession()` and `signIn()`/`signOut()` functions
140
- 4. Update your authentication logic to use NextAuth's session management
141
-
142
- See the [NextAuth.js documentation](https://next-auth.js.org/configuration/providers/keycloak) for detailed migration instructions.
143
-
144
- ## Contributing
145
-
146
- See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
147
-
148
- ## License
149
-
150
- MIT
1
+ ![React Keycloak](/art/react-keycloak-logo.png?raw=true 'React Keycloak Logo')
2
+
3
+ # React Keycloak (Keycloak >=v26 Fork) <!-- omit in toc -->
4
+
5
+ > React bindings for [Keycloak](https://www.keycloak.org/). Fork of https://github.com/react-keycloak/react-keycloak.git with updated packages for keycloak >=26 support.
6
+
7
+ ⚠️ **IMPORTANT NOTICE**: This fork has been updated to support Keycloak 26, but it is **NOT MAINTAINED**. We strongly recommend migrating to [NextAuth.js](https://next-auth.js.org/) for new projects, as it provides better maintenance, security updates, and broader OAuth provider support.
8
+
9
+ [![NPM (scoped)](https://img.shields.io/npm/v/@react-keycloak-fork/core?label=npm%20%7C%20core)](https://www.npmjs.com/package/@react-keycloak-fork/core)
10
+ [![NPM (scoped)](https://img.shields.io/npm/v/@react-keycloak-fork/web?label=npm%20%7C%20web)](https://www.npmjs.com/package/@react-keycloak-fork/web)
11
+ [![NPM (scoped)](https://img.shields.io/npm/v/@react-keycloak-fork/ssr?label=npm%20%7C%20ssr)](https://www.npmjs.com/package/@react-keycloak-fork/ssr)
12
+ [![NPM (scoped)](https://img.shields.io/npm/v/@react-keycloak-fork/native?label=npm%20%7C%20native)](https://www.npmjs.com/package/@react-keycloak-fork/native)
13
+
14
+ [![License](https://img.shields.io/github/license/react-keycloak/react-keycloak.svg)](https://github.com/react-keycloak/react-keycloak-fork/blob/master/LICENSE.md)
15
+ [![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org/)
16
+ [![GitHub contributors](https://img.shields.io/github/contributors/react-keycloak/react-keycloak)](https://github.com/react-keycloak/react-keycloak-fork/graphs/contributors)
17
+ [![Github Issues](https://img.shields.io/github/issues/react-keycloak/react-keycloak.svg)](https://github.com/react-keycloak/react-keycloak/issues) ![npm](https://img.shields.io/npm/dm/@react-keycloak-fork/core)
18
+
19
+ [![Gitter](https://img.shields.io/gitter/room/react-keycloak/community)](https://gitter.im/react-keycloak/community)
20
+
21
+ ---
22
+
23
+ ## Table of Contents <!-- omit in toc -->
24
+
25
+ - [Integrations](#integrations)
26
+ - [React](#react)
27
+ - [SSR](#ssr)
28
+ - [React Native](#react-native)
29
+ - [Support](#support)
30
+ - [Examples](#examples)
31
+ - [Alternatives](#alternatives)
32
+ - [Contributing](#contributing)
33
+ - [License](#license)
34
+
35
+ ---
36
+
37
+ ## Integrations
38
+
39
+ ### React
40
+
41
+ React Keycloak for Web requires:
42
+
43
+ - React **19.0** or later
44
+ - `keycloak-js` **26.0.0** or later
45
+
46
+ ```shell
47
+ yarn add @react-keycloak-fork/web
48
+ ```
49
+
50
+ or
51
+
52
+ ```shell
53
+ npm install --save @react-keycloak-fork/web
54
+ ```
55
+
56
+ or as a `UMD` package through `unpkg`
57
+
58
+ See `@react-keycloak-fork/web` package [README](https://github.com/react-keycloak/react-keycloak/blob/master/packages/web/README.md) for complete documentation.
59
+
60
+ ### SSR
61
+
62
+ React Keycloak for SSR frameworks requires:
63
+
64
+ - React **19.0** or later
65
+ - SSR Framework:
66
+ - NextJS **9** or later
67
+ - Razzle **3** or later
68
+ - `keycloak-js` **26.0.0** or later
69
+
70
+ ```shell
71
+ yarn add @react-keycloak-fork/ssr
72
+ ```
73
+
74
+ or
75
+
76
+ ```shell
77
+ npm install --save @react-keycloak-fork/ssr
78
+ ```
79
+
80
+ See `@react-keycloak-fork/ssr` package [README](https://github.com/react-keycloak/react-keycloak/blob/master/packages/ssr/README.md) for complete documentation.
81
+
82
+ ### React Native
83
+
84
+ React Keycloak for React Native requires React Native **61.0** or later
85
+
86
+ To install run
87
+
88
+ ```shell
89
+ yarn add @react-keycloak-fork/native
90
+ ```
91
+
92
+ or
93
+
94
+ ```shell
95
+ npm install --save @react-keycloak-fork/native
96
+ ```
97
+
98
+ See `@react-keycloak-fork/native` package [README](https://github.com/react-keycloak/react-native-keycloak/blob/master/README.md) for complete documentation.
99
+
100
+ ## Support
101
+
102
+ | version | keycloak-js version | notes |
103
+ | ------- | ------------------- | ------ |
104
+ | v4.0.3+ | 26.0.0+ | (fork) |
105
+ | v4.0.1+ | 17.0.0+ | (fork) |
106
+ | v2.0.0+ | 9.0.2+ |
107
+ | v1.x | >=8.0.2 <9.0.2 |
108
+
109
+ ## Examples
110
+
111
+ See [`@react-keycloak-fork/react-keycloak-examples`](https://github.com/react-keycloak/react-keycloak-examples) repository for various demo implementing this library main features.
112
+
113
+ ## Alternatives
114
+
115
+ If you need to connect using a more generic OIDC client instead of `keycloak.js`, consider using one of the following libraries:
116
+
117
+ - [bjerkio/oidc-react](https://github.com/bjerkio/oidc-react)
118
+ - [thchia/react-oidc](https://github.com/thchia/react-oidc)
119
+ - [@axa-fr/react-oidc](https://github.com/AxaGuilDEv/react-oidc)
120
+
121
+ ## Migration Notice
122
+
123
+ ⚠️ **This project is no longer maintained**. For new projects, we strongly recommend using [NextAuth.js](https://next-auth.js.org/) instead, which provides:
124
+
125
+ - ✅ Active maintenance and security updates
126
+ - ✅ Support for 50+ OAuth providers including Keycloak
127
+ - ✅ Better TypeScript support
128
+ - ✅ Modern React patterns and hooks
129
+ - ✅ Comprehensive documentation and examples
130
+ - ✅ Active community and support
131
+
132
+ ### Migrating to NextAuth.js
133
+
134
+ To migrate from this library to NextAuth.js with Keycloak:
135
+
136
+ 1. Install NextAuth.js: `npm install next-auth`
137
+ 2. Configure Keycloak as a provider in your NextAuth configuration
138
+ 3. Replace `useKeycloak()` hooks with NextAuth's `useSession()` and `signIn()`/`signOut()` functions
139
+ 4. Update your authentication logic to use NextAuth's session management
140
+
141
+ See the [NextAuth.js documentation](https://next-auth.js.org/configuration/providers/keycloak) for detailed migration instructions.
142
+
143
+ ## Contributing
144
+
145
+ See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
146
+
147
+ ## License
148
+
149
+ MIT
package/lib/context.d.ts CHANGED
@@ -1,24 +1,23 @@
1
- /// <reference types="react" />
2
- import { AuthClient } from './types';
3
- /**
4
- * Auth Context props
5
- */
6
- export type IAuthContextProps<T extends AuthClient> = {
7
- /**
8
- * The single AuthClient of your application.
9
- */
10
- authClient?: T;
11
- /**
12
- * Boolean indicating whenever the AuthClient has been initialized by AuthProvider
13
- */
14
- initialized: boolean;
15
- };
16
- /**
17
- * Create a React context containing an AuthClient instance.
18
- *
19
- * @param {IAuthContextProps} initialContext initial context value.
20
- *
21
- * @returns {React.Context} the ReactKeycloak context.
22
- */
23
- export declare function createAuthContext<T extends AuthClient>(initialContext?: Partial<IAuthContextProps<T>>): React.Context<IAuthContextProps<T>>;
24
- export default createAuthContext;
1
+ import { AuthClient } from './types';
2
+ /**
3
+ * Auth Context props
4
+ */
5
+ export type IAuthContextProps<T extends AuthClient> = {
6
+ /**
7
+ * The single AuthClient of your application.
8
+ */
9
+ authClient?: T;
10
+ /**
11
+ * Boolean indicating whenever the AuthClient has been initialized by AuthProvider
12
+ */
13
+ initialized: boolean;
14
+ };
15
+ /**
16
+ * Create a React context containing an AuthClient instance.
17
+ *
18
+ * @param {IAuthContextProps} initialContext initial context value.
19
+ *
20
+ * @returns {React.Context} the ReactKeycloak context.
21
+ */
22
+ export declare function createAuthContext<T extends AuthClient>(initialContext?: Partial<IAuthContextProps<T>>): React.Context<IAuthContextProps<T>>;
23
+ export default createAuthContext;
package/lib/context.js CHANGED
@@ -1,24 +1,24 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- import { createContext } from 'react';
13
- /**
14
- * Create a React context containing an AuthClient instance.
15
- *
16
- * @param {IAuthContextProps} initialContext initial context value.
17
- *
18
- * @returns {React.Context} the ReactKeycloak context.
19
- */
20
- export function createAuthContext(initialContext) {
21
- return createContext(__assign({ initialized: false }, initialContext));
22
- }
23
- export default createAuthContext;
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { createContext } from 'react';
13
+ /**
14
+ * Create a React context containing an AuthClient instance.
15
+ *
16
+ * @param {IAuthContextProps} initialContext initial context value.
17
+ *
18
+ * @returns {React.Context} the ReactKeycloak context.
19
+ */
20
+ export function createAuthContext(initialContext) {
21
+ return createContext(__assign({ initialized: false }, initialContext));
22
+ }
23
+ export default createAuthContext;
24
24
  //# sourceMappingURL=context.js.map
package/lib/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export * from './context';
2
- export * from './provider';
3
- export * from './types';
1
+ export * from './context';
2
+ export * from './provider';
3
+ export * from './types';
package/lib/index.js CHANGED
@@ -1,5 +1,5 @@
1
- /* istanbul ignore file */
2
- export * from './context';
3
- export * from './provider';
4
- export * from './types';
1
+ /* istanbul ignore file */
2
+ export * from './context';
3
+ export * from './provider';
4
+ export * from './types';
5
5
  //# sourceMappingURL=index.js.map