The Auth API provides session and server information and enables the creation of reusable session cookies, unlike the stateless access offered by API key authentication.
Authenticates the user and creates the session. Authentication can be done via user name and password or via an access token issued by the issuer provided in the oidcIssuer field.
POST /auth
| Header | Value |
|---|---|
Content-Type | application/x-www-form-urlencoded |
Example payload:
user=root&password=pass&locale=ro
| Header | Value |
|---|---|
Content-Type | application/json |
Example payload:
{
"user": "root",
"password": "pass",
"locale": "ro"
}
Both tokens defined in headers should be issued by the issuer defined in the oidcIssuer field of the GET /auth response.
If the request includes a refresh token, the server will handle refreshing the access token. Otherwise, the client is responsible for managing the refresh process.
| Header | Description |
|---|---|
Oidc-Auth-Token | Access token (JWT) |
Oidc-Refresh-Token | Optional. Refresh token (JWT). |
The payload is ignored, and it should be empty.
The authentication was succesful.
| Header | Value |
|---|---|
Set-Cookie | one.erp.rest.auth.token=abcdef; Path=/; Secure |
Set-Cookie | one.erp.rest.csrf.token=fedcba; Path=/; Secure; HttpOnly |
Set-Cookie | one.erp.rest.locale=ro; Path=/; Secure |
{
"clientAdress": "[0:0:0:0:0:0:0:1]",
"oidcIssuer": "https://accounts.kodall.com/realms/public/", //Since 1.7.2
"name": "Kodall Framework Server",
"isSecure": true,
"version": "1.7.2"
"userName": "andreea",
"userFullName": "Andreea",
"userKey": 8,
"userBusinessUnitKey": 1
"userOrganizationKey": 1,
}
The request is not authorized.
/auth/authRetrieve session info and server info.
GET /auth
If the user is not authenticated, the result will be similar to this:
{
"clientAdress": "192.168.5.150",
"oidcIssuer": "https://accounts.kodall.com/realms/public/", //Since 1.7.2
"name": "Kodall Framework Server",
"isSecure": true,
"version": "1.7.2"
}
If the user is authenticated then the result will contain information about the session:
{
"clientAdress": "192.168.5.150",
"oidcIssuer": "https://accounts.kodall.com/realms/public/", //Since 1.7.2
"name": "Kodall Framework Server",
"isSecure": true,
"version": "1.7.2"
"userName": "andreea",
"userFullName": "Andreea",
"userKey": 8,
"expiresIn": 300,
"userBusinessUnitKey": 1
"userOrganizationKey": 1,
}
/authRoles - GET /auth?roles=1
Profiles - GET /auth?profiles=1
The request params can be combined as usual with &, so the complete example will be GET /auth?roles=1&profiles=1.
This response will be available only if the user is authenticated then the result will contain:
{
"clientAdress": "192.168.5.150",
"oidcIssuer": "https://accounts.kodall.com/realms/public/", //Since 1.7.2
"name": "Kodall Framework Server",
"isSecure": true,
"version": "1.7.2"
"roles": ["Role 1", "Role 2"],
"profiles":[
{
"displayName": "Profile Test 1",
"businessUnitKey": 4,
"name": "a_a4aff4f16a4a410a95fa08b951bc6e68",
"organizationKey": 256
},
{
"displayName": "Profile Test 2",
"businessUnitKey": 4,
"name": "am_294679b5c3a9445c86a1bfba8b4656f5",
"organizationKey": 299
},
{
"displayName": "Profile Test 3",
"businessUnitKey": 4,
"name": "a_e54d126fcf5f4c0a9258b31a68cb75c1",
"organizationKey": 426
}
],
"userName": "andreea",
"userFullName": "Andreea",
"userKey": 8,
"expiresIn": 300,
"userBusinessUnitKey": 1
"userOrganizationKey": 1,
}
/auth?roles=1&profiles=1Refreshes the authentication token.
POST /auth/refresh
The refresh returns /auth response, as example:
{
"clientAdress": "192.168.5.150",
"oidcIssuer": "https://accounts.kodall.com/realms/public/", //Since 1.7.2
"name": "Kodall Framework Server",
"isSecure": true,
"version": "1.7.2"
"userName": "andreea",
"userFullName": "Andreea",
"userKey": 8,
"expiresIn": 300,
"userBusinessUnitKey": 1
"userOrganizationKey": 1,
}
Unauthorized
/auth/refreshRetrieves the user profiles list.
GET /auth/profiles
[
{
"displayName": "Profile Test 1",
"businessUnitKey": 4,
"name": "a_a4aff4f16a4a410a95fa08b951bc6e68",
"organizationKey": 256
},
{
"displayName": "Profile Test 2",
"businessUnitKey": 4,
"name": "am_294679b5c3a9445c86a1bfba8b4656f5",
"organizationKey": 299
},
{
"displayName": "Profile Test 3",
"businessUnitKey": 4,
"name": "a_e54d126fcf5f4c0a9258b31a68cb75c1",
"organizationKey": 426
}
]
Unauthorized
/auth/profilesChange to specific profile.
POST /auth/profile/{name}
{
"idUser": 1,
"idBusinessUnit": 1,
"idOrganization": 1,
"name": "andreea"
}
Unauthorized
Profile Not found
/auth/profile/profile_nameChange to default profile.
POST /auth/profile
{
"idUser": 1,
"idBusinessUnit": 1,
"idOrganization": 1,
"name": "andreea"
}
Unauthorized
/auth/profileRetrieve session info and server info.
POST /auth/password
| Header | Value |
|---|---|
Content-Type | application/x-www-form-urlencoded |
Example payload:
current-password=1234&set-password=4321&confirm-password=4321
The password was changed.
The operation is not authorized.
/auth/passwordTerminates the session.
The authentication was succesful.
| Header | Value |
|---|---|
Set-Cookie | one.erp.rest.auth.token=; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:10 GMT; Path=/; Secure |
Set-Cookie | one.erp.rest.locale=; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:10 GMT; Path=/; Secure |
Set-Cookie | one.erp.rest.csrf.token=; Max-Age=0; Expires=Thu, 01 Jan 1970 00:00:10 GMT; Path=/; Secure |
/auth?logout=1