You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Hank Knight <hk...@gmail.com> on 2014/01/09 17:07:07 UTC

CouchDB: Information about current user

This returns information in JSON format about the user "xyz":
http://example.com/_users/org.couchdb.user%3Axyz

How can I get the same information in the same format for the current
user, based on the username the use used to log in?

Re: CouchDB: Information about current user

Posted by Alexander Shorin <kx...@gmail.com>.
GET /_session [1]
grab value from /userCtx/name => $name
GET /_users/org.couchdb.user%3A$name

Note, that there is no any "current" user, but only stateless requests
with some authentication "token" (Authentication header, Cookie, OAuth
things etc.) which allows CouchDB to apply context of related user on
request processing.

[1]: http://docs.couchdb.org/en/latest/api/server/authn.html#get--_session

--
,,,^..^,,,


On Thu, Jan 9, 2014 at 8:07 PM, Hank Knight <hk...@gmail.com> wrote:
> This returns information in JSON format about the user "xyz":
> http://example.com/_users/org.couchdb.user%3Axyz
>
> How can I get the same information in the same format for the current
> user, based on the username the use used to log in?