更新 resource
parent
c53c8c37a0
commit
a78fbd716c
|
@ -38,11 +38,12 @@ http://localhost:8080/spring-oauth-server/oauth/token?client_id=mobile-client&cl
|
|||
|
||||
|
||||
Restful OAuth2 Test [POST]
|
||||
URL: /oauth2/rest_token
|
||||
URL: /oauth/rest_token
|
||||
ContentType: application/json
|
||||
|
||||
DEMO URL: http://localhost:8080/spring-oauth-server/oauth2/rest_token
|
||||
Request Body: {"grant_type":"client_credentials","scope":"read","client_id":"credentials","client_secret":"credentials","username":"user","password":"123"}
|
||||
Request Body:
|
||||
{"grant_type":"client_credentials","scope":"read","client_id":"credentials","client_secret":"credentials","username":"user","password":"123"}
|
||||
|
||||
Response Body:
|
||||
{
|
||||
|
@ -56,7 +57,7 @@ Response Body:
|
|||
|
||||
|
||||
更多的测试请访问
|
||||
http://git.oschina.net/mkk/spring-oauth-client
|
||||
https://gitee.com/mkk/spring-oauth-client
|
||||
|
||||
|
||||
------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -47,12 +47,12 @@ public class WebSecurityConfigurer extends WebSecurityConfigurerAdapter {
|
|||
|
||||
@Override
|
||||
protected void configure(HttpSecurity http) throws Exception {
|
||||
http.csrf().ignoringAntMatchers("/oauth/authorize", "/oauth/token");
|
||||
http.csrf().ignoringAntMatchers("/oauth/authorize", "/oauth/token", "/oauth/rest_token");
|
||||
|
||||
http.authorizeRequests()
|
||||
.antMatchers("/public/**").permitAll()
|
||||
.antMatchers("/static/**").permitAll()
|
||||
.antMatchers("/oauth2/rest_token*").permitAll()
|
||||
.antMatchers("/oauth/rest_token*").permitAll()
|
||||
.antMatchers("/login*").permitAll()
|
||||
|
||||
.antMatchers("/user/**").hasAnyRole("ADMIN")
|
||||
|
|
|
@ -76,7 +76,7 @@ public class OAuthRestController implements InitializingBean, ApplicationContext
|
|||
private WebResponseExceptionTranslator providerExceptionHandler = new DefaultWebResponseExceptionTranslator();
|
||||
|
||||
|
||||
@RequestMapping(value = "/oauth2/rest_token", method = RequestMethod.POST)
|
||||
@RequestMapping(value = "/oauth/rest_token", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public OAuth2AccessToken postAccessToken(@RequestBody Map<String, String> parameters) {
|
||||
|
||||
|
|
Loading…
Reference in New Issue