POST /auth/v2/token
Authenticates a user. If successful, creates an authentication token that you use in subsequent API requests. By default, the token expires in 30 minutes. After a token expires, you must rerun this command to generate a new token.
Request Example
The following creates an authentication token for user
root
:curl -X POST \
'https://10.10.100.42:8243/auth/v2/token' \
-u root:mapr
Response Example
200 OK { "token": "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJtYXByIiwiYXVkIjoid2ViIiwiZXhwIjoxNTE2NzQ2MDc4LCJpYXQiOjE1MTY3NDQyNzh9.6YXWX72UP9_U9DPmT8c-_DQRDwY_TL0DEdsBaBqoaLf8iK0qHNctyBTbFO5ktUJMTubVOj6D7pFOEyEuV8lhjA" }
For an example that shows how to use the token returned by this API call in a subsequent
GET
command, see Using Token-Based Authentication.