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

[BUG/FEATURE] OneDrive Support #68

Closed
Gamer92000 opened this issue Jan 1, 2023 · 2 comments · Fixed by #71
Closed

[BUG/FEATURE] OneDrive Support #68

Gamer92000 opened this issue Jan 1, 2023 · 2 comments · Fixed by #71

Comments

@Gamer92000
Copy link
Contributor

Hello Collaborators,

Describe the bug
When using OneDrive as the WebDav server things get weird. In short: The authentication fails because of Microsoft.

Software

  • OS: Linux (Docker)
  • Golang: 1.19.4
  • Version: 60ec5ad

To Reproduce

  1. Create a client using OneDrive credentials
  2. Try to use any (authenticated) request (e.g. ReadDir())
  3. Response is empty / unexpected (e.g. no files)

Expected
At least an authentication error should be returned. Even better would be support for MS's need to be proprietary.

Additional context
Microsoft (as expected) does not follow industry standards and instead of returning 401 on unauthenticated requests they return 302 to redirect you to the login page. The login page then return a 200 status so the webdav client thinks it is a valid result for the original request. On its own this would not be too bad as you could catch the redirect and handle it like a 401. But since Microsoft use their own authentication method (MS-PASS with Passport1.4) you also need a new authenticator.

@bai-jie
Copy link

bai-jie commented Jan 27, 2023

Related information:

One of the current workarounds:

@Gamer92000
Copy link
Contributor Author

Thanks for all the references @bai-jie!
Unfortunately, this does not work for OneDrive but only SharePoint. But it still helped a lot with getting me started.
In the end, I mostly followed MS's example for Passport1.4 though.

chripo added a commit that referenced this issue Feb 3, 2023
The main goal was to simplify the `req` method in
`request.go` and making it easier to add more authentication methods.

All the magic went into the `auth.go` file.

This feature introduces an `Authorizer` which acts as an
`Authenticator` factory. Under the hood it creates an authenticator
shim per request, which delegates the authentication flow
to our authenticators.

The authentication flow itself is broken down into `Authorize' and
`Verify' steps to encapsulate and control complex authentication challenges.

Furthermore, the default `NewAutoAuth' authenticator can be overridden
by a custom implementation for more control over flow and resources.
The `NewBacisAuth` Authorizer gives us the feel of the old days.
chripo added a commit that referenced this issue Feb 3, 2023
The main goal was to simplify the `req` method in
`request.go` and making it easier to add more authentication methods.

All the magic went into the `auth.go` file.

This feature introduces an `Authorizer` which acts as an
`Authenticator` factory. Under the hood it creates an authenticator
shim per request, which delegates the authentication flow
to our authenticators.

The authentication flow itself is broken down into `Authorize' and
`Verify' steps to encapsulate and control complex authentication challenges.

Furthermore, the default `NewAutoAuth' authenticator can be overridden
by a custom implementation for more control over flow and resources.
The `NewBacisAuth` Authorizer gives us the feel of the old days.
chripo added a commit that referenced this issue Feb 3, 2023
The main goal was to simplify the `req` method in
`request.go` and making it easier to add more authentication methods.

All the magic went into the `auth.go` file.

This feature introduces an `Authorizer` which acts as an
`Authenticator` factory. Under the hood it creates an authenticator
shim per request, which delegates the authentication flow
to our authenticators.

The authentication flow itself is broken down into `Authorize' and
`Verify' steps to encapsulate and control complex authentication challenges.

Furthermore, the default `NewAutoAuth` authenticator can be overridden
by a custom implementation for more control over flow and resources.
The `NewBacisAuth` Authorizer gives us the feel of the old days.
chripo added a commit that referenced this issue Feb 3, 2023
The main goal was to simplify the `req` method in
`request.go` and making it easier to add more authentication methods.

All the magic went into the `auth.go` file.

This feature introduces an `Authorizer` which acts as an
`Authenticator` factory. Under the hood it creates an authenticator
shim per request, which delegates the authentication flow
to our authenticators.

The authentication flow itself is broken down into `Authorize` and
`Verify' steps to encapsulate and control complex authentication challenges.

Furthermore, the default `NewAutoAuth` authenticator can be overridden
by a custom implementation for more control over flow and resources.
The `NewBacisAuth` Authorizer gives us the feel of the old days.
chripo added a commit that referenced this issue Feb 3, 2023
The main goal was to simplify the `req` method in
`request.go` and making it easier to add more authentication methods.

All the magic went into the `auth.go` file.

This feature introduces an `Authorizer` which acts as an
`Authenticator` factory. Under the hood it creates an authenticator
shim per request, which delegates the authentication flow
to our authenticators.

The authentication flow itself is broken down into `Authorize` and
`Verify' steps to encapsulate and control complex authentication challenges.

Furthermore, the default `NewAutoAuth` authenticator can be overridden
by a custom implementation for more control over flow and resources.
The `NewBacisAuth` Authorizer gives us the feel of the old days.
@chripo chripo linked a pull request Feb 11, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants