cozy / cozy-data-system

Deprecated - Data Layer for Cozy V2 Platform
https://cozy.io
GNU Affero General Public License v3.0
24 stars 21 forks source link

[DO NOT MERGE] Add WWW-Authenticate header on 401 #219

Closed aenario closed 8 years ago

aenario commented 8 years ago

This might allow cozysdk.getFileURL to work in prod.

m4dz commented 8 years ago

Nice :). Will it be sufficient to get an Authorization header that can be extracted from https://github.com/cozy/cozy-proxy/blob/master/server/controllers/devices.coffee#L285?

aenario commented 8 years ago

@m4dz @flyingrub The problem is browser appears not to use the URL embeded credentials, we need to test if this change (ie. the ds sending the proper Authenticate error along the 401 error code) solve the issue in chrome and firefox.

Otherwise, we will have no choice but to accept credentials both as header or GET variable.

http://xxxx.cozycloud.cc/ds-api/file?Authorization=
m4dz commented 8 years ago

Al'right. Telll me if you need me to test some parts!

flyingrub commented 8 years ago

can be closed :)

m4dz commented 8 years ago

@flyingrub not sure: the way @aenario proposes here to send a Realm Auth header to force auth seems a way more cleaner than passing in a query params. I suggest we keep this one open and make some more tests :smiley: