You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: enhance introduction and authentication documentation
- Updated the introduction to provide a clearer overview of ABP React and its features.
- Expanded the authentication section to detail the OpenID Connect flow and session management.
- Added middleware documentation, outlining tenant resolution and session handling processes.
- Included best practices for security and performance in middleware usage.
- Improved structure and clarity throughout the documentation for better user guidance.
ABP React provides a comprehensive set of UI components built on top of Radix UI and styled with Tailwind CSS. These components are designed to be accessible, customizable, and consistent with the ABP design system.
10
+
11
+
## Core Components
12
+
13
+
### Custom Table
14
+
15
+
A flexible table component with sorting, filtering, and pagination:
This guide will explain how the authentication works in ABP React.
9
+
ABP React implements a secure authentication system using OpenID Connect with PKCE (Proof Key for Code Exchange) flow. This guide explains how authentication works in the application.
10
10
11
-
## NextAuth.js
11
+
## Authentication Flow
12
12
13
-
NextAuth.js is a library that provides authentication for Next.js applications. It supports multiple authentication providers. We will use it to handle the authentication in ABP React. You can find more details about NextAuth.js [here](https://next-auth.js.org/).
13
+
The authentication process follows these steps:
14
14
15
-
## Authentication Flow
15
+
1. User clicks the login button
16
+
2. System generates a PKCE code verifier and challenge
17
+
3. User is redirected to the OpenID Connect authorization endpoint
18
+
4. After successful authentication, user is redirected back to the callback URL
19
+
5. System exchanges the authorization code for tokens
20
+
6. Tokens are stored securely in Redis
21
+
7. User session is established with iron-session
22
+
23
+
## OpenID Connect Configuration
24
+
25
+
The application uses OpenID Connect with the following configuration:
This flow is the same for all the authentication providers. We will setup a custom authentication provider in the next-auth because there is no provider for OpenIddict yet. You can find more details about the authentication flow [here](https://next-auth.js.org/getting-started/client#authentication-flow).
115
+
## Logout Process
26
116
27
-
## OpenID Connect
117
+
The logout process:
28
118
29
-
To set up the authentication, you need to set up an OpenID Connect server.
30
-
Abp Application uses [OpenIddict](https://github.com/openiddict/openiddict-core) for authentication. You have to create an client with the authorization code flow. Make sure to set the redirect uri to `http://localhost:3000/api/auth/callback/openiddict`. You can find more details about the OpenIddict configuration [here](https://docs.abp.io/en/abp/latest/Authentication/OpenId-Connect).
119
+
1. Clears session data
120
+
2. Removes tokens from Redis
121
+
3. Redirects to OpenID Connect end session endpoint
122
+
4. Redirects to post-logout URL
31
123
32
-
## NextAuth.js Configuration
124
+
## Best Practices
33
125
34
-
NextAuth.js is configured in the `/pages/api/auth/[...nextauth].ts` api endpoint. You can find the file in the api directory of the abp app folder. You can find more details about the configuration [here](https://next-auth.js.org/configuration/initialization).
126
+
1. Always use environment variables for sensitive configuration
0 commit comments