Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
172 changes: 172 additions & 0 deletions en/docs/administer/key-managers/configure-custom-km-out-of-band.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
# Configure a Custom Key Manager for Out-of-Band Provisioning

WSO2 API Manager supports integrating with external OAuth Authorization Servers as Key Managers in **Out-of-Band (OOB) Provisioning** mode. This approach allows organizations to leverage their existing identity infrastructure (such as Amazon Cognito, Auth0, Azure AD, or any OAuth 2.0-compliant authorization server) for token management while using WSO2 API Manager for API gateway capabilities.

In Out-of-Band provisioning mode:

- OAuth applications and credentials are created and managed directly in the external authorization server.
- Tokens are generated externally using the authorization server's token endpoint.
- WSO2 API Manager validates the externally issued tokens during API invocation.
- No dynamic client registration (DCR) is performed through API Manager.

This guide provides generic instructions for onboarding any external Key Manager in Out-of-Band mode, with Amazon Cognito used as a reference example.

## Before you begin

- Set up and configure your external authorization server (e.g., Amazon Cognito, Auth0, Azure AD, PingIdentity).
- Ensure the authorization server has OAuth 2.0 endpoints configured and accessible.
- Obtain the well-known configuration URL or individual endpoint URLs from your authorization server.

## Step 1 - Configure the external authorization server

Before integrating with WSO2 API Manager, you need to configure your external authorization server with the necessary OAuth 2.0 settings and create an OAuth client application.

### General configuration requirements

Regardless of the authorization server you use, ensure the following are configured:

1. **Enable OAuth 2.0 endpoints** - Ensure that the authorization server has the following endpoints enabled and accessible:
- Token Endpoint
- JWKS Endpoint (for JWT validation)
- Revoke Endpoint (optional)

2. **Create an OAuth client application** - Create an OAuth 2.0 client application in your authorization server with:
- An appropriate name (e.g., `WSO2-API-Client`)
- Required grant types (e.g., `client_credentials` for machine-to-machine communication)
- Scopes that match your API requirements

3. **Note down the client credentials** - Record the following information:
- Client ID
- Client Secret (if applicable)
- Token Endpoint URL
- JWKS Endpoint URL
- Issuer URL

## Step 2 - Configure WSO2 API Manager

Follow the instructions below to register your external authorization server as a Key Manager in WSO2 API Manager.

1. Sign in to the Admin Portal.

`https://<hostname>:9443/admin`

2. Click **Key Managers** and then click **Add Key Manager**.

[![Add Key Manager]({{base_path}}/assets/img/administer/add-key-manager.png)]({{base_path}}/assets/img/administer/add-key-manager.png)

3. Configure the Key Manager with the following settings:

### General Details

| Configuration | Description | Required |
|---------------|-------------|----------|
| Name | A unique identifier for the Key Manager (e.g., `CognitoKM`, `CustomAuthServer`). | Mandatory |
| Display Name | A user-friendly name to display in the UI. | Mandatory |
| Description | A brief description of the Key Manager. | Optional |
| Key Manager Type | Select **Custom** for a generic external authorization server. | Mandatory |

### Key Manager Endpoints

Configure the OAuth 2.0 endpoints from your external authorization server:

| Configuration | Description | Required |
|---------------|-------------|----------|
| Well-known-url | The OpenID Connect discovery URL. If provided, other endpoints can be auto-populated. | Optional |
| Issuer | The token issuer identifier. This value is validated against the `iss` claim in JWT tokens. | Mandatory |
| Token Endpoint | The endpoint URL where tokens are issued. | Mandatory |
| Revoke Endpoint | The endpoint URL for revoking tokens. | Optional |
| JWKS Endpoint | The JSON Web Key Set endpoint for JWT signature validation. | Optional |
| Introspection Endpoint | introspection is **not supported** for the OOB mode | Optional |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Inconsistent capitalization and phrasing in the Introspection Endpoint row.

"introspection" should be capitalized to match other rows, and the description reads more like a caveat than a description of the field.

Proposed fix
-| Introspection Endpoint | introspection is **not supported** for the OOB mode | Optional |
+| Introspection Endpoint | The endpoint URL for token introspection. Introspection is **not supported** in OOB mode. | Optional |
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
| Introspection Endpoint | introspection is **not supported** for the OOB mode | Optional |
| Introspection Endpoint | The endpoint URL for token introspection. Introspection is **not supported** in OOB mode. | Optional |
🤖 Prompt for AI Agents
In `@en/docs/administer/key-managers/configure-custom-km-out-of-band.md` at line
79, Update the Introspection Endpoint table row to use consistent capitalization
and a clear descriptive phrase: change "introspection is **not supported** for
the OOB mode" to a capitalized, succinct description such as "Not supported in
Out‑of‑Band (OOB) mode" (or "Not supported in OOB mode") so it matches other
rows' style and reads as a field description rather than a caveat; apply this
change to the "Introspection Endpoint" row in the table.


### Claim URIs

Configure how WSO2 API Manager maps JWT claims from the external authorization server:

| Configuration | Description | Common Values |
|---------------|-------------|---------------|
| Consumer Key Claim URI | The JWT claim that contains the client identifier. | `client_id`, `azp`, `cid` |
| Scopes Claim URI | The JWT claim that contains the granted scopes. | `scope`, `scp` |

!!! tip
Check your authorization server's JWT token structure to identify the correct claim names. You can decode a sample JWT token to inspect the claims.

### Grant Types

Grant types are not required since token generation happens directly with the external authorization server.

### Certificates

Configure the certificate settings for JWT token validation:

| Configuration | Description |
|---------------|-------------|
| PEM | Upload or paste the public certificate in PEM format for token signature validation. |
| JWKS | Provide the JWKS endpoint URL. WSO2 API Manager will automatically fetch the public keys for signature validation. |

### Token Validation Method

| Method | Description |
|--------|-------------|
| Self Validate JWT | API Manager validates JWT tokens locally using the JWKS endpoint or uploaded certificates. This is the recommended method for JWT tokens. |

### Advanced Configurations (Out-of-Band Mode)

For Out-of-Band provisioning mode, configure the following settings:

| Configuration | Value | Description |
|---------------|-------|-------------|
| Token Generation | **Disabled** (Unchecked) | Tokens are generated externally, not through the Developer Portal. |
| OAuth App Creation | **Disabled** (Unchecked) | OAuth applications are created directly in the external authorization server. |
| Out Of Band Provisioning | **Enabled** (Checked) | Allows providing existing OAuth credentials created outside of API Manager. |

[![Out-of-Band Configuration]({{base_path}}/assets/img/administer/oob-km-advanced-config.png)]({{base_path}}/assets/img/administer/oob-km-advanced-config.png)

!!! warning "Important"
When **Token Generation** is disabled, the Developer Portal will display the Token Endpoint URL so that developers can generate tokens externally using their preferred method.

5. Click **Add** to save the Key Manager configuration.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Step numbering is off — should be step 4, not step 5.

The numbered steps in "Step 2" go 1, 2, 3 (line 57), then jump to 5 here. The subsections (General Details, Endpoints, etc.) are all part of step 3's configuration, so this should be step 4.

Proposed fix
-5. Click **Add** to save the Key Manager configuration.
+4. Click **Add** to save the Key Manager configuration.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
5. Click **Add** to save the Key Manager configuration.
4. Click **Add** to save the Key Manager configuration.
🤖 Prompt for AI Agents
In `@en/docs/administer/key-managers/configure-custom-km-out-of-band.md` at line
127, The numbered list has a wrong step number for the final action: change the
line containing "Click **Add** to save the Key Manager configuration." so its
prefix number is 4 instead of 5; update the ordered list item number to 4
(ensuring the surrounding steps remain 1–3 for the prior items and the
subsections remain under step 3) so the sequence reads 1, 2, 3, 4.


## Step 3 - Use the Key Manager in the Developer Portal

Once the Key Manager is configured, application developers can use it to provide their existing OAuth credentials.

