Hi Olaf,
Just my experience, other people may have a different one.
> Nevertheless, it appeared to be to be an exposure of information like "you can use this token here" which is extremely likely to be helpful for a hacker in case of an exposed token.
> He/she would know where to attack and could easily (as long as the token is valid) inspect the services used to attack.
This is public information. We are talking about public clients (no
client secret) where the URL can be easily read on the JS code. So,
it's a false sense of security. Furthermore, if a token is stolen it
will be used widely and on the first place on the one that issued it.
> Therefore I would rather control such an implict CORS setup via (CORS) service related applications connecting to the Keycloak API to retrieve the allowed origins or managing this on the server side manually.
> That is, however, more effort therefore I can see the beauty of having the CORS list communicated by the token.
You need to control CORS on the client en on the target (Keycloak).
Otherwise you're not talking about a public client that connects
directly but about a backend server (a confidential client). In that
case, weborigins don't apply.
> The other critical aspect is one of scaling. Tokens to be used as Bearer Tokens seem to be subjected to limits of header sizes (often only 4kB) and therefore large numbers of clients (in the Allowed Origins, often implicit from the REdirectURIs with the magic "+") can cause stability and scalability issues.
We haven't had issues with token size yet, but there are a fez
mechanisms if you need it:
- you can configure what's added to the identity token.
- for the access token, keep the default scopes limited (but a client
always get) and make the rest optional (the client needs to ask for
them).
- let applications query keycloak's endpoints out of band, eg, the
token or user endpoint for extra information.
Regards,
C.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/keycloak-user/dcbf9312-f12a-4db3-9f35-f9f9c9a06c90n%40googlegroups.com.