Skip to content

Commit

Permalink
Use URL from authenticator also for local authenticator
Browse files Browse the repository at this point in the history
This patch is related to the implementation of the
MultiAuthenticator in jupyterhub/oauthenticator#459

The issue will be triggered when using more than one local provider
or mixing with oauth providers.

With multiple providers the template generates a set of buttons to
choose from to continue the login process.

For OAuth, the user will be sent to the provider login page and
the redirect at the end will continue nicely the process.

Now for the tricky part: using a local provider (e.g. PAM), the
user will be redirected to the "same page" thus the same template
will be rendered but this time to show the username/password dialog.

This will trip the workflow because of the action URL coming from
the settings and not from the authenticator. Therefore when the button
is clicked, the user will come back to the original multiple choice page
rather than continue the login.
  • Loading branch information
sgaist committed Dec 21, 2021
1 parent 225ca90 commit 1a74274
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion share/jupyterhub/templates/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@
<div id="login-main" class="container">
{% block login_container %}
{% if custom_html %}
<p>This is a test</p>
{{ custom_html | safe }}
{% elif login_service %}
<p>This is with login_service</p>
<div class="service-login">
<a role="button" class='btn btn-jupyter btn-lg' href='{{authenticator_login_url}}'>
Sign in with {{login_service}}
</a>
</div>
{% else %}
<form action="{{login_url}}?next={{next}}" method="post" role="form">
<form action="{{authenticator_login_url}}" method="post" role="form">
<div class="auth-form-header">
Sign in
</div>
Expand Down

0 comments on commit 1a74274

Please sign in to comment.