SMART COSMOS User Details
The SMART COSMOS User Details library provides the common /authenticate
endpoint used by the Auth Server to retrieve user details for token generation, and also includes the corresponding request and response models.
In addition, it includes a default implementation of AuthenticateUserService
which is available via auto-configuration.
REST API
Available methods
JSON Fields
Field | Format | Default | Required | Description |
---|---|---|---|---|
|
Username |
yes |
||
|
User password |
yes |
API Endpoints
Authenticate - POST /authenticate
Depending on the actual application configuration, this endpoint may require authentication.
POST /authenticate
{
"name": "[email protected]",
"credentials": "Passw0rd",
"details": {
"grantType": "password",
"scope": "read",
"username": "[email protected]"
},
"authorities": [],
"authenticated": false,
"principal": "[email protected]"
}
Response
200 OK
{
"authorities" : [
"https://authorities.smartcosmos.net/things/read"
],
"tenantUrn" : "urn:account:uuid:53f452c2-5a01-44fd-9956-3ecff7c32b30",
"userUrn" : "urn:user:uuid:53f452c2-5a01-44fd-9956-3ecff7c32b30",
"name" : "[email protected]",
"passwordHash" : ""
}
400 Bad Request
{
"code" : 1,
"message" : "Invalid username or password"
}
401 Unauthorized