-
Notifications
You must be signed in to change notification settings - Fork 93
feat(portal): Automate developer and app creation #4885
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
cloudjumpercat
wants to merge
4
commits into
main
Choose a base branch
from
feat/automate-developers-apps
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| You can automate applications and application registrations on behalf of a developer or team using the {{site.konnect_short_name}} API. | ||
| The [authentication strategy](/dev-portal/auth-strategies/) you want to use must be enabled on your {{site.dev_portal}} and your published API. | ||
|
|
||
| 1. Create a developer application by sending a `POST` request to the `/portals/{portalId}/applications` endpoint: | ||
| {% capture create-application %} | ||
| <!--vale off--> | ||
| {% 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 %} | ||
| <!--vale on--> | ||
| {% endcapture %} | ||
| {{create-application | indent: 3}} | ||
|
|
||
| If the application is for a team, configure `type: team`. | ||
|
|
||
| 1. Copy and export the application ID: | ||
| ```sh | ||
| export APPLICATION_ID='YOUR APPLICATION ID' | ||
| ``` | ||
|
|
||
| 1. Create an application registration by sending a `POST` request to the `/portals/{portalId}/applications/{applicationId}/registrations` endpoint: | ||
| {% capture create-application-registration %} | ||
| <!--vale off--> | ||
| {% 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 %} | ||
| <!--vale on--> | ||
| {% 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 the `client_id` of the application and can't be changed moving forward. **Do not** specify `dcr_client_id` or `client_id` in this case. `client_id` will 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_id` and `client_id` will be present in the response. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| You can pre-create developer accounts to provision their team association and API access before they access the {{site.dev_portal}}. | ||
|
|
||
| 1. To automatically create developers and send them an email to create a password, send a `POST` request to the ` /portals/{portalId}/developers` endpoint: | ||
| {% capture create-dev %} | ||
| <!--vale off--> | ||
| {% konnect_api_request %} | ||
| url: /v3/portals/$DEV_PORTAL_ID/developers | ||
| method: POST | ||
| status_code: 201 | ||
| body: | ||
| full_name: "Raina Sovani" | ||
| email: "raina.sovani@example.com" | ||
| status: "approved" | ||
| send_notification_email: true | ||
| {% endkonnect_api_request %} | ||
| <!--vale on--> | ||
| {% endcapture %} | ||
| {{create-dev | indent: 3}} | ||
|
|
||
| 1. Copy and export the developer ID: | ||
| ```sh | ||
| export DEVELOPER_ID='YOUR DEVELOPER ID' | ||
| ``` | ||
|
|
||
| 1. Add the developer to an existing team that has the correct roles for the APIs they need access to by sending a `POST` request to the [`/portals/{portalId}/teams/{teamId}/developers` endpoint](/api/konnect/portal-management/v3/#/operations/add-developer-to-portal-team): | ||
| {% capture add-dev-to-team %} | ||
| <!--vale off--> | ||
| {% konnect_api_request %} | ||
| url: /v3/portals/$DEV_PORTAL_ID/teams/$TEAM_ID/developers | ||
| method: POST | ||
| status_code: 201 | ||
| body: | ||
| id: "$DEVELOPER_ID" | ||
| {% endkonnect_api_request %} | ||
| <!--vale on--> | ||
| {% endcapture %} | ||
| {{add-dev-to-team | indent: 3}} | ||
|
|
||
| {:.warning} | ||
| > **Logging in to {{site.dev_portal}}s:** | ||
| > * **SSO:** If a developer is created in a {{site.dev_portal}} with SSO configured, they must be able to use SSO to login if their email address is configured in the identity provider. | ||
| > After they log in, they will automatically approved. | ||
| > * **Basic auth:** If a developer is created in a {{site.dev_portal}} with basic auth configured, they must be able to set their password. This can be done one of two ways: | ||
| > * `send_notification_email: true`: Developers can use the link in the email to set their password. | ||
| > * Developers can click **Forgot password** in the {{site.dev_portal}} UI to set a password, regardless of whether `send_notification_email` is `true` or `false`, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also support the ability to create applications with a team owner via
"type": "team". Probably worth calling this out somewhere.