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

Replicate attachment with IChallengeResponseAuthenticator #477

Closed
v3yr0n opened this issue Aug 1, 2015 · 6 comments
Closed

Replicate attachment with IChallengeResponseAuthenticator #477

v3yr0n opened this issue Aug 1, 2015 · 6 comments
Assignees
Milestone

Comments

@v3yr0n
Copy link

v3yr0n commented Aug 1, 2015

Hi!
I've created a oauth authenticator class for couchdb that implements IChallengeResponseAuthenticator. It worked well for documents without attachments but with attachments I get an "you are not authorized to access this db" message and the document and attachments are not replicated. I've downloaded the couchbase.lite project and searched for the problem.
I think the problem is related with the lack of this code on the SendAsyncMultipartRequest method, on the Replication.cs class.

    var challengeResponseAuth = Authenticator as IChallengeResponseAuthenticator;
    if (challengeResponseAuth != null) {
       var authHandler = clientFactory.Handler as DefaultAuthHandler;
            if (authHandler != null) {
                 authHandler.Authenticator = challengeResponseAuth;
            }
            challengeResponseAuth.PrepareWithRequest(message);
    }

I've tested and it works fine now.

Please let me know if you can fix this on the next couchbase.lite release.

Thanks!

@borrrden
Copy link
Member

borrrden commented Aug 3, 2015

Nice catch, this will go in very soon.

@borrrden borrrden added this to the 1.1.1 milestone Aug 3, 2015
@borrrden borrrden self-assigned this Aug 3, 2015
@v3yr0n
Copy link
Author

v3yr0n commented Aug 3, 2015

Cool! thanks!

@v3yr0n
Copy link
Author

v3yr0n commented Aug 11, 2015

Does anyone knows when this will be done? :)

@borrrden
Copy link
Member

This is on the schedule for this week

@v3yr0n
Copy link
Author

v3yr0n commented Aug 11, 2015

OK, thanks!

@borrrden
Copy link
Member

I've put this into the release/1.1.1 branch. It will be merged into master after the release package goes up onto Nuget.

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

No branches or pull requests

3 participants