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

Chrome is asking for password every time #132

Open
duhd1993 opened this issue Aug 24, 2021 · 3 comments
Open

Chrome is asking for password every time #132

duhd1993 opened this issue Aug 24, 2021 · 3 comments
Labels

Comments

@duhd1993
Copy link

Hello, I'm using Basic auth as provided in the tutorial example.
the entry looks like

@app.route('/', methods=['GET', 'POST', 'OPTIONS', 'PUT', 'DELETE', 'HEAD', 'PATCH'])
@app.route('/<path:input_path>', methods=['GET', 'POST', 'OPTIONS', 'PUT', 'DELETE', 'HEAD', 'PATCH'])
@auth.login_required
def enter(input_path='/'):

Interestingly, firefox seems to remember the login information correctly and only asks for it once.

@miguelgrinberg
Copy link
Owner

I'm not sure there is anything that can be done from the server side. It is up to your browser to remember credentials, so this must be a problem with your Chrome installation or its configuration.

@duhd1993
Copy link
Author

Hi, it's not about my Chrome installation. I've tried fresh Chrome and on different machines. It's about the web app. For the simple ones, like the hello world example, it won't ask again. But for the one I'm using, it does not work correctly on Chrome. Maybe it's because Chrome remembers password for a specific URL, not for the domain?

@miguelgrinberg
Copy link
Owner

miguelgrinberg commented Aug 24, 2021

I'm not sure what the rules are regarding remembering credentials, but as I said, this is entirely under the control of the browser, the server cannot change those rules.

What you need to do is check if Chrome is displaying the login dialog as a result of a failed request (status code returned was 401 even though a user and password were provided), or if it displays the dialog on its own (a request without credentials was sent and responded with 401). If it is the former, then your application is rejecting the login, and this could be a bug in your code. If it is the latter, then it is Chrome deciding that given the URL, it does not have any credentials to use for it. This could be because the subdomain is different, or maybe the path, I'm not sure exactly what is the criteria for those saved credentials.

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

No branches or pull requests

2 participants