This service is responsible for authentication of users and to manage authentication methods.
This routes is used to authenticate a user with these providers:
- guest
- github
- microsoft
It's the route that the provider will redirect the user after the authentication.
This route is used to logout the user.
These routes are used to authenticate a user with ldap or basic auth. In both cases the request body must contain the following fields:
In this example we using the basic auth and the auth name is authn-basic
.
auth/basic?name=authn-basic
{
"username": "username",
"password": "password"
}
{
"id": "krateo",
"displayName": "krateo",
"username": "krateo",
"provider": "basic",
"email": "[email protected]"
}
krateoplatformops=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImtyYXRlbyIsImRpc3BsYXlOYW1lIjoia3JhdGVvIiwidXNlcm5hbWUiOiJrcmF0ZW8iLCJwcm92aWRlciI6ImJhc2ljIiwiZW1haWwiOiJrcmF0ZW9Aa3JhdGVvLmlvIiwiaWF0IjoxNjY4MDY3NDY1LCJleHAiOjQyNjAwNjc0NjUsImlzcyI6IjEzYjQ2NTkzZmU3MDRjNTc5NjZmZjQxZGNhOWRjNDhiIn0.Cp_vMDev5_S8hlD2UE2fBHl2jXLDUx-feRp5CZM_L-4; Max-Age=2592000; Domain=krateo.site; Path=/; Expires=Sat, 10 Dec 2022 08:04:25 GMT; HttpOnly; Secure; SameSite=Strict
This route returns alla the available authentication methods.
{
"list": [
{
"metadata": {
"name": "authn-basic",
"uid": "19690619-db0c-43c6-a4ef-ec1ba7181891"
},
"spec": {
"color": "blue",
"icon": "fa-solid fa-key",
"name": "basic",
"strategy": "basic",
"type": "form"
}
},
{
"metadata": {
"name": "authn-guest",
"uid": "4071ed97-9d1d-4027-8d5f-4cca2c798625"
},
"spec": {
"color": "blue",
"icon": "fa-solid fa-lock",
"name": "guest",
"strategy": "guest",
"type": "redirect"
}
}
],
"count": 2
}
This route returns the authentication method with the given name.
/strategy/auhtn-basic`
It is used to create a authentication strategy.
It is used to delete an authentication strategy.
Parse cookie and return the json of the user.
{
"id": "guest",
"username": "guest",
"provider": "guest",
"email": "[email protected]"
}
!!! Note
Services respond with valid JSON, so, if the response is an array, it will be wrapped in the `list` property.
If the response contains the `list` proerty it will add the property `count` with the number of items in the list.