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

Easy to fix docs corrections #113

Closed
xrdy511623 opened this issue Jun 19, 2020 · 4 comments
Closed

Easy to fix docs corrections #113

xrdy511623 opened this issue Jun 19, 2020 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@xrdy511623
Copy link

xrdy511623 commented Jun 19, 2020

Bug description

in the jupyterhub_config.py, I set c.Authenticator.add_two_factor_authentication = True. However,
while I start jupyterhub service, a warning occurs that Config option add_two_factor_authentication not recognized by NativeAuthenticator. Anyone who knows where I went wrong?

Expected behaviour

I except the configuration that c.Authenticator.add_two_factor_authentication = True would take effect.

Actual behaviour

As a result, a warning occurs that Config option add_two_factor_authentication not recognized by NativeAuthenticator.

@xrdy511623 xrdy511623 added the bug Something isn't working label Jun 19, 2020
@welcome
Copy link

welcome bot commented Jun 19, 2020

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@xrdy511623
Copy link
Author

xrdy511623 commented Jul 10, 2020

I have read the source code , now I know that the official documentation is wrong. The source code like this:

allow_2fa = Bool(
        False,
        config=True,
        help=""
    )

class SignUpHandler(LocalBase):
    """Render the sign in page."""
    async def get(self):
        if not self.authenticator.enable_signup:
            raise web.HTTPError(404)

        self._register_template_path()
        html = self.render_template(
            'signup.html',
            ask_email=self.authenticator.ask_email_on_signup,
            two_factor_auth=self.authenticator.allow_2fa,
        )
        self.finish(html)

Hence, If you set c.Authenticator.allow_2fa = True, the problem should be solved.

@consideRatio consideRatio added help wanted Extra attention is needed and removed bug Something isn't working labels Jul 10, 2020
@consideRatio consideRatio reopened this Jul 10, 2020
@consideRatio consideRatio changed the title Config option add_two_factor_authentication not recognized by NativeAuthenticator Docs about add_two_factor_authentication incorrect Jul 10, 2020
@consideRatio
Copy link
Member

@xrdy511623 thanks for writing an issue about this and summarizing what the solution was! I'm opening it again until the documentation is fixed.

Issue summary

The documentation here use the wrong configuration name (add_two_factor_authentication), it should be allow_2fa.

c.Authenticator.add_two_factor_authentication = True

@xrdy511623
Copy link
Author

Also, the options.rst on minimum password length is wrong, which sets the attribute like this:
c.Authenticator.minimim_password_length = 10

However, it can not be recognized by nativeauthenticator for spelling mistake, the correct setting should be like this:

c.Authenticator.minimum_password_length = 10

@consideRatio consideRatio changed the title Docs about add_two_factor_authentication incorrect Easy to fix docs corrections Jul 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants