parent
cea51384e7
commit
5b4701dc6c
|
|
@ -108,11 +108,6 @@
|
||||||
<scope>system</scope>
|
<scope>system</scope>
|
||||||
<systemPath>${project.basedir}/lib/sms-util-1.0.jar</systemPath>
|
<systemPath>${project.basedir}/lib/sms-util-1.0.jar</systemPath>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.security</groupId>
|
|
||||||
<artifactId>spring-security-oauth2-client</artifactId>
|
|
||||||
<version>6.1.0</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
package com.bonus.auth.controller;
|
|
||||||
|
|
||||||
import org.springframework.security.oauth2.client.authentication.OAuth2AuthenticationToken;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.security.Principal;
|
|
||||||
|
|
||||||
@RestController
|
|
||||||
public class OAuth2Controller {
|
|
||||||
|
|
||||||
@GetMapping("/oauth2/authorize")
|
|
||||||
public String authorize() {
|
|
||||||
return "Redirect to authorization server";
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/login/oauth2/code/my-client")
|
|
||||||
public String callback(Principal principal) {
|
|
||||||
OAuth2AuthenticationToken oauth2Token = (OAuth2AuthenticationToken) principal;
|
|
||||||
return "User: " + oauth2Token.getName();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue