ossoprovider.endpoint.TokenEndpoint:处理错误:InvalidGrantException,错误的凭据
我正在开发Spring Cloud授权服务器 ,启动服务器时没有收到任何错误,但是当我尝试访问http:// localhost:9000 / services / oauth / token时 ,我收到以下错误。
你能指导一下这个问题吗? 虽然grant_type是正确的,但我想知道为什么说无效补助金?
PluralsightSpringcloudM4SecureauthserverApplication
@SpringBootApplication @EnableAuthorizationServer @EnableResourceServer @RestController public class PluralsightSpringcloudM4SecureauthserverApplication { public static void main(String[] args) { SpringApplication.run(PluralsightSpringcloudM4SecureauthserverApplication.class, args); } @RequestMapping("/user") public Principal user(Principal user) { return user; } }
ServiceConfig
@Configuration public class ServiceConfig extends GlobalAuthenticationConfigurerAdapter { @Override public void init(AuthenticationManagerBuilder auth) throws Exception { auth.inMemoryAuthentication() .withUser("agoldberg").password("pass1").roles("USER").and() .withUser("bgoldberg").password("pass2").roles("USER", "OPERATOR"); } }
application.properties
server.port=9000 security.user.name=richard security.user.password=password security.user.role=USER server.contextPath=/services security.oauth2.client.clientId=pluralsight security.oauth2.client.clientSecret=pluralsightsecret security.oauth2.client.authorized-grant-types=authorization_code,refresh_token,password,client_credentials security.oauth2.client.scope=toll_read,toll_report
的pom.xml
org.springframework.boot spring-boot-starter-parent 1.4.1.RELEASE UTF-8 UTF-8 1.8 org.springframework.cloud spring-cloud-starter-oauth2 org.springframework.cloud spring-cloud-starter-security org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-starter-test test org.springframework.cloud spring-cloud-dependencies Camden.RELEASE pom import