You can automate applications and application registrations on behalf of a developer or team using the {{site.konnect_short_name}} API. The authentication strategy you want to use must be enabled on your {{site.dev_portal}} and your published API.
- Create a developer application by sending a
POSTrequest to the/portals/{portalId}/applicationsendpoint: {% capture create-application %}
{% konnect_api_request %} url: /v3/portals/$DEV_PORTAL_ID/applications method: POST status_code: 201 body: name: "KongAir Application" description: "A portal application provisioned for a developer by a Portal Admin." auth_strategy_id: "$AUTH_STRATEGY_ID" owner: id: "$DEVELOPER_ID" type: "developer" {% endkonnect_api_request %}
{% endcapture %} {{create-application | indent: 3}}
If the application is for a team, configure type: team.
- Copy and export the application ID:
export APPLICATION_ID='YOUR APPLICATION ID'- Create an application registration by sending a
POSTrequest to the/portals/{portalId}/applications/{applicationId}/registrationsendpoint: {% capture create-application-registration %}
{% konnect_api_request %} url: /v3/portals/$DEV_PORTAL_ID/applications/$APPLICATION_ID/registrations method: POST status_code: 201 body: api_id: "$API_ID" status: "approved" {% endkonnect_api_request %}
{% endcapture %} {{create-application-registration | indent: 3}}
{:.warning}
DCR applications: If the application will be using a DCR provider with the given auth strategy, your configuration depends on your use case:
- You want to create a new DCR application, where the IdP client will be created in the identity provider and assigned a
client_id. This will be set as theclient_idof the application and can't be changed moving forward. Do not specifydcr_client_idorclient_idin this case.client_idwill be present in the response.- You want to create an application that is linked to an existing IdP client, but treated as if it was created via the DCR app creation process. This allows you to import existing IdP clients when onboarding your applications into {{site.konnect_short_name}}. In this case, you must specify
dcr_client_idandclient_idwill be present in the response.