How to use Che REST API with Authorization token?
Summary
Problem
I'm struggling to interact with the REST API. Every endpoint redirects me to the Che sign in page.
Steps Taken
Get the JWT from keycloak:
curl --location 'https://keycloak.<che_url>/realms/che/protocol/openid-connect/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'client_id=<client_id> \
--data-urlencode 'client_secret=<client_secret>' \
--data-urlencode 'scope=openid email profile' \
--data-urlencode 'grant_type=password' \
--data-urlencode 'username=<username>' \
--data-urlencode 'password=<password>' \
--data-urlencode 'redirect_uri=https://<che_url>/oauth/callback'
Then use the token on an API endpoint:
curl --location 'https://<che_url>/api/user/id' \
--header 'Authorization: Bearer <jwt_token>' \
I've tried the whole jwt, the id_token and the access_token, but every time the request redirects me to the Che login page
Relevant information
Che is deployed on AWS EKS using Kubernetes
@tolusha @olexii4 folks, please take a look
Issues go stale after 180 days of inactivity. lifecycle/stale issues rot after an additional 7 days of inactivity and eventually close.
Mark the issue as fresh with /remove-lifecycle stale in a new comment.
If this issue is safe to close now please do so.
Moderators: Add lifecycle/frozen label to avoid stale mode.