Panel | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
ON THIS PAGE
|
...
Note | ||
---|---|---|
| ||
The |
/token/
POST
Posts user credentials or a refresh token to the /token/ endpoint, which . If the credentials are valid, the server returns an access/refresh token for use that is included with all other BSN REST calls for authentication.
URL Parameters
None
Request Body
username
: The BSN username. If this is a User Authentication Request, the network name preceeds the username (e.g. "exampleNetwork/exampleUser@brightsign.biz").
password
: The password associated with the username.grant_type
: The type of grant being presented in exchange for the access token. This value must be set to"password"
.client_id
: The client identifier. This value is currently unused.client_secret
: The client secret. This value is currently unused.
Response Body
[string] access_token
: The authorization token to use with endpoint calls until half of theexpires_in
time period has elapsed[string] token_type
: The OAuth 2.0 token type, which will always be returned as"bearer"
[integer] expires_in
: The lifetime (in seconds) of the authorization token[string] refresh_token
: The token to use for re-authentication when more than half of theexpires_in
time period has elapsed.[string[]]scope
: An array that lists permissions granted by the token. A successful Person Authentication Response will include the"Self"
value only, indicating that access to a network has not been granted, while a successful User Authentication Response will include both"Full"
and"Self"
values.[string] userLogin
: Theusername
included in the request body[integer] userId
: The user identifier, which may be used in subsequent requests. This entry is only returned for User Authentication Requests.[integer] personId
: The person identifier[string[]] networkNames
: An array of networks to which the person (i.e. the account associated with the login credentials) belongs. This entry is only returned for Person Authentication requests.[string] .issued
: The date and time the authorization/refresh token was issued (formatted as"[day of week], dd mmm yyyy hh:mm:ss [timezone]"
)[string] .expires
: The date and time the authorization/refresh token expires (formatted as"[day of week], dd mmm yyyy hh:mm:ss [timezone]"
)
Examples
Person Authentication Request
...
Code Block |
---|
POST https://brightsignnetwork.com/2017/01/REST/Token HTTPtoken/ Host: brightsignnetwork.com Content-Type: application/www-form-urlencoded Content-Length: 158 Accept: application/xml grant_type=password&client_id=AuthenticationTest&client_secret=9955ED3C-7F6E-4AF9-BFFE-CD6AAB42347B&username=exampleUser@brightsign.biz&password=admin&scope=self |
...
Code Block |
---|
POST https://brightsignnetwork.com/2017/01/REST/token/
Host: ast.brightsignnetwork.com
Content-Type: application/www-form-urlencoded
Content-Length: 178
Accept: application/xml
grant_type=password&client_id=AuthenticationTest&client_secret=9955ED3C-7F6E-4AF9-BFFE-CD6AAB42347B&username=AuthenticationTest1/exampleUser@brightsign.biz&password=admin&scope=full |
...
Code Block |
---|
POST https://brightsignnetwork.com/2017/01/REST/token/
Host: ast.brightsignnetwork.com
Content-Type: application/www-form-urlencoded
Content-Length: 151
Accept: application/xml
grant_type=refresh_token&client_id=AuthenticationTest&client_secret=9955ED3C-7F6E-4AF9-BFFE-CD6AAB42347B&refresh_token=375671af51fa44fabb5b4a353d4f8488 |
...