mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-05-30 16:52:13 +00:00
Polish ref doc for oauth2-client
This commit is contained in:
parent
52f0e5287b
commit
076692ceef
@ -202,7 +202,7 @@ public class OAuth2ClientController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ClientRegistrationRepository clientRegistrationRepository;
|
private ClientRegistrationRepository clientRegistrationRepository;
|
||||||
|
|
||||||
@RequestMapping("/")
|
@GetMapping("/")
|
||||||
public String index() {
|
public String index() {
|
||||||
ClientRegistration oktaRegistration =
|
ClientRegistration oktaRegistration =
|
||||||
this.clientRegistrationRepository.findByRegistrationId("okta");
|
this.clientRegistrationRepository.findByRegistrationId("okta");
|
||||||
@ -242,7 +242,7 @@ public class OAuth2ClientController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private OAuth2AuthorizedClientService authorizedClientService;
|
private OAuth2AuthorizedClientService authorizedClientService;
|
||||||
|
|
||||||
@RequestMapping("/")
|
@GetMapping("/")
|
||||||
public String index(Authentication authentication) {
|
public String index(Authentication authentication) {
|
||||||
OAuth2AuthorizedClient authorizedClient =
|
OAuth2AuthorizedClient authorizedClient =
|
||||||
this.authorizedClientService.loadAuthorizedClient("okta", authentication.getName());
|
this.authorizedClientService.loadAuthorizedClient("okta", authentication.getName());
|
||||||
@ -1041,7 +1041,7 @@ This is a convenient alternative compared to looking up the `OAuth2AuthorizedCli
|
|||||||
@Controller
|
@Controller
|
||||||
public class OAuth2ClientController {
|
public class OAuth2ClientController {
|
||||||
|
|
||||||
@RequestMapping("/")
|
@GetMapping("/")
|
||||||
public String index(@RegisteredOAuth2AuthorizedClient("okta") OAuth2AuthorizedClient authorizedClient) {
|
public String index(@RegisteredOAuth2AuthorizedClient("okta") OAuth2AuthorizedClient authorizedClient) {
|
||||||
OAuth2AccessToken accessToken = authorizedClient.getAccessToken();
|
OAuth2AccessToken accessToken = authorizedClient.getAccessToken();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user