mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-11 12:03:00 +00:00
Attempt at configuration
This commit is contained in:
@@ -22,6 +22,21 @@ started.
|
||||
If this configuration value is not set, then **all authenticated users will be allowed into your hub**.
|
||||
```
|
||||
|
||||
## One Time Passwords ( request_otp )
|
||||
|
||||
By setting `request_otp` to true, the login screen will show and additional password input field
|
||||
to accept an OTP:
|
||||
|
||||
```python
|
||||
c.Authenticator.request_otp = True
|
||||
```
|
||||
|
||||
By default, the prompt label is `OTP:`, but this can be changed by setting `otp_prompt`:
|
||||
|
||||
```python
|
||||
c.Authenticator.otp_prompt = 'Google Authenticator:'
|
||||
```
|
||||
|
||||
## Configure admins (`admin_users`)
|
||||
|
||||
```{note}
|
||||
|
@@ -157,6 +157,25 @@ class Authenticator(LoggingConfigurable):
|
||||
"""
|
||||
).tag(config=True)
|
||||
|
||||
otp_prompt = Any(
|
||||
"OTP:",
|
||||
help="""
|
||||
The prompt string for the extra OTP (One Time Password) field. Defaults to `OTP:`.
|
||||
|
||||
.. versionadded:: 4.1
|
||||
""",
|
||||
).tag(config=True)
|
||||
|
||||
request_otp = Bool(
|
||||
False,
|
||||
config=True,
|
||||
help="""
|
||||
Display the extra OTP (One Time Password) prompt on the login scree.
|
||||
|
||||
.. versionadded:: 4.1
|
||||
""",
|
||||
)
|
||||
|
||||
_deprecated_aliases = {
|
||||
"whitelist": ("allowed_users", "1.2"),
|
||||
"blacklist": ("blocked_users", "1.2"),
|
||||
|
@@ -105,6 +105,8 @@ class LoginHandler(BaseHandler):
|
||||
'next': self.get_argument('next', ''),
|
||||
},
|
||||
),
|
||||
"authenticator_request_otp": self.settings['request_otp'],
|
||||
"authenticator_otp_prompt": self.settings['otp_prompt'],
|
||||
"xsrf": self.xsrf_token.decode('ascii'),
|
||||
}
|
||||
custom_html = Template(
|
||||
|
@@ -64,7 +64,8 @@
|
||||
id="password_input"
|
||||
tabindex="2"
|
||||
/>
|
||||
<label for='otp_input'>OTP (if required):</label>
|
||||
{% if authenticator_request_otp %}
|
||||
<label for='otp_input'>{{ authenticator_otp_prompt }}</label>
|
||||
<input
|
||||
type="password"
|
||||
class="form-control"
|
||||
@@ -73,6 +74,7 @@
|
||||
id="otp_input"
|
||||
tabindex="3"
|
||||
/>
|
||||
{% endif %}
|
||||
|
||||
<div class="feedback-container">
|
||||
<input
|
||||
|
Reference in New Issue
Block a user