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": "alice@example.com",
    "credentials": "Passw0rd",
    "details": {
        "grantType": "password",
        "scope": "read",
        "username": "alice@example.com"
    },
    "authorities": [],
    "authenticated": false,
    "principal": "alice@example.com"
} 
      
       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" : "alice@example.com",
   "passwordHash" : ""
} 
      400 Bad Request
{
   "code" : 1,
   "message" : "Invalid username or password"
} 
      401 Unauthorized