oidc-lite

Key API

This API provides endpoints for managing cryptographic keys. Cryptographic keys are used in signing and verifying JWTs and verifying responses for third party identity providers

Only a tenant scoped authorization key can access these routes

Key Types

The service supports generating three types of keys:

Each key type is stored in the database with its relevant information, including public and private keys where applicable.

Sequence Diagram

Groups Sequence Diagram

Retrieve Keys

Request

Retrieve All Keys

GET /key

Retrieve Unique Key

GET /key/:id

Request Headers

Request Parameters

Response

Response Codes

Code Description
200 The request was successful. The response will contain a JSON body.
400 The request was invalid and/or malformed. The response will contain an Errors JSON Object with the specific errors. This status will also be returned if a paid Auth Service license is required and is not present.
401 You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty
404 The object you are trying to update doesn’t exist. The response will be empty.
500 There was an internal error. A stack trace is provided and logged in the Auth Service log files. The response will be empty.

Update Key

Request

To update an existing key

PUT /key/:id

Request Headers

Request Parameters

Response

Response Codes

Code Description
200 The request was successful. The response will contain a JSON body.
400 The request was invalid and/or malformed. The response will contain an Errors JSON Object with the specific errors. This status will also be returned if a paid Auth Service license is required and is not present.
401 You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty
404 The object you are trying to update doesn’t exist. The response will be empty.
500 There was an internal error. A stack trace is provided and logged in the Auth Service log files. The response will be empty.

Delete Key

Request

Deletes a specific key by its UUID.

DELETE /key/:id

Request Headers

Request Parameters

Response

Response Codes

Code Description
200 The request was successful. The response will contain a JSON body.
400 The request was invalid and/or malformed. The response will contain an Errors JSON Object with the specific errors. This status will also be returned if a paid Auth Service license is required and is not present.
401 You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty
404 The object you are trying to update doesn’t exist. The response will be empty.
500 There was an internal error. A stack trace is provided and logged in the Auth Service log files. The response will be empty.

Generate Key

Request

Generate Key with random id

POST /key/generate

Generate Key with given id

POST /key/generate:id

Request Headers

Request Parameters

Request Body

Response

Response Codes

Code Description
200 The request was successful. The response will contain a JSON body.
400 The request was invalid and/or malformed. The response will contain an Errors JSON Object with the specific errors. This status will also be returned if a paid Auth Service license is required and is not present.
401 You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty
404 The object you are trying to update doesn’t exist. The response will be empty.
500 There was an internal error. A stack trace is provided and logged in the Auth Service log files. The response will be empty.

Authorization

All endpoints are protected by authorization headers which requires authorization and x-stencil-tenanid values to be passed in headers, which are verified using the HeaderAuthService.

Error Handling

The service includes comprehensive error handling, throwing appropriate HTTP exceptions for various scenarios such as unauthorized access, bad requests, or internal server errors.

Response Format

All endpoints return a standardized ResponseDto object containing: