wso2-extensions / apim-km-azure-ad

Integrate Azure AD as a Third Party Key Manager for WSO2 API Manager
Apache License 2.0
3 stars 10 forks source link

Integrate Azure AD as a third-party Key Manager with WSO2 API Manager

Third-party Key Manager implementation which allows to integrate Azure AD with WSO2 API Manager. This repo contains a sample implementation that consumes the Microsoft's Graph API to create and manage Azure AD Applications.

Kindly note that this implementation & feature is supported from WSO2 API Manager v3.2.0 onwards

[:construction:] Development in progress

Build

Execute the following command from the project's root directory to build

Linux/ MACOS

mvn clean install

Windows

mvn clean install

Quick Start

Configure Azure AD

Prerequisites

Create Application

Create secrets

Configured permissions

Copy application details

Configure API manager

Start the API Manager server and log-in to the Admin portal to configure Azure AD as a Key Manager.

Configure Key Manager

Create an Application & Generate Keys

Next, log-in to the Devportal and navigate to Applications section

Post checks

Under App registration there should be newly created application.

If we are using existing app registered. Make sure to check the Expose an API section and we have setup Application ID URI. The value should be

api://<Application (client) ID>

We can also get this value by clicking the set link right next to the label. Default value is what we will see above.

Without this in the app,the token will be generate in a version 1 format and will not work with APIM KM due to failed signature.

Update the client_password.

Update password is not supported by providing new one from the APIM. When ever the application is updated via APIM a new client_secret is set.

Failed to add password. Error detail: Unable to save changes because the credential limit has been reached. Please delete a credential and try again.

If you see this message in logs or while updating the application several times, The issue is with limitation with Azure AD client_secret. At a given application max number of client_secrets can have is 2. Delete old one from AzureAD console web client.

Adding existing key with APIM

With the limitation on getting generated client_secrets after its generated, it not support to add existing keys from APIM.

License

Apache 2.0

Thanks

Big thanks for https://github.com/athiththan11/apim-km-azure for initial base project.