### Create an application and subscribe to an API

1. Sign in to the Developer Portal.

`https://<hostname>:9443/devportal`

2. Click **Applications** and create a new application or select an existing one.

3. Subscribe the application to the desired API(s).

### Provide existing OAuth keys

Since Out-of-Band mode does not support creating OAuth applications through the Developer Portal, you need to provide credentials that were created directly in the external authorization server.

1. Navigate to the application and click **Production Keys** or **Sandbox Keys**.

2. Select your configured Key Manager from the dropdown.

3. Click **Provide Existing OAuth Keys**.

[![Provide Existing OAuth Keys]({{base_path}}/assets/img/administer/oob-provide-existing-keys.png)]({{base_path}}/assets/img/administer/oob-provide-existing-keys.png)

4. Enter the **Consumer Key** (Client ID) from your external authorization server.

!!! note
In Out-of-Band mode, you only need to provide the Consumer Key. The Consumer Secret is not required since token generation happens directly with the external authorization server.

5. Click **Save**.

## Step 4 - Generate tokens and invoke the API

Since token generation is handled externally, you need to obtain tokens directly from your authorization server.

### Generate an access token

Use the token endpoint of your external authorization server to generate an access token. The exact request format depends on your authorization server.

### Invoke the API

Use the obtained access token to invoke the API through the WSO2 API Gateway.
2 changes: 2 additions & 0 deletions en/docs/administer/key-managers/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,5 @@ When the permission type for the role-based restriction is set to DENY, users wi
- [Configure PingFederate as a Key Manager]({{base_path}}/administer/key-managers/configure-pingfederate-connector/)

- [Configure ForgeRock as a Key Manager]({{base_path}}/administer/key-managers/configure-forgerock-connector/)

- [Custom Key Manager (Out-of-Band Provisioning)]({{base_path}}/administer/key-managers/configure-custom-km-out-of-band/)
Comment on lines +60 to +61
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Link text is inconsistent with other entries and the page title.

All other entries follow the pattern "Configure X as a Key Manager" (e.g., lines 47–59), and the actual page title in mkdocs.yml is "Configure a Custom Key Manager for Out-of-Band Provisioning". Consider aligning this link text.

Proposed fix
-- [Custom Key Manager (Out-of-Band Provisioning)]({{base_path}}/administer/key-managers/configure-custom-km-out-of-band/)
+- [Configure a Custom Key Manager for Out-of-Band Provisioning]({{base_path}}/administer/key-managers/configure-custom-km-out-of-band/)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- [Custom Key Manager (Out-of-Band Provisioning)]({{base_path}}/administer/key-managers/configure-custom-km-out-of-band/)
- [Configure a Custom Key Manager for Out-of-Band Provisioning]({{base_path}}/administer/key-managers/configure-custom-km-out-of-band/)
🤖 Prompt for AI Agents
In `@en/docs/administer/key-managers/overview.md` around lines 60 - 61, Update the
markdown link text that currently reads "Custom Key Manager (Out-of-Band
Provisioning)" to match the project's link-title pattern and the page title;
change it to "Configure a Custom Key Manager for Out-of-Band Provisioning" for
the link pointing to /administer/key-managers/configure-custom-km-out-of-band/
so it aligns with other entries that follow "Configure X as a Key Manager".

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions en/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@ nav:
- Configure Auth0 as a Key Manager: administer/key-managers/configure-auth0-connector.md
- Configure PingFederate as A Key Manager: administer/key-managers/configure-pingfederate-connector.md
- Configure ForgeRock as a Key Manager: administer/key-managers/configure-forgerock-connector.md
- Configure a Custom Key Manager for Out-of-Band Provisioning: administer/key-managers/configure-custom-km-out-of-band.md
- Configure a Custom Key Manager: administer/key-managers/configure-custom-connector.md
- Configure the Global Key Manager: administer/key-managers/configure-global-key-manager.md
- Configure the Azure AD as a Key Manager: administer/key-managers/configure-azure-ad-key-manager.md
Expand Down