Alternatives to plain access_token? #953
Unanswered
FedericoHeichou
asked this question in
Q&A
Replies: 1 comment 5 replies
-
XSS is always a problem; FWIW even encrypting an access token won't help in that case as the attacker would just use the encrypted token to access the API |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a frontend with
mod_auth_openidc
and a backend API withmod_oauth2
. I'm using Keycloak.Actually I use
/redirect_uri?info=json
in the frontend, I get theaccess_token
and add it to theAuthorization
, then I send the request to the backend API.But if a XSS in the frontend happens an attacker can steal the
access_token
jwt everytime it expires and using the stolenjwt
for different APIs in the same realm.A solution would be using
mod_auth_openidc
in the backend, then share the sameOIDCCacheType
and use the session cookie (withcredentials: same-origin
) instead of access_token, but I'd prefer don't share it.Another solution would be retrieve a encrypted
access_token
in?info=json
, send it to the backend, then decrypt it in the backend, but bothmod_auth_openidc
andmod_oauth2
seems doesn't support this feature.Any suggestions?
Beta Was this translation helpful? Give feedback.
All reactions