Add impersonation sample for token exchange
Closes gh-1604
This commit is contained in:
@@ -134,12 +134,27 @@ public class AuthorizationController {
|
||||
return "index";
|
||||
}
|
||||
|
||||
@GetMapping(value = "/authorize", params = "grant_type=token_exchange")
|
||||
public String tokenExchangeGrant(Model model) {
|
||||
@GetMapping(value = "/authorize", params = {"grant_type=token_exchange", "use_case=delegation"})
|
||||
public String tokenExchangeGrantUsingDelegation(Model model) {
|
||||
|
||||
String[] messages = this.defaultClientWebClient
|
||||
.get()
|
||||
.uri(this.userMessagesBaseUri)
|
||||
.uri(this.userMessagesBaseUri + "?use_case=delegation")
|
||||
.attributes(clientRegistrationId("user-client-authorization-code"))
|
||||
.retrieve()
|
||||
.bodyToMono(String[].class)
|
||||
.block();
|
||||
model.addAttribute("messages", messages);
|
||||
|
||||
return "index";
|
||||
}
|
||||
|
||||
@GetMapping(value = "/authorize", params = {"grant_type=token_exchange", "use_case=impersonation"})
|
||||
public String tokenExchangeGrantUsingImpersonation(Model model) {
|
||||
|
||||
String[] messages = this.defaultClientWebClient
|
||||
.get()
|
||||
.uri(this.userMessagesBaseUri + "?use_case=impersonation")
|
||||
.attributes(clientRegistrationId("user-client-authorization-code"))
|
||||
.retrieve()
|
||||
.bodyToMono(String[].class)
|
||||
|
||||
@@ -27,7 +27,8 @@
|
||||
<li><a class="dropdown-item" href="/authorize?grant_type=client_credentials&client_auth=client_secret" th:href="@{/authorize?grant_type=client_credentials&client_auth=client_secret}">Client Credentials (client_secret_basic)</a></li>
|
||||
<li><a class="dropdown-item" href="/authorize?grant_type=client_credentials&client_auth=mtls" th:href="@{/authorize?grant_type=client_credentials&client_auth=mtls}">Client Credentials (tls_client_auth)</a></li>
|
||||
<li><a class="dropdown-item" href="/authorize?grant_type=client_credentials&client_auth=self_signed_mtls" th:href="@{/authorize?grant_type=client_credentials&client_auth=self_signed_mtls}">Client Credentials (self_signed_tls_client_auth)</a></li>
|
||||
<li><a class="dropdown-item" href="/authorize?grant_type=token_exchange" th:href="@{/authorize?grant_type=token_exchange}">Token Exchange</a></li>
|
||||
<li><a class="dropdown-item" href="/authorize?grant_type=token_exchange" th:href="@{/authorize?grant_type=token_exchange&use_case=delegation}">Token Exchange (delegation)</a></li>
|
||||
<li><a class="dropdown-item" href="/authorize?grant_type=token_exchange" th:href="@{/authorize?grant_type=token_exchange&use_case=impersonation}">Token Exchange (impersonation)</a></li>
|
||||
<li><a class="dropdown-item" href="/authorize?grant_type=device_code" th:href="@{/authorize?grant_type=device_code}">Device Code</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user