Get Login Options
Curl request
$ curl 'https://logbook.stainhaufen.de/api/user/login-options' -i -X GET
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 165
{
"failed" : false,
"oauthProviders" : [ {
"name" : "Local",
"url" : "/oauth2/authorization/local",
"id" : "local",
"icon" : null
} ]
}
Response body
{
"failed" : false,
"oauthProviders" : [ {
"name" : "Local",
"url" : "/oauth2/authorization/local",
"id" : "local",
"icon" : null
} ]
}
Response fields
| Path | Type | Description |
|---|---|---|
|
|
Set to true, when authentication failed |
|
|
List of possible login providers |
|
|
Name of provider |
|
|
Url for provider |
|
|
Id of provider |
|
|
Icon for provider |
Endpoint for unauthorized Users
Same as Get Login Option, but with Http-Status 401
Curl request
$ curl 'https://logbook.stainhaufen.de/api/user/unauthorized' -i -X GET
HTTP response
HTTP/1.1 401 Unauthorized
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 165
{
"failed" : false,
"oauthProviders" : [ {
"name" : "Local",
"url" : "/oauth2/authorization/local",
"id" : "local",
"icon" : null
} ]
}
Response body
{
"failed" : false,
"oauthProviders" : [ {
"name" : "Local",
"url" : "/oauth2/authorization/local",
"id" : "local",
"icon" : null
} ]
}
Response fields
| Path | Type | Description |
|---|---|---|
|
|
Set to true, when authentication failed |
|
|
List of possible login providers |
|
|
Name of provider |
|
|
Url for provider |
|
|
Id of provider |
|
|
Icon for provider |
Get User info
Curl request
$ curl 'https://logbook.stainhaufen.de/api/user/info' -i -X GET
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 262
{
"id" : "b07620cc-c258-4e12-8ce7-7b77d992f35f",
"providers" : [ {
"provider" : "local",
"profileUri" : "local/profile/id"
} ],
"email" : "test@test.test",
"nickname" : "test",
"name" : "Test Test",
"pictureUri" : "picture/test"
}
Response body
{
"id" : "b07620cc-c258-4e12-8ce7-7b77d992f35f",
"providers" : [ {
"provider" : "local",
"profileUri" : "local/profile/id"
} ],
"email" : "test@test.test",
"nickname" : "test",
"name" : "Test Test",
"pictureUri" : "picture/test"
}
Response fields
| Path | Type | Description |
|---|---|---|
|
|
Internal id of user |
|
|
Email of user |
|
|
Nickname of user |
|
|
Full Name of user |
|
|
Uri of picture to use |
|
|
Array of providers where user is authenticated |
|
|
Id of the provider |
|
|
Uri of the user for provider |
Login
Curl request
$ curl 'http://localhost:8080/oauth2/authorization/local?redirect=/user/info' -i -X GET
HTTP response
HTTP/1.1 302 Found
Location: https://url/to/provider
Get Parameter
| Parameter | Type | Description |
|---|---|---|
|
String |
Provider to log in |
|
String |
Target to goto in case of login success |