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

feature: auto-redirect to IDP when only one exists #132

Closed
clintharrison opened this issue Jul 4, 2022 · 7 comments
Closed

feature: auto-redirect to IDP when only one exists #132

clintharrison opened this issue Jul 4, 2022 · 7 comments

Comments

@clintharrison
Copy link

I'm using caddy-security with a single authn backend.

Instead of presenting a login page with a single button, it'd be great if /login redirected there immediately, since that's what the user will do anyway.

I suppose we could add a Caddyfile directive so this is opt-in behavior :)

@greenpau
Copy link
Owner

greenpau commented Jul 4, 2022

@clintharrison , have you looked into adding custom javascript to do the automatic redirect? https://authp.github.io/docs/authenticate/ui-features#javascript

@greenpau
Copy link
Owner

greenpau commented Jul 4, 2022

This feature does make sense. Will add it next time I do the refactoring of UI

@icsy7867
Copy link

Looking for this now as well.

@greenpau
Copy link
Owner

This feature is available and already implemented. Some keywords. You must configure “trust logout redirect uri” to safely use it.

@icsy7867
Copy link

Sorry for dropping in here again, I can make a new issue if that's better, but I am hoping this will be a quick answer. I am a bit confused on using "trust logout redirect uri" to automatically initiate a login. This reads as though it is used as a redirection when a logout is performed.

I tried adding this to my caddy file:
trust logout redirect uri domain {http.request.host} path /auth/oauth2/generic

Hoping that it will automate the login process. Currently I see this login portal:
image

And I would like to skip this, and automatically navigate to:
https://myapp.company.com/auth/oauth2/generic

@clintharrison
Copy link
Author

I'm also not quite connecting the dots on how configuring a trusted logout redirect URL is related to redirecting on the login screen.

@greenpau do you have any more pointers? I am still getting along just fine with redirecting in the custom template, but I'm not sure if this feature was actually implemented 🤔

@jmittermair
Copy link

Also support this feature, and I looked through the docs and don't see a way to do this without attempting custom JavaScript, as @greenpau originally mentioned above.

But it would certainly be nicer and more ergonomic to have it as part of the Caddyfile, since clicking the button is just an additional step for users with only one IdP 99% of the time, (unless they need to access the /whoami or /profile endpoints).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants