This message was deleted.
# general
m
This message was deleted.
m
Hey @some-church-36962 how are you sending the request? Via the SDK?
👋 1
s
via curl / IntelliJ HTTP
m
I see, that should be the simplest way probably… Can you share some steps for me to reproduce maybe? I am not sure what the issue is tbh, would have to look a bit more into it
👍 1
s
First: Thanks for answering so quick! What I did is: 1.) Create a machine2machine Oauth2 client with grant type JWT Bearer 2.) Via Ory SDK create a trust relationship (TrustOAuth2JwtGrantIssuer) with the JWK Keys of our OIDC Provider from here: https://oidc.eks.eu-central-1.amazonaws.com/id/DF7267627A9767B1C28CD8B6A1921B08/keys - Ory API responds 200, all good 3.) Using a Service Account Token from k8s, signed with the one of the oidc public keys, to POST against the Ory API
Copy code
curl -X POST --location "<https://vigorous-haslett-xrejub05do.projects.oryapis.com/oauth2/token>" \
   -H "Content-Type: application/x-www-form-urlencoded" \
   -d "grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer&assertion=k8s_jwt_token
(URI encoding the grant type doesn't change anything regarding the error message)
Okay, I got it to work. If I set the client_id parameter explicitly, the API returns an access token. But that's not aligned with the documentation 😅
m
Hey @some-church-36962 thanks for sharing the fix! We should change the docs to make that clear.
👍 1
Can you share the working curl maybe as well 🙂
s
Sure!
Copy code
curl -X POST --location "<https://vigorous-haslett-xrejub05do.projects.oryapis.com/oauth2/token>" \
    -H "Content-Type: application/x-www-form-urlencoded" \
    -d "client_id=ca32524e4-cf35-4f40-add1-ce2d33768947&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer&assertion=k8s_jwt"
👍 1