Service Account¶
Service accounts in InfraKitchen are designed to facilitate machine-to-machine communication and automation within the InfraKitchen ecosystem. They provide a mechanism for external tools, scripts, and CI/CD pipelines to interact with InfraKitchen APIs without requiring an interactive user session.
Setup Steps¶
- Navigate to auth providers and create an authProvider with type
ik_service_account - Navigate to users and create a user
- Navigate to the newly created user and add desired permissions
Generate Token¶
To generate the token, make a call to:
Bash
curl --location 'https://INFRA_KITCHEN_URL/api/auth/service_account/token' \
--header 'Content-Type: application/json' \
--data '{
"identifier": "username",
"password": "password"
}'
Using the Token¶
You can then call the API as the service account by adding the authorization bearer token header to your requests:
Bash
curl --location 'https://INFRA_KITCHEN_URL/api/your-endpoint' \
--header 'Authorization: Bearer YOUR_TOKEN_HERE' \
--header 'Content-Type: application/json'