-
Notifications
You must be signed in to change notification settings - Fork 118
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
Basic Auth implementation does not use login credentials provided in options.auth #204
Comments
Thanks @orolle for the very good bug report! I will look into this soon. |
Previously only Basic Authentication information from url was used. Now, also information from db.__opts.auth is used. Fixes pouchdb-community#204.
@ptitjes I tried to get the test to run, but I have a wired npm issue (nothing to do with your code) and I have no idea how to fix this. I have too little experience with npm and node.js. |
@orolle OK I'll merge it now then. I'll do a release in the next days and I'll ping you then ! |
@ptitjes thanks! The release to cljsjs is just a matter of a few days :-) |
Thanks a lot! the fix is now in production and our safari users are happy :-) |
In release v1.0.0 basic auth is implemented. This implenetation uses only credentials in provided in the database url in the form of https://user:pwd@domain.com/database. Credentials provided in options.auth are ignored.
Expected Behavior and Current Behavior
Possible Solution
In commit
function getBasicAuthHeaders(db) {...}
uses just thedb.name
to create HTTP Basic Auth header, but should also use the other options provided into Pouchdb() constructor. It seems all other HTTP header options in options are also ignored like for custom headers.Steps to Reproduce (for bugs)
The above code fails.
Context
Firstly, my usernames are email addresses. therefore i cannot use the Basic Auth in url.
Secondly, Apple Safari (iOS, desktop) has a very restrictive cookie policy which disallows web sites to see cookies from another site if the user himself did not visit the other site with visible content too. Pure CORS with session cookies in not possible with safari. workarounds exists but complicated (iframes, redirects). Therefore basic auth over HTTPS is a good solution for that issue.
Your Environment
Remarks
When the fix is released, can you ping me so that I can update the clojurescript wrapper on https://clojars.org/
The text was updated successfully, but these errors were encountered: