client, jsp -> html , test flow
parent
b7ca59883c
commit
10853f03c7
|
@ -355,4 +355,16 @@ public class OauthClientDetailsDto implements Serializable {
|
||||||
public void setTokenSettings(TokenSettingsDto tokenSettings) {
|
public void setTokenSettings(TokenSettingsDto tokenSettings) {
|
||||||
this.tokenSettings = tokenSettings;
|
this.tokenSettings = tokenSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 逗号, 转化为 ' '
|
||||||
|
*
|
||||||
|
* @return scopes
|
||||||
|
*/
|
||||||
|
public String getScopesWithBlank() {
|
||||||
|
if (scopes != null && scopes.contains(",")) {
|
||||||
|
return scopes.replaceAll(",", " ");
|
||||||
|
}
|
||||||
|
return scopes;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -107,8 +107,11 @@
|
||||||
<p class="text-muted">点击链接地址即可测试</p>
|
<p class="text-muted">点击链接地址即可测试</p>
|
||||||
|
|
||||||
|
|
||||||
<form action="${contextPath}/oauth/token?client_id={{clientId}}&client_secret={{clientSecret}}&grant_type=client_credentials&scope={{scope}}"
|
<form th:action="@{/oauth2/token}" th:method="post" target="_blank">
|
||||||
method="post" target="_blank">
|
<input type="hidden" name="client_id" value="{{clientId}}"/>
|
||||||
|
<input type="hidden" name="client_secret" value="{{clientSecret}}"/>
|
||||||
|
<input type="hidden" name="scope" value="{{scope}}"/>
|
||||||
|
<input type="hidden" name="grant_type" value="client_credentials"/>
|
||||||
<button class="btn btn-link" type="submit">
|
<button class="btn btn-link" type="submit">
|
||||||
/oauth/token?client_id={{clientId}}&client_secret={{clientSecret}}&grant_type=client_credentials&scope={{scope}}
|
/oauth/token?client_id={{clientId}}&client_secret={{clientSecret}}&grant_type=client_credentials&scope={{scope}}
|
||||||
</button>
|
</button>
|
||||||
|
@ -125,8 +128,11 @@
|
||||||
|
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
<form action="${contextPath}/oauth/token?client_id={{clientId}}&client_secret={{clientSecret}}&grant_type=refresh_token&refresh_token={{refreshToken}}"
|
<form th:action="@{/oauth2/token}" th:method="post" target="_blank">
|
||||||
method="post" target="_blank">
|
<input type="hidden" name="client_id" value="{{clientId}}"/>
|
||||||
|
<input type="hidden" name="client_secret" value="{{clientSecret}}"/>
|
||||||
|
<input type="hidden" name="refresh_token" value="{{refreshToken}}"/>
|
||||||
|
<input type="hidden" name="grant_type" value="refresh_token"/>
|
||||||
<button class="btn btn-link" type="submit">
|
<button class="btn btn-link" type="submit">
|
||||||
/oauth/token?client_id={{clientId}}&client_secret={{clientSecret}}&grant_type=refresh_token&refresh_token={{refreshToken}}
|
/oauth/token?client_id={{clientId}}&client_secret={{clientSecret}}&grant_type=refresh_token&refresh_token={{refreshToken}}
|
||||||
</button>
|
</button>
|
||||||
|
@ -145,10 +151,10 @@
|
||||||
var TestClientCtrl = ["$scope", function ($scope) {
|
var TestClientCtrl = ["$scope", function ($scope) {
|
||||||
$scope.clientId = [[${clientDetailsDto.clientId}]];
|
$scope.clientId = [[${clientDetailsDto.clientId}]];
|
||||||
$scope.clientSecret = "";
|
$scope.clientSecret = "";
|
||||||
$scope.scope = [[${clientDetailsDto.scopes}]];
|
$scope.scope = [[${clientDetailsDto.scopesWithBlank}]];
|
||||||
|
|
||||||
var emptyRedirectUri = [[${empty clientDetailsDto.redirectUris}]];
|
var redirectUri = [[${clientDetailsDto.redirectUris}]];
|
||||||
if (emptyRedirectUri) {
|
if (redirectUri === '') {
|
||||||
// $scope.implicitRedirectUri = location.href;
|
// $scope.implicitRedirectUri = location.href;
|
||||||
$scope.redirectUri = "http://localhost:8080/unity/dashboard";
|
$scope.redirectUri = "http://localhost:8080/unity/dashboard";
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue