Auth

You can issue/request/revoke a token for authentication and authorization using API calls. The operations that can be performed are:

POST/auth/refreshToken

DELETE/auth/revokeToken

POST/auth/requestToken

POST/auth/spnegoRequestToken

POST/auth/refreshToken

This API is used to issue a new token using refresh token. It is assumed that the refresh token is in cookie.

Parameters

None.

Example to issue a new token using the refresh token in the user's cookie

curl -X POST -b cookie.txt "http://localhost:9400/rest/auth/v1/refreshToken"

DELETE/auth/revokeToken

Assuming the refresh token is in cookie, this API is used to revoke the token and terminate the session.

Parameters

None

Example to revoke the refresh token in the cookie.

curl -X DELETE -b cookie.txt "http://localhost:9400/rest/auth/v1/revokeToken"

POST/auth/requestToken

This API is used to request a token.

Parameters

None

Request Body

Example Value - Schema

[
{
"string"
}
]

Example to request a token for user "admin" in the request body

curl -X POST -u admin:admin -c cookie.txt "http://localhost:9400/rest/auth/v1" -H "Content-Type:application/json" -d "{\"appId\":\"Contrail\"}"

POST/auth/spnegoRequestToken

This API is used to request a token using Kerberos (GSS) authentication.

Parameters

None

Request Body

Example Value - Schema

[
{
"string"
}
]

Example to request a token for a Kerberos user in the request body.

curl -X POST --negotiate -u : -c cookie.txt "http://localhost:9400/rest/auth/v1/spnegoRequestToken" -H "Content-Type:application/json" -d "{\"appId\":\"Contrail\"}"