-
Notifications
You must be signed in to change notification settings - Fork 101
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
force_preemptive=True is only preemptive the first time #178
Comments
…tus (requests#178) - Currently 'force_preemptive' flag sends the 'Authorization' header only for the first call and not for subsequent calls. This is because 'Authorization' header is preemptively sent only if the request is not authenticated. The status of authentication is stored as 'auth_done' instance variable. Since all the HTTP calls use the same instance of HTTPKerberosAuth class the 'auth_done' instance variable is set to True after first successful authentication and thus 'Authorization' header is not set preemptively after that. - The fix is to send the Authorization header irrespective of the authentication status of previous call.
This is because of the following reason: Currently |
…tus (requests#178) - Currently 'force_preemptive' flag sends the 'Authorization' header only for the first call and not for subsequent calls. This is because 'Authorization' header is preemptively sent only if the request is not authenticated. The status of authentication is stored as 'auth_done' instance variable. Since all the HTTP calls use the same instance of HTTPKerberosAuth class the 'auth_done' instance variable is set to True after first successful authentication and thus 'Authorization' header is not set preemptively after that. - The fix is to send the Authorization header irrespective of the authentication status of previous call.
When setting force_preemptive=True, it looks like only the first request gets an immediate 200 and all other following requests get a 401, and then a 200.
I'm essentially doing this:
requests==2.27.1
requests-kerberos==0.14.0
The text was updated successfully, but these errors were encountered: