Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for setting X-FRAME-OPTIONS and CSP #9712

Open
idc77 opened this issue May 13, 2024 · 2 comments
Open

Add support for setting X-FRAME-OPTIONS and CSP #9712

idc77 opened this issue May 13, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@idc77
Copy link

idc77 commented May 13, 2024

Is your feature request related to a problem? Please describe.
When doing silent refresh with oidc-client-ts authentik returns X-FRAME-OPTIONS: deny, making it impossible to refresh a token.
Since the access_token lifetime is by default very short (5min) this leads to authentik not being usable.

Describe the solution you'd like
Add X-FRAME-OPTIONS and Content Security Policy settings.

Describe alternatives you've considered
Not use authentik.

Additional context
oidc-client-ts does silent renew in an iframe, as does keycloak-js and likely other oidc clients.
Forcing a user to hit the login button every 5 minutes is not acceptable, increasing the token lifetime likewise isn't.
Authentik already does too much magic with CORS and redirect_uri binding.
Add the possibility to set custom X-FRAME-OPTIONS and CSP.

@idc77 idc77 added the enhancement New feature or request label May 13, 2024
@idc77
Copy link
Author

idc77 commented May 15, 2024

I've now tested oidc-client-ts with Keycloak, which doesn't set X-FRAME-OPTIONS to DENY and has
keycloak-security

Content-Security-Policy: frame-src 'self'; frame-ancestors 'self'; object-src 'none';

I wonder how no one else ever had an issue or has reported any issue with authentik when used in a SPA or PWA.
Is everyone just using confidential clients? In that case of course this issue never surfaces.
Or people just generally don't use oidc and just use this for ready-made apps.

I also wonder why I can't add this application I created with its provider to the default outpost.
Would that fix that problem? No idea.
Likewise I'm not sure if Go is doing the oidc serving or if python is part of that anywhere.
One picks Go for performance and resource usage, when you just have a proxy with Go in front of a Python API, that's quite non-sensical.
But maybe I got it all wrong.

All I know is, oidc-client-ts with authentik can't refresh/renew tokens and I'm getting a timeout and an error in chromium that the request was denied because X-FRAME-OPTIONS is set to DENY, and there is no way I can see that I can add them on a per provider or application basis in authentik.

So for me authentik is unable to perform its purpose.
I'll have to look elsewhere, also because there has been ZERO feedback.

@AdamsGH
Copy link

AdamsGH commented May 16, 2024

It's be really a good option if we can control X-Frame-Options. Try to fix my app refresh a few hours, buy only now realize this is Authentik trouble. As a temporary solution for Chrome - this extention works for me

UPD: For me increasing time at provider setting make life really better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants