oauth client credential
This commit is contained in:
6
pom.xml
6
pom.xml
@@ -32,17 +32,19 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-security</artifactId>
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!-- security -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
<artifactId>spring-boot-starter-security</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.security.oauth.boot</groupId>
|
<groupId>org.springframework.security.oauth.boot</groupId>
|
||||||
<artifactId>spring-security-oauth2-autoconfigure</artifactId>
|
<artifactId>spring-security-oauth2-autoconfigure</artifactId>
|
||||||
<version>2.1.4.RELEASE</version>
|
<version>2.1.4.RELEASE</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.h2database</groupId>
|
<groupId>com.h2database</groupId>
|
||||||
<artifactId>h2</artifactId>
|
<artifactId>h2</artifactId>
|
||||||
|
|||||||
@@ -166,10 +166,12 @@ public class OAuth2AuthorizationServerConfig extends AuthorizationServerConfigur
|
|||||||
if(authentication.isAuthenticated()) {
|
if(authentication.isAuthenticated()) {
|
||||||
Map<String, Object> additionalInfo = new HashMap<>();
|
Map<String, Object> additionalInfo = new HashMap<>();
|
||||||
additionalInfo.put("company", "Uengine");
|
additionalInfo.put("company", "Uengine");
|
||||||
|
if( !CLIENT_CREDENTIALS.equals(authentication.getOAuth2Request().getGrantType()) ){
|
||||||
|
User user = (User)authentication.getPrincipal();
|
||||||
|
additionalInfo.put("nickname", user.getNickName());
|
||||||
|
additionalInfo.put("address", user.getAddress());
|
||||||
|
}
|
||||||
|
|
||||||
User user = (User)authentication.getPrincipal();
|
|
||||||
additionalInfo.put("nickname", user.getNickName());
|
|
||||||
additionalInfo.put("address", user.getAddress());
|
|
||||||
// String clientId = authentication.getOAuth2Request().getClientId();
|
// String clientId = authentication.getOAuth2Request().getClientId();
|
||||||
// logger.debug("client ID : " + clientId);
|
// logger.debug("client ID : " + clientId);
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,9 @@ spring:
|
|||||||
server:
|
server:
|
||||||
port: 8090
|
port: 8090
|
||||||
|
|
||||||
|
#logging:
|
||||||
|
# level:
|
||||||
|
# org.springframework: debug
|
||||||
---
|
---
|
||||||
spring:
|
spring:
|
||||||
profiles: docker
|
profiles: docker
|
||||||
|
|||||||
Reference in New Issue
Block a user