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 11# Spring Security Oauth2 JPA Implementation
22
33> 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+
57## Supporting Oauth2 Type
68| ROPC | Authorization Code |
79| ------------------| -------------------------------------------------|
@@ -196,8 +198,8 @@ public class CommonDataSourceConfiguration {
196198 - ** Customize the verification logic for UsernamePassword and Client as desired**
197199 - `` IOauth2AuthenticationHashCheckService ``
198200
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 ``
201203
202204## OAuth2 - ROPC
203205* 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 {
3939 @ UserCustomerOnly
4040 @ PreAuthorize ("isAuthenticated()" )
4141 @ GetMapping ("/customers/me" )
42- public CustomerResDTO .IdNameWithAccessTokenRemainingSeconds getCustomerSelf (@ AuthenticationPrincipal AccessTokenUserInfo accessTokenUserInfo ,
42+ public CustomerResDTO .IdNameWithAccessTokenRemainingSeconds getCustomerSelf (
4343 @ RequestHeader ("Authorization" ) String authorizationHeader ) throws ResourceNotFoundException {
4444 String token = authorizationHeader .substring ("Bearer " .length ());
4545
@@ -58,8 +58,8 @@ public CustomerResDTO.IdNameWithAccessTokenRemainingSeconds getCustomerSelf(@Aut
5858 }
5959 }
6060
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 );
6363
6464 }
6565
You can’t perform that action at this time.
0 commit comments