I am using Spring Boot, Spring Security, OAuth2 and JWT to authenticate my application, but I keep getting this nasty error and I don\'t have any idea what is wrong. My
When oauth2 dependecncies moved to cloud, I started facing this issue. Earlier it was part of security framework :
org.springframework.security.oauth
spring-security-oauth2
Now it is part of cloud framework :
org.springframework.cloud
spring-cloud-starter-oauth2
So if you are using cloud dependency (Finchley.RELEASE) then you may need to encode the secret like below :
@Override
public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
clients
.inMemory()
.withClient("clientapp")
.authorizedGrantTypes("password","refresh_token")
.authorities("USER")
.scopes("read", "write")
.resourceIds(RESOURCE_ID)
.secret(passwordEncoder.encode("SECRET"));
}