Reputation: 1
I use keycloak as authorization server . keycloak configuration
My application.yml for Resource server -> application.yml
ResourceServer Code
@SpringBootApplication
@RestController
@EnableResourceServer
@EnableWebSecurity
public class Demo1Application {
@GetMapping("/test")
public String demo1(){
return "Test";
}
public static void main(String[] args) {
SpringApplication.run(Demo1Application.class, args);
}
}
Problem is that , when I send request as curl -H "Authorization: $Token" http://localhost:8085/test I get an error - Invalid access token . I don't figure out what is wrong .
Upvotes: 0
Views: 246
Reputation: 86
Not using Authorization: <type> <credentials> ?
Maybe try:
curl -H "Authorization: Bearer $token" http://localhost:8085/test
Upvotes: 1