API access under a third-party client keycloak #4138
-
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Thank you for reporting an issue! Pinging @EricWittmann to respond or triage. |
Beta Was this translation helpful? Give feedback.
-
The configuration env variables are all about what client the Apicurio Registry application itself uses to interact with Keycloak (e.g. when fetching the server keys and oidc endpoints). It doesn't have anything to do with which clients can be used (by other applications) to generate a JWT from Keycloak. So you can use whatever client you want to get a JWT. The question is whether the JWT is valid (by checking that it is syntactically valid and was property signed) and contains the appropriate roles to access registry. So as long as it's a valid JWT and contains the right role (e.g. When you say you "get a token from keycloak" what do you mean exactly? E.g. what oidc flow are you using to get that token? |
Beta Was this translation helpful? Give feedback.
-
I use so i mean Client Credentials Grant. Then i get the token and use it in the command -"e.g. when fetching the server keys and oidc endpoints" Can I restrict access by token only through client roles? If roles are not enabled, can I log in from any client and is this behavior normal? |
Beta Was this translation helpful? Give feedback.
-
If you do not set up any roles restriction at the client level yes, any other client within the same realm will be able to access the Apicurio Registry API, that's the whole point of the client credentials grant and having separate clients for each application, so you can identify which application is doing what. The KEYCLOAK_API_CLIENT_ID is just the identifier for the Registry application itself against keycloak. |
Beta Was this translation helpful? Give feedback.
If you do not set up any roles restriction at the client level yes, any other client within the same realm will be able to access the Apicurio Registry API, that's the whole point of the client credentials grant and having separate clients for each application, so you can identify which application is doing what. The KEYCLOAK_API_CLIENT_ID is just the identifier for the Registry application itself against keycloak.