Skip to content

Commit cde9e5f

Browse files
doc : README.md
1 parent 466323b commit cde9e5f

File tree

3 files changed

+43
-43
lines changed

3 files changed

+43
-43
lines changed

README.md

+41-41
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Spring Oauth2 EasyPlus
1+
# Spring Oauth2 EasyPlus
22

33
> App-Token based easy OAuth2 implementation built to grow with Spring Boot
44
@@ -32,21 +32,21 @@
3232
## Features
3333

3434
* Complete separation of the library and the client
35-
* Library : API
36-
* Client : DOC, Integration tester
35+
* Library : API
36+
* Client : DOC, Integration tester
3737
* Extensible: Supports multiple authorization servers and resource servers with this library.
3838
* Hybrid Resource Servers Token Verification Methods: Support for multiple verification approaches, including API calls to the authorization server, direct database validation, and local JWT decoding.
3939
* Immediate Permission (Authority) Check: Not limited to verifying the token itself, but also ensuring real-time validation of any updates to permissions in the database.
40-
40+
4141
* Authentication management based on a combination of username, client ID, and App-Token
42-
* What is an App-Token? An App-Token is a new access token generated each time the same account logs in. If the token values are the same, the same access token is shared.
42+
* What is an App-Token? An App-Token is a new access token generated each time the same account logs in. If the token values are the same, the same access token is shared.
4343

4444
| App-Token Status | Access Token Behavior |
4545
|------------------------|----------------------------|
4646
| same for the same user | Access-Token is shared |
4747
| different for the same user | Access-Token is NOT shared |
4848

49-
* Set this in your ``application.properties``.
49+
* Set this in your ``application.properties``.
5050
* App-Token Behavior Based on `io.github.patternhelloworld.securityhelper.oauth2.no-app-token-same-access-token`
5151

5252
| `no-app-token-same-access-token` Value | App-Token Status | Access Token Sharing Behavior |
@@ -89,13 +89,13 @@
8989

9090
## Dependencies
9191

92-
| Category | Dependencies |
93-
|-------------------|-------------------------------------------------------------------|
94-
| Backend-Language | Java 17 |
95-
| Backend-Framework | Spring Boot 3.3.2 (the latest version) |
96-
| Main Libraries | Spring Security 6.3.1, Spring Security Authorization Server 1.3.1 |
97-
| Package-Manager | Maven 3.6.3 (mvnw, Dockerfile) |
98-
| RDBMS | Mysql 8.0.17 |
92+
| Category | Dependencies |
93+
|-------------------|------------------------------------------------------------------------|
94+
| Backend-Language | Java 17 |
95+
| Backend-Framework | Spring Boot 3.3.2 (the latest version) |
96+
| Main Libraries | Spring Security 6.3.1, Spring Security Authorization Server 1.3.1, JPA |
97+
| Package-Manager | Maven 3.6.3 (mvnw, Dockerfile) |
98+
| RDBMS | Mysql 8.0.17 |
9999

100100
## Run the App
101101

@@ -122,12 +122,12 @@ mvnw clean install # Integration tests are done here, which creates docs by Spri
122122
## API Guide
123123

124124
### **Registration**
125-
- See the `client` folder.
126-
- As the Api module consumes JPA, adding it to Beans is required.
125+
- See the `client` folder.
126+
- As the Api module consumes JPA, adding it to Beans is required.
127127

