Skip to content
This repository has been archived by the owner on Jul 12, 2020. It is now read-only.

How to login

Reza Akhavan edited this page Jan 30, 2018 · 19 revisions

When you POST a username and password to /api/login successfully, you'll get a response like this:

{
	"user": {
		"_id": "541e4391994e101f007242f5",
		"username": "root",
		"email": "jedireza@gmail.com",
		"roles": {
			"admin": {
				"id": "541e4391994e101f007242f4",
				"name": "Root Admin"
			}
		}
	},
	"session": {
		"userId": "541e4391994e101f007242f5",
		"key": "12251f61-0a27-430e-9290-e361689afa8b",
		"time": "2014-10-21T07:27:51.326Z",
		"_id": "54460af730186a02009ca05e"
	},
	"authHeader": "Basic cm9vdDo2NGY2Y2YzYi1iYzkxLTQyYWYtOTU3My1lYzFhZTA0YTkxM2I="
}

By default Frame uses basic authentication. As a convenience, we include an authHeader property. You can use this value to create an Authorization header for future requests. The session._id and the session.key properties make up the username and password parts of the basic authentication credentials.

For more details on how basic authentication works see this wikipedia page.

Using Postman, I choose the "Basic Auth" tab and enter my session._id in the username field and the session.key in the password field, then click the Refresh headers button to save that header. Now future requests will use basic authentication.

For more details on how to use Postman to make requsts, see their docs on sending requests.

That's it

We hope this was helpful. If you have questions or think this page should be expanded please contribute by opening an issue or updating this page.

Clone this wiki locally