File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
client/src/main/java/com/patternknife/securityhelper/oauth2/client/domain/customer/api Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 1
1
# Spring Security Oauth2 JPA Implementation
2
2
3
3
> App-Token based OAuth2 POC built to grow with Spring Boot and ORM
4
- >
4
+
5
+ - [ NOTICE] Test codes will be temporarily non-functional due to the introduction of the Introspector, until the next version.
6
+
5
7
## Supporting Oauth2 Type
6
8
| ROPC | Authorization Code |
7
9
| ------------------| -------------------------------------------------|
@@ -196,8 +198,8 @@ public class CommonDataSourceConfiguration {
196
198
- ** Customize the verification logic for UsernamePassword and Client as desired**
197
199
- `` IOauth2AuthenticationHashCheckService ``
198
200
199
- - ** Customize the verification logic for UsernamePassword and Client as desired **
200
- - `` IOauth2AuthenticationHashCheckService ``
201
+ - ** Customize OpaqueTokenIntrospector as desired (!Set this to your Resource Servers) **
202
+ - `` client.config.securityimpl.introspector.CustomResourceServerTokenIntrospector ``
201
203
202
204
## OAuth2 - ROPC
203
205
* Refer to `` client/src/docs/asciidoc/api-app.adoc ``
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ public class CustomerApi {
39
39
@ UserCustomerOnly
40
40
@ PreAuthorize ("isAuthenticated()" )
41
41
@ GetMapping ("/customers/me" )
42
- public CustomerResDTO .IdNameWithAccessTokenRemainingSeconds getCustomerSelf (@ AuthenticationPrincipal AccessTokenUserInfo accessTokenUserInfo ,
42
+ public CustomerResDTO .IdNameWithAccessTokenRemainingSeconds getCustomerSelf (
43
43
@ RequestHeader ("Authorization" ) String authorizationHeader ) throws ResourceNotFoundException {
44
44
String token = authorizationHeader .substring ("Bearer " .length ());
45
45
@@ -58,8 +58,8 @@ public CustomerResDTO.IdNameWithAccessTokenRemainingSeconds getCustomerSelf(@Aut
58
58
}
59
59
}
60
60
61
- return new CustomerResDTO .IdNameWithAccessTokenRemainingSeconds (customerRepository .findByIdName (accessTokenUserInfo . getUsername ())
62
- .orElseThrow (() -> new ResourceNotFoundException ("Couldn't find the user (username : " + accessTokenUserInfo . getUsername () + ")" )), accessTokenRemainingSeconds );
61
+ return new CustomerResDTO .IdNameWithAccessTokenRemainingSeconds (customerRepository .findByIdName (oAuth2Authorization . getPrincipalName ())
62
+ .orElseThrow (() -> new ResourceNotFoundException ("Couldn't find the user (username : " + oAuth2Authorization . getPrincipalName () + ")" )), accessTokenRemainingSeconds );
63
63
64
64
}
65
65
You can’t perform that action at this time.
0 commit comments