GitHub Actions workflows status
CodeClimate
The origin and root path for this API is: https://api.klimapartner.net/auth
The following endpoints are defined in this API:
Supported methods:
GET (target lambda → create-cfd-signed-url)
Description:
This endpoint returns a CloudFront signed URL that can be used for accessing content from a private CDN.
Authorization:
| Type | Identity source |
|---|---|
| Cognito |
|
Query string parameters:
No query string parameters found for this method.
Request body:
No body found for this method.
Examples:
Example #1
Request:
GET https://api.klimapartner.net/auth/get-signed-url
Headers:
Authorization: Bearer COGNITO_ACCESS_TOKENResponse:
Status code:
200
Headers:
Access-Control-Allow-Origin: *
Body:
{
"signedUrl": "some_signed_url"
}Supported methods:
POST (target lambda → login)
Description:
This endpoint allows user to retrieve their authentication data given they provided a proper username and password. This currently does not support Google as an authentication provider.
Authorization:
No authorizer found for this method.
Query string parameters:
No query string parameters found for this method.
Request body:
| Key | Default | Description |
|---|---|---|
method |
Cognito |
Defines the authentication provider. Valid values: 'Cognito', 'Google' |
token |
Access token to login. This is used only when logging in via Google. | |
Username |
Username used for logging in via AWS Cognito. | |
Password |
Password associated with the given username for logging in via AWS Cognito. |
Examples:
Example #1
Request:
POST https://api.klimapartner.net/auth/login
Body:
{
"Username": "cognito_username",
"Password": "secret_cognito_pwd"
}Response:
Status code:
200
Headers:
Access-Control-Allow-Origin: *
Body:
{
"accessToken": "cognito_access_token",
"idToken": "cognito_id_token",
"refreshToken": "cognito_refresh_token",
"email": "user_email",
"emailHash": "user_email_md5_hash"
}Example #2
Request:
POST https://api.klimapartner.net/auth/login
Body:
{
"Username": "wrong_cognito_username",
"Password": "wrong_secret_cognito_pwd"
}Response:
Status code:
401
Headers:
Access-Control-Allow-Origin: *
Body:
{
"message": "Provided credentials are incorrect."
}Supported methods:
POST (target lambda → logout)
Description:
This endpoint allows user to invalidate any authentication tokens generated with their credentials. This currently does not support Google as an authentication provider.
Authorization:
No authorizer found for this method.
Query string parameters:
No query string parameters found for this method.
Request body:
| Key | Default | Description |
|---|---|---|
method |
Cognito |
Defines the authentication provider. Valid values: 'Cognito', 'Google' |
accessToken |
Access token provided when logging in. This applies only to session created via Cognito. |
Examples:
Example #1
Request:
POST https://api.klimapartner.net/auth/logout
Body:
{
"accessToken": "cognito_access_token"
}Response:
Status code:
200
Headers:
Access-Control-Allow-Origin: *
Body:
{
"message": "User successfully logged out!"
}Example #2
Request:
POST https://api.klimapartner.net/auth/logout
Body:
{
"accessToken": "wrong_cognito_access_token"
}Response:
Status code:
401
Headers:
Access-Control-Allow-Origin: *
Body:
{
"message": "Provided access token is incorrect."
}Supported methods:
POST (target lambda → refresh-session)
Description:
This endpoint allows user to refresh their access token in order to avoid having to log in again. This will work until their refresh token expires. This currently does not support Google as an authentication provider.
Authorization:
No authorizer found for this method.
Query string parameters:
No query string parameters found for this method.
Request body:
| Key | Default | Description |
|---|---|---|
method |
Cognito |
Defines the authentication provider. Valid values: 'Cognito', 'Google' |
refreshToken |
Refresh token provided when logging in. This applies only to session created via Cognito. |
Examples:
Example #1
Request:
POST https://api.klimapartner.net/auth/refresh
Body:
{
"refreshToken": "cognito_refresh_token"
}Response:
Status code:
200
Headers:
Access-Control-Allow-Origin: *
Body:
{
"accessToken": "cognito_access_token",
"idToken": "cognito_id_token"
}Example #2
Request:
POST https://api.klimapartner.net/auth/refresh
Body:
{
"refreshToken": "wrong_cognito_refresh_token"
}Response:
Status code:
401
Headers:
Access-Control-Allow-Origin: *
Body:
{
"message": "Provided refresh token is incorrect."
}The following lambda functions are used in this API:
The following layers are used in this API:
| Name | Sources | Timeout | Handler | Layers |
|---|---|---|---|---|
| login |
|
30s | handler |
See configuration file for more details.
| Name | Sources | Timeout | Handler | Layers |
|---|---|---|---|---|
| refresh-session |
|
30s | handler |
See configuration file for more details.
| Name | Sources | Timeout | Handler | Layers |
|---|---|---|---|---|
| logout |
|
30s | handler |
See configuration file for more details.
| Name | Sources | Timeout | Handler | Layers |
|---|---|---|---|---|
| create-cfd-signed-url |
|
default | handler |
See configuration file for more details.
Layer for auth-api
aws-sdk, version:2.771.0(see on NPM)auth-api-utils(local utility)
See configuration file for more details.
You can use any tags (and their respective values) visible below to find ressources related to this stack on AWS. See here for more details.
| Tag | Value |
|---|---|
| app | kaskadi |
| service | auth-api |
| logical-unit | auth |
| type | http |