I have implemented a very basic hello-world level resource provider, which can be found here:
It is based on the example code found in ExampleRestResource and HelloResourceProvider from the keycloak source code.
I can deploy it and request the resource w/o issue via curl, but when I add an authorization header like so (token truncated):
curl -H “Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5…” https://<my keycloak server>/auth/realms/<my realm>/hello
The response includes a null username, as if the authentication was not evaluated? I think I’m missing something basic somewhere. What did I do wrong?
I was trying to authenticate against the bearer token and ended up doing something similar. I guess I thought it would have been automatic if that token was presented.