diff --git a/src/main/resources/templates/clientdetails/register_client.html b/src/main/resources/templates/clientdetails/register_client.html index fe90f8d..12b9ebb 100644 --- a/src/main/resources/templates/clientdetails/register_client.html +++ b/src/main/resources/templates/clientdetails/register_client.html @@ -124,7 +124,7 @@ password 不推荐使用 + class="label label-danger">OAuth2.1不支持 - + 请先输入client_secret: @@ -34,17 +34,24 @@ 输入每一步必要的信息后点击其下面的链接地址. - + 从 spring-oauth-server获取 'code' redirect_uri: - - /oauth/authorize?client_id={{clientId}}&redirect_uri={{redirectUri}}&response_type=code&scope={{scope}} + + + + + + + + /oauth2/authorize?client_id={{clientId}}&redirect_uri={{redirectUri}}&response_type=code&scope={{scope}}&state={{state}} + + GET - + 用 'code' 换取 'access_token' @@ -53,10 +60,14 @@ required="required"/> - + + + + + + - /oauth/token?client_id={{clientId}}&client_secret={{clientSecret}}&grant_type=authorization_code&code={{code}}&redirect_uri={{redirectUri}} + /oauth2/token?client_id={{clientId}}&client_secret={{clientSecret}}&grant_type=authorization_code&code={{code}}&redirect_uri={{redirectUri}} POST @@ -66,7 +77,7 @@ - Test [password] + Test [password] OAuth2.1不支持 输入username, password 后点击链接地址. username: @@ -75,10 +86,15 @@ - + + + + + + + - /oauth/token?client_id={{clientId}}&client_secret={{clientSecret}}&grant_type=password&scope={{scope}}&username={{username}}&password={{password}} + /oauth2/token?client_id={{clientId}}&client_secret={{clientSecret}}&grant_type=password&scope={{scope}}&username={{username}}&password={{password}} POST @@ -92,12 +108,20 @@ redirect_uri: - - /oauth/authorize?client_id={{clientId}}&client_secret={{clientSecret}}&response_type=token&scope={{scope}}&redirect_uri={{implicitRedirectUri}} + + + + + + + + + /oauth2/authorize?client_id={{clientId}}&client_secret={{clientSecret}}&response_type=token&scope={{scope}}&redirect_uri={{implicitRedirectUri}} + + POST + GET - + @@ -113,7 +137,7 @@ - /oauth/token?client_id={{clientId}}&client_secret={{clientSecret}}&grant_type=client_credentials&scope={{scope}} + /oauth2/token?client_id={{clientId}}&client_secret={{clientSecret}}&grant_type=client_credentials&scope={{scope}} POST @@ -134,7 +158,7 @@ - /oauth/token?client_id={{clientId}}&client_secret={{clientSecret}}&grant_type=refresh_token&refresh_token={{refreshToken}} + /oauth2/token?client_id={{clientId}}&client_secret={{clientSecret}}&grant_type=refresh_token&refresh_token={{refreshToken}} POST @@ -155,10 +179,10 @@ var redirectUri = [[${clientDetailsDto.redirectUris}]]; if (redirectUri === '') { - // $scope.implicitRedirectUri = location.href; + $scope.implicitRedirectUri = location.href; $scope.redirectUri = "http://localhost:8080/unity/dashboard"; } else { - // $scope.implicitRedirectUri = "${clientDetailsDto.webServerRedirectUri}"; + $scope.implicitRedirectUri = [[${clientDetailsDto.redirectUris}]]; $scope.redirectUri = [[${clientDetailsDto.redirectUris}]]; } @@ -166,6 +190,7 @@ $scope.password = "mobile"; //a temp value $scope.refreshToken = "xYCsaPu7YV_hB6TfLbWsFBws1YvP7D_qAJFlSCvT5u-RbP6uMwEudHZaVnoyw3wuaXO-8F3t_GY"; + $scope.state = Math.floor(Math.random() * 1000000000).toString(); }];
输入每一步必要的信息后点击其下面的链接地址.
+
从 spring-oauth-server获取 'code'
用 'code' 换取 'access_token'
输入username, password 后点击链接地址.
- /oauth/authorize?client_id={{clientId}}&client_secret={{clientSecret}}&response_type=token&scope={{scope}}&redirect_uri={{implicitRedirectUri}} +