Skip to content

Commit 79f845a

Browse files
doc : add more instructions on using this library
1 parent 9e61d71 commit 79f845a

File tree

7 files changed

+37
-10
lines changed

7 files changed

+37
-10
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ public class CommonDataSourceConfiguration {
158158
}
159159
```
160160

161-
### **Implementation of...**
161+
### **Implementations**
162+
- As indicated, the ``client`` folder demonstrates how to use this library.
162163

163164
#### "Mandatory" settings
164165

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
package com.patternknife.securityhelper.oauth2.client.config.securityimpl.aop;
22

3-
43
import io.github.patternknife.securityhelper.oauth2.api.config.security.aop.SecurityPointCut;
5-
64
import io.github.patternknife.securityhelper.oauth2.api.config.security.entity.KnifeAuthorization;
75
import io.github.patternknife.securityhelper.oauth2.api.config.security.entity.KnifeClient;
86
import jakarta.annotation.Nullable;
97
import lombok.RequiredArgsConstructor;
108

119
import org.springframework.stereotype.Service;
1210

11+
/*
12+
*
13+
* The functionality is already implemented in the library's
14+
* 'io.github.patternknife.securityhelper.oauth2.api.config.security.aop.DefaultSecurityPointCut'.
15+
*
16+
* Create this class only if you need a custom implementation that differs from the default.
17+
*/
1318
@Service
1419
@RequiredArgsConstructor
15-
public class SecurityPointCutImpl implements SecurityPointCut {
20+
public class CustomSecurityPointCutImpl implements SecurityPointCut {
1621
@Override
1722
public <T> @Nullable T afterTokensSaved(@Nullable KnifeAuthorization knifeAuthorization, @Nullable KnifeClient knifeClient) {
1823
// Implement what you need right after tokens are persisted.

client/src/main/java/com/patternknife/securityhelper/oauth2/client/config/securityimpl/guard/AccessTokenUserInfo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313

1414
/*
15-
* If there are other modules, this class must also be located in com.patternknife.securityhelper.oauth2.interestedtreatmentpart.dto.security.
15+
* If you are using another Resource server, this class must also be located in com.patternknife.securityhelper.oauth2.interestedtreatmentpart.dto.security.
1616
* */
1717
public class AccessTokenUserInfo extends User implements OAuth2AuthenticatedPrincipal
1818
{
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,15 @@
55
import io.github.patternknife.securityhelper.oauth2.api.config.security.message.ISecurityUserExceptionMessageService;
66
import org.springframework.context.annotation.Configuration;
77

8+
/*
9+
*
10+
* The functionality is already implemented in the library's
11+
* 'io.github.patternknife.securityhelper.oauth2.api.config.security.message.DefaultSecurityMessageServiceImpl'.
12+
*
13+
* Create this class only if you need a custom implementation that differs from the default.
14+
*/
815
@Configuration
9-
public class SecurityMessageServiceImpl implements ISecurityUserExceptionMessageService {
16+
public class CustomSecurityMessageServiceImpl implements ISecurityUserExceptionMessageService {
1017

1118
@Override
1219
public String getUserMessage(DefaultSecurityUserExceptionMessage defaultSecurityUserExceptionMessage) {

client/src/main/java/com/patternknife/securityhelper/oauth2/client/config/securityimpl/response/CustomAuthenticationEntryPointImpl.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@
1111

1212
import java.io.IOException;
1313

14+
/*
15+
*
16+
* The functionality is already implemented in the library's
17+
* 'io.github.patternknife.securityhelper.oauth2.api.config.security.response.resource.authentication.DefaultAuthenticationEntryPoint'.
18+
*
19+
* Create this class only if you need a custom implementation that differs from the default.
20+
*/
1421
@Configuration
1522
@RequiredArgsConstructor
1623
public class CustomAuthenticationEntryPointImpl implements AuthenticationEntryPoint {

client/src/main/java/com/patternknife/securityhelper/oauth2/client/config/securityimpl/response/CustomAuthenticationFailureHandlerImpl.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.patternknife.securityhelper.oauth2.client.config.securityimpl.response;
22

3-
43
import com.fasterxml.jackson.databind.ObjectMapper;
54
import io.github.patternknife.securityhelper.oauth2.api.config.logger.KnifeSecurityLogConfig;
65
import io.github.patternknife.securityhelper.oauth2.api.config.security.message.DefaultSecurityUserExceptionMessage;
@@ -24,10 +23,11 @@
2423

2524
/*
2625
*
27-
* Customize the exception payload by implementing this, which replaces
28-
* 'io.github.patternknife.securityhelper.oauth2.api.security.response.auth.authentication.CustomAuthenticationFailureHandlerImpl'
26+
* The functionality is already implemented in the library's
27+
* 'io.github.patternknife.securityhelper.oauth2.api.config.security.response.auth.authentication.DefaultAuthenticationFailureHandlerImpl'.
2928
*
30-
* */
29+
* Create this class only if you need a custom implementation that differs from the default.
30+
*/
3131
@Configuration
3232
@RequiredArgsConstructor
3333
public class CustomAuthenticationFailureHandlerImpl implements AuthenticationFailureHandler {

client/src/main/java/com/patternknife/securityhelper/oauth2/client/config/securityimpl/response/CustomAuthenticationSuccessHandlerImpl.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@
2626
import java.time.temporal.ChronoUnit;
2727
import java.util.Map;
2828

29+
/*
30+
*
31+
* The functionality is already implemented in the library's
32+
* 'io.github.patternknife.securityhelper.oauth2.api.config.security.response.auth.authentication.DefaultAuthenticationSuccessHandlerImpl'.
33+
*
34+
* Create this class only if you need a custom implementation that differs from the default.
35+
*/
2936
@Configuration
3037
@RequiredArgsConstructor
3138
public class CustomAuthenticationSuccessHandlerImpl implements AuthenticationSuccessHandler {

0 commit comments

Comments
 (0)