128128
```java
129129

130-
// ADD 'io.github.patternhelloworld.securityhelper.oauth2.api'
130+
// Add 'io.github.patternhelloworld.securityhelper.oauth2.api'
131131
@SpringBootApplication(scanBasePackages = {"com.patternhelloworld.securityhelper.oauth2.client", "io.github.patternhelloworld.securityhelper.oauth2.api"})
132132
public class SpringSecurityOauth2PasswordJpaImplApplication {
133133

@@ -171,37 +171,37 @@ public class CommonDataSourceConfiguration {
171171

172172
#### "Mandatory" settings
173173

174-
- The only mandatory setting is ``client.config.securityimpl.service.userdetail.CustomUserDetailsServiceFactory``. The rest depend on your specific situation.
174+
- The only mandatory setting is ``client.config.securityimpl.service.userdetail.CustomUserDetailsServiceFactory``. The rest depend on your specific situation.
175175

176176
#### "Customizable" settings
177177

178-
- **Insert your code when events happen such as tokens created**
178+
- **Insert your code when events happen such as tokens created**
179179
- ``SecurityPointCut``
180180
- See the source code in ``client.config.securityimpl.aop``
181-
182181

183-
- **Register error user messages as desired**
182+
183+
- **Register error user messages as desired**
184184
- ``ISecurityUserExceptionMessageService``
185185
- See the source code in ``client.config.securityimpl.message``
186-
187186

188-
- **Customize the whole error payload as desired for all cases**
187+
188+
- **Customize the whole error payload as desired for all cases**
189189
- What is "all cases"?
190-
- Authorization Server ("/oauth2/token", "/api/v1/traditional-oauth/token") and Resource Server (Bearer token authentication : 401, authorization (permission) : 403)
190+
- Authorization Server ("/oauth2/token", "/api/v1/traditional-oauth/token") and Resource Server (Bearer token authentication : 401, authorization (permission) : 403)
191191
- Customize errors of the following cases
192-
- Login (/oauth2/token) : ``client.config.securityimpl.response.CustomAuthenticationFailureHandlerImpl``
193-
- Login (/api/v1/traditional-oauth/token) : ``client.config.response.error.GlobalExceptionHandler.authenticationException`` ("/api/v1/traditional-oauth/token", Resource Server (Bearer token inspection))
194-
- Resource Server (Bearer token expired or with a wrong value, 401) :``client.config.securityimpl.response.CustomAuthenticationEntryPointImpl``
195-
- Resource Server (Permission, 403, @PreAuthorized on your APIs) ``client.config.response.error.GlobalExceptionHandler.authorizationException``
192+
- Login (/oauth2/token) : ``client.config.securityimpl.response.CustomAuthenticationFailureHandlerImpl``
193+
- Login (/api/v1/traditional-oauth/token) : ``client.config.response.error.GlobalExceptionHandler.authenticationException`` ("/api/v1/traditional-oauth/token", Resource Server (Bearer token inspection))
194+
- Resource Server (Bearer token expired or with a wrong value, 401) :``client.config.securityimpl.response.CustomAuthenticationEntryPointImpl``
195+
- Resource Server (Permission, 403, @PreAuthorized on your APIs) ``client.config.response.error.GlobalExceptionHandler.authorizationException``
196196

197-
- **Customize the whole success payload as desired for the only "/oauth2/token"**
198-
- ``client.config.securityimpl.response.CustomAuthenticationSuccessHandlerImpl``
199-
- The success response payload of "/api/v1/traditional-oauth/token" is in ``api.domain.traditionaloauth.dto`` and is not yet customizable.
197+
- **Customize the whole success payload as desired for the only "/oauth2/token"**
198+
- ``client.config.securityimpl.response.CustomAuthenticationSuccessHandlerImpl``
199+
- The success response payload of "/api/v1/traditional-oauth/token" is in ``api.domain.traditionaloauth.dto`` and is not yet customizable.
200200

201-
- **Customize the verification logic for UsernamePassword and Client as desired**
201+
- **Customize the verification logic for UsernamePassword and Client as desired**
202202
- ``IOauth2AuthenticationHashCheckService``
203203

204-
- **Customize OpaqueTokenIntrospector as desired (!This is for Resource Servers)**
204+
- **Customize OpaqueTokenIntrospector as desired (!This is for Resource Servers)**
205205
- ``client.config.securityimpl.introspector.CustomResourceServerTokenIntrospector``
206206
- ```properties
207207
# Introspection type configuration:
@@ -229,7 +229,7 @@ public class CommonDataSourceConfiguration {
229229
## OAuth2 - Authorization Code
230230
- Beta
231231
- How to set it up
232-
1. Create your own login page with the /login route as indicated in the client project (In the future, this address will be customisable):
232+
1. Create your own login page with the /login route as indicated in the client project (In the future, this address will be customisable):
233233
```java
234234
@Controller
235235
public class LoginWeb {
@@ -243,14 +243,14 @@ public class CommonDataSourceConfiguration {
243243
spring.mvc.view.prefix=/templates/
244244
spring.mvc.view.suffix=.html
245245
```
246-
2. Check the login page at the "resources/templates/login.hml"
247-
3. Ensure the callback URL (http://localhost:8081/callback1) is properly set in the ``oauth2_registered_client`` table in the database.
246+
2. Check the login page at the "resources/templates/login.hml"
247+
3. Ensure the callback URL (http://localhost:8081/callback1) is properly set in the ``oauth2_registered_client`` table in the database.
248248
- How to use
249-
1. Open the web browser by connecting to ``http://localhost:8370/oauth2/authorize?response_type=code&client_id=client_customer&state=xxx&scope=read&redirect_uri=http%3A%2F%2Flocalhost%3A8081%2Fcallback1``, using the values from the ``oauth2_registered_client`` 2. Now you Login with ``[email protected] / 1234 ``
250-
2. Login with ``[email protected] / 1234 ``
251-
3. You will be redirected to
252-
``https://localhost:8081/callback1?code=215e9539-1dcb-4843-b1ea-b2d7be0a3c44&state=xxx``
253-
4. You can login with this API payload
249+
1. Open the web browser by connecting to ``http://localhost:8370/oauth2/authorize?response_type=code&client_id=client_customer&state=xxx&scope=read&redirect_uri=http%3A%2F%2Flocalhost%3A8081%2Fcallback1``, using the values from the ``oauth2_registered_client`` 2. Now you Login with ``[email protected] / 1234 ``
250+
2. Login with ``[email protected] / 1234 ``
251+
3. You will be redirected to
252+
``https://localhost:8081/callback1?code=215e9539-1dcb-4843-b1ea-b2d7be0a3c44&state=xxx``
253+
4. You can login with this API payload
254254
```http request
255255
POST /oauth2/token HTTP/1.1
256256
Host: localhost:8370
@@ -264,7 +264,7 @@ public class CommonDataSourceConfiguration {
264264
265265
## Running this App with Docker
266266
* Use the following module for Blue-Green deployment:
267-
* https://github.com/patternhelloworld/docker-blue-green-runner
267+
* https://github.com/patternhelloworld/docker-blue-green-runner
268268
* The above module references this app's Dockerfile and the entrypoint script in the .docker folder.
269269
270270
## Contribution Guide

client/src/docs/asciidoc/api-app.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
= POC : Spring Security 6 Oauth2 Password JPA Implementation
1+
= Spring Oauth2 EasyPlus
22
:doctype: book
33
:icons: font
44
:source-highlighter: highlightjs

lib/src/docs/asciidoc/api-app.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
= POC : Spring Security 6 Oauth2 Password JPA Implementation
1+
= Spring Oauth2 EasyPlus
22
:doctype: book
33
:icons: font
44
:source-highlighter: highlightjs

0 commit comments

Comments
 (0)