0

I have simple Angular app, which can perform some requests over $http to remote service (couchdb) at example.com/.../myservice. Service requires auth, which done by calling specified address example.com/_session with name and password and it returns with session cookie AuthSession. Problem is that cookie is not used when calls to service is done. Maybe problem caused because cookie is per-session Http-only (and that's can't be changed).

I think the solution is grabbing cookie from auth response, store and force it into service calls manually. But I don't know how to:

  1. Get cookie from $http response
  2. Force it with $http response

Any suggestions?

UPD: pics

All cookies

all cookies

but available only this

only available cookie

Auth cookie, which sent to /_session request, but not to others

enter image description here

Arman Hayots
  • 2,459
  • 6
  • 29
  • 53
  • Can you read the auth cookie from the authentication response? If so save it to the browser's local storage and then for each `$http` request use Angular to add to to the request header. – Will.Harris Dec 16 '15 at 12:15
  • But how this can be done with Http-only cookie? – Arman Hayots Dec 16 '15 at 12:16

1 Answers1

0

There's no solution, according to this

Now I think that couchdb is a source of problem. So, I'll try to find another ways to do auth in couch manually.

Community
  • 1
  • 1
Arman Hayots
  • 2,459
  • 6
  • 29
  • 53