The ApplicationService is a crucial component of our NestJS application, responsible for managing application-related operations. It provides functionality for creating, updating, retrieving, and deleting applications, as well as managing their OAuth configurations and associated roles and scopes.
POST /api/application
POST /api/application/:applicationId
string
x-stencil-tenantid : string
Not Required
authorization : string
Required
{"active" : boolean, "name" : string, "scopes" : string[], "roles" : string[], "oauthConfiguration" : OauthConfiguration }
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. |
500 | There was an internal error. A stack trace is provided and logged in the Auth Service log files. The response will be empty. |
Sample cURL:
```sh
curl -X POST http://localhost:3000/application/
Sample HTTPie:
```sh
http POST http://localhost:3000/application/
PATCH /application/:applicationId
String
x-stencil-tenantid : string
Not Required
authorization : string
Required
{"active" ?: boolean, "name" ?: string, "oauthConfiguration" ?: OauthConfiguration, "jwtConfiguration" : JwtConfiguration }
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. |
Sample cURL:
```sh
curl -X PATCH http://localhost:3000/application/
Sample HTTPie:
```sh
http PATCH http://localhost:3000/application/
GET /application
GET /application/:applicationId
x-stencil-tenantid : string
not required
authorization : string
string
required to return an applicationCode | 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. |
Sample cURL:
```sh
curl -X GET http://localhost:3000/application
-H “Authorization: Basic
Sample HTTPie:
```sh
http GET http://localhost:3000/application
Authorization:”Bearer
DELETE /application/:applicationId
x-stencil-tenantid : string
not required
authorization : string
string
boolean
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. |
Sample cURL:
```sh
curl -X DELETE http://localhost:3000/application/
Sample HTTPie:
```sh
http DELETE http://localhost:3000/application/
GET /application/:applicationId/oauth-configuration
x-stencil-tenantid : string
not required
authorization : string
string
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. |
Sample cURL:
```sh
curl -X GET http://localhost:3000/application/
Sample HTTPie:
```sh
http GET http://localhost:3000/application/
The ApplicationScopesService is a crucial component of our NestJS application, responsible for managing OAuth scopes for applications. It provides functionality for creating, updating, and deleting scopes associated with specific applications.
POST /application/:applicationId/scope
POST /application/:applicationId/scope/:scopeId
{"defaultConsentDetail": string, "defaultConsentMessage": string, "name" : string, "required" : boolean}
applicationsId: string
- Application IDscopeId: string
- Optional scope IDx-stencil-tenantid : string
not required
authorization : string
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. |
Sample cURL:
```sh
curl -X POST http://localhost:3000/application/
Sample HTTPie:
```sh
http POST http://localhost:3000/application/
PATCH /application/:applicationId/scope/:scopeId
scopeId: string
- Scope IDapplicationsId: string
- Application IDx-stencil-tenantid : string
not required
authorization : string
{"defaultConsentDetail"?: string, "defaultConsentMessage" ?: string, "name" ?: string, "required" ?: boolean}
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. |
Sample cURL:
```sh
curl -X PATCH http://localhost:3000/application/
Sample HTTPie:
```sh
http PATCH http://localhost:3000/application/
DELETE /application/:applicationId/scope/:scopeId
scopeId: string
- Scope IDapplicationsId: string
- Application IDx-stencil-tenantid : string
not required
authorization : string
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. |
Sample cURL:
```sh
curl -X DELETE http://localhost:3000/application/
Sample HTTPie:
```sh
http DELETE http://localhost:3000/application/
The ApplicationRolesService is a crucial component of our NestJS application, responsible for managing roles for applications. It provides functionality for creating, updating, and deleting roles associated with specific applications.
POST /application/:applicationId/role
POST /application/:applicationId/role/:roleId
applicationsId: string
- Application IDroleId: string
- Role ID required when creating role with given IDx-stencil-tenantid : string
not required
authorization : string
{"description" : string, "isDefault" : boolean, "isSuperRole" : boolean, "name" : string}
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. |
Sample cURL:
```sh
curl -X POST http://localhost:3000/application/
Sample HTTPie:
```sh
http POST http://localhost:3000/application/
PATCH /application/:applicationId/role/:roleId
id: string
- Application IDroleId: string
- Role IDx-stencil-tenantid : string
not required
authorization : string
data: UpdateRoleDto
- Updated role dataCode | 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. |
Sample cURL:
```sh
curl -X PATCH http://localhost:3000/application/
Sample HTTPie:
```sh
http PATCH http://localhost:3000/application/
DELETE /application/:applicationId/role/:roleId
id: string
- Application IDroleId: string
- Role IDx-stencil-tenantid : string
not required
authorization : string
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. |
Sample cURL:
```sh
curl -X DELETE http://localhost:3000/application/
Sample HTTPie:
```sh
http DELETE http://localhost:3000/application/
The service implements comprehensive error handling, throwing appropriate exceptions:
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
.
x-stencil-tenantid
for tenant-scoped operations.isDefault
and isSuperRole
flags in the role data can be used to designate special roles within an application.