Okta SCIM sync (#163)

Co-authored-by: Maycon Santos <mlsmaycon@gmail.com>
Co-authored-by: Misha Bragin <bangvalo@gmail.com>
This commit is contained in:
Bethuel Mmbaga
2024-03-08 18:27:55 +03:00
committed by GitHub
parent a38af80e54
commit 9de4e0a8ca
16 changed files with 307 additions and 1 deletions

View File

@@ -1,5 +1,13 @@
# Integration API Documentation
Table of contents
* [Introduction](#introduction)
* [Authentication](#authentication)
* [Google endpoints](#google-endpoints)
* [Azure/Entra ID](#azure-endpoints)
* [Okta SCIM endpoints](#okta-scim-endpoints)
## Introduction
This reference provides detailed information on managing integrations via NetBird Cloud API.
@@ -365,3 +373,177 @@ Response
}
]
```
## Okta SCIM Endpoints
### Create Integration
Create a Okta SCIM integration with the following request. The new integration will be enabled by default.
Request input:
- `group_prefixes`: Specifies list of starts_with patterns for group provision. If the group name matches one the the pattern it will be provisioned regardless of the members. Optional. The default value is empty list.
- `user_group_prefixes`: Specifies list of starts_with patterns for user provision. If the user belongs to group which name matches one the the pattern the user will be provisioned. Optional. The default value is empty list.
- `enabled`: Optional. Used to disable/enable the integration.
```shell
curl --request POST \
--url https://api.netbird.io/api/integrations/okta-scim-idp \
--header 'Accept: application/json' \
--header 'Authorization: Token <PAT>' \
--header 'Content-Type: application/json' \
--data '{
"group_prefixes": [],
"user_group_prefixes": []
}'
```
Response
```json
{
"id": 1,
"enabled": true,
"group_prefixes": [],
"user_group_prefixes": [],
"auth_token": "nbs_pBmR9mwBpsJH03B0DGojHzhLTRndg90QGPsS"
}
```
> Take a note of the `auth_token` returned; you will need it to configure the Okta application.
### Get all Okta integrations for the account
Request
```shell
curl --request GET \
--url https://api.netbird.io/api/integrations/okta-scim-idp \
--header 'Accept: application/json' \
--header 'Authorization: Token <PAT>'
```
Response
```json
[
{
"id": 1,
"enabled": true,
"group_prefixes": [],
"user_group_prefixes": [],
"auth_token": "nbs_pBm*********************************"
}
]
```
### Get Integration by ID
Request
```shell
curl --request GET \
--url https://api.netbird.io/api/integrations/okta-scim-idp/<ID> \
--header 'Accept: application/json' \
--header 'Authorization: Token <PAT>'
```
Response
```json
{
"id": 1,
"enabled": true,
"group_prefixes": [],
"user_group_prefixes": [],
"auth_token": "nbs_pBm*********************************"
}
```
### Regenerate Auth token
Request
```shell
curl --request POST \
--url https://api.netbird.io/api/integrations/okta-scim-idp/<ID>/token \
--header 'Accept: application/json' \
--header 'Authorization: Token <PAT>'
```
> Replace ID with the integration ID you want to update.
Response
```json
{
"id": 1,
"enabled": true,
"group_prefixes": [],
"user_group_prefixes": [],
"auth_token": "nbs_pBmR9mwBpsJH03B0DGojHzhLTRndg90QGPsS"
}
```
### Update Integration
Updates the selected parameters for a specific integration.
Request
- `group_prefixes`: Specifies list of starts_with patterns for group provision. If the group name matches one the the pattern it will be provisioned regardless of the members. Optional. The default value is empty list.
- `user_group_prefixes`: Specifies list of starts_with patterns for user provision. If the user belongs to group which name matches one the the pattern the user will be provisioned. Optional. The default value is empty list.
- `enabled`: Optional. Used to disable/enable the integration.
```shell
curl --request PUT \
--url https://api.netbird.io/api/integrations/okta-scim-idp/<ID> \
--header 'Accept: application/json' \
--header 'Authorization: Token <PAT>' \
--header 'Content-Type: application/json' \
--data '{
"enabled": true,
"group_prefixes": [],
"user_group_prefixes": []
}'
```
> Replace ID with the integration ID you want to update.
Response
```json
{
"id": 1,
"enabled": true,
"group_prefixes": [],
"user_group_prefixes": [],
"auth_token": "nbs_pBmR9mwBpsJH03B0DGojHzhLTRndg90QGPsS"
}
```
### Delete Integration
Request
```shell
curl --request DELETE \
--url https://api.netbird.io/api/integrations/okta-scim-idp/<ID> \
--header 'Accept: application/json' \
--header 'Authorization: Token <PAT>'
```
> Replace ID with the integration ID you want to update.
Response
```json
{}
```
### Get Integration sync logs
Request
```shell
curl --request GET \
--url https://api.netbird.io/api/integrations/okta-scim-idp/<ID>/logs \
--header 'Accept: application/json' \
--header 'Authorization: Token <PAT>'
```
> Replace ID with the integration ID you want to update.
Response
```json
[
{
"id": <ID>,
"level": "info",
"timestamp": "timestamp UTC",
"message": "message"
}
]
```