Skip to content

Simplify login when only one authentication method is configured #4157

Answered by tatliHU
tatliHU asked this question in Q&A
Discussion options

You must be logged in to vote

I played with your idea a bit and while it is a good start, the solution will be much more complex. I can't just redirect to my Keycloak URL as Keycloak uses a state variable in its URL and it is unclear how it is calculated. I think that this state includes the CSRF token and the next attribute in some way as I need to pass this information.

Therefore, I think the best and most robust solution is by "pushing the buttons" from JS. I could eliminate the first click by overwriting the templates/allauth/account/login.html template:

{% load allauth socialaccount %}
{% get_providers as providers %}

{% provider_login_url providers.0 process=process scope=scope auth_params=auth_params as href %…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tatliHU
Comment options

Answer selected by tatliHU
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants