core icon indicating copy to clipboard operation
core copied to clipboard

Allow pure token based auth on DAV

Open ChristophWurst opened this issue 10 years ago • 21 comments

Currently we're using a Sabre plugin for HTTP basic auth, which checks the Authorization: basic xxxx header. With basic auth it's possible to authenticate either with user + login password or user + token. The latter is an interim solution to not break existing/legacy clients.

With pure token based auth, the client sends a HTTP header Authorization: token xxxx.

Steps to reproduce

  1. Generate device token
  2. Make DAV request using the Authorization: token xxx format

Expected behaviour

The client should authenticate successfully.

Actual behaviour

Auth exception is thrown as no HTTP basic header is found

ownCloud version: (see ownCloud admin page) 9.1.0.2

@LukasReschke @PVince81 @rullzer @owncloud/desktop-developers

ChristophWurst avatar May 23 '16 07:05 ChristophWurst

sabre dav provides the abstract bearer auth backend for this use case https://github.com/fruux/sabre-dav/blob/master/lib/DAV/Auth/Backend/AbstractBearer.php

DeepDiver1975 avatar May 23 '16 07:05 DeepDiver1975

Great stuff, yes.

We still need to have a fallback in case we're connecting to older ownCloud versions that don't support token based auth.

PVince81 avatar May 23 '16 08:05 PVince81

Why "bug" ? This is mostly an enhancement. @ChristophWurst

I doubt there's enough time for 9.1 before the freeze for this to be covered properly. But would be a nice addition, yes.

CC @cmonteroluque

PVince81 avatar May 23 '16 09:05 PVince81

Okay, now I realize that I have mixed up "server support" and "client support".

So first we need:

  1. make ownCloud DAV's endpoints support token auth
  2. make ownCloud's DAV client (fed shares, etc) use token auth when connecting to other ownClouds

I guess this ticket is mostly about 1) which is important for clients to be able to use token auth. In that case it might still be feasible for 9.1. @ChristophWurst can you confirm ?

PVince81 avatar May 23 '16 09:05 PVince81

Exactly, it's about the server support. If there is enough time I'd like to implement this for 9.1.

ChristophWurst avatar May 23 '16 09:05 ChristophWurst

No more time for 9.1, moving to 9.2.

PVince81 avatar May 23 '16 16:05 PVince81

@cmonteroluque FYI, note that this was not in any plan and is just nice to have

PVince81 avatar May 23 '16 16:05 PVince81

I would like @MTRichards just to make sure it can wait

ghost avatar May 26 '16 15:05 ghost

concur! thanks for asking.

MTRichards avatar May 26 '16 17:05 MTRichards

FYI, in Qt it might not be so easy to use token in the challenge/response HTTP: https://code.woboq.org/qt5/qtbase/src/network/kernel/qauthenticator.cpp.html#_ZN21QAuthenticatorPrivate17parseHttpResponseERK5QListI5QPairI10QByteArrayS2_EEb

We could still just hack it like we did before and just send our own Authorization header in the request.

FYI @ogoffart @danimo

guruz avatar Jun 06 '16 12:06 guruz

@ChristophWurst it seems that final implementation looks like

screen shot 2016-06-30 at 14 17 10

User associated to token is shown, but IMHO it´s not needed. :confused:

mcastroSG avatar Jun 30 '16 12:06 mcastroSG

User associated to token is shown, but IMHO it´s not needed.

What user?

ChristophWurst avatar Jun 30 '16 14:06 ChristophWurst

@ChristophWurst screen shot 2016-07-01 at 08 16 29

That info related to Username is also shown as user connected at right top corner

mcastroSG avatar Jul 01 '16 06:07 mcastroSG

it is needed as you have to use the very same login name for tokens that you use for logging into the browser.

ChristophWurst avatar Jul 01 '16 19:07 ChristophWurst

@PhilippSchaffrath this could be obsoleted or changed with oauth2

PVince81 avatar Dec 09 '16 18:12 PVince81

not sure if still relevant with oauth2, moving to backlog for now

@DeepDiver1975

PVince81 avatar May 15 '17 15:05 PVince81

Hey, this issue has been closed because the label status/STALE is set and there were no updates for 7 days. Feel free to reopen this issue if you deem it appropriate.

(This is an automated comment from GitMate.io.

ownclouders avatar Dec 21 '17 13:12 ownclouders

I'll let @DeepDiver1975 evaluate whether this is still relevant in the future, considering that we have oauth2 now and some slightly different plans

PVince81 avatar Dec 21 '17 14:12 PVince81

Hey, this issue has been closed because the label status/STALE is set and there were no updates for 7 days. Feel free to reopen this issue if you deem it appropriate.

(This is an automated comment from GitMate.io.)

ownclouders avatar Jan 29 '18 01:01 ownclouders

Likely already implemented with oauth token

PVince81 avatar Jan 29 '18 09:01 PVince81