This guide explains how to integrate Gluu as third-party key manager with WSO2 API Manager (v3.2.0 onwards).
Please follow this section if you can't find any existing built JAR of the implementation in Releases or if you are doing an active development
To build the project, execute the following mvn
command from the root directory of the project
mvn clean install
After successful build, copy the built JAR artifact from <apim-km-gluu>/components/gluu.key.manager/target
directory and place it inside the <apim>/repository/components/dropins
directory of the WSO2 API Manager.
This requires a server restart to take effect on the changes and to enable the Gluu key manager component in WSO2 API Manager.
Please follow the given instructions to configure the Gluu server to configure and integrate with WSO2 API Manager.
The following configurations and instructions are illustrated given that the Gluu server is up and running in your preferred servers.
Login to the Gluu server and navigate to Configuration
> JSON Configuration
> oXAuth Configuration
and scroll down to the dynamicRegistrationEnabled
section and make it true
and save the configurations to enable the Dynamic Client Registration feature.
Login to the Gluu server and navigate to Configuration
> JSON Configuration
> oXAuth Configuration
screen and scroll to the openIdConfigurationEndpoint
and make a note of the specified URL. The URL may follow the given format
https://hostname-gluu-server/.well-known/openid-configuration
We will be using the OpenID Configuration endpoint URL to configure the key manager in WSO2 API Manager's Admin portal.
Prior to following the configurations, please ensure to add the public certificate of the Gluu server to the
<apim>/repository/resources/security/client-truststore.jks
to overcome any SSL handshake errors during configurations
-
Login to the Admin portal (/admin) of the WSO2 API Manager, and click on
Key Managers
in the left-panel to add a new Key Manager. Then, click onAdd KeyManager
button and perform the following steps to configure the Gluu Key Manager in WSO2 API Manager -
In the following screen, provide and fill the required details to configure the Key Manager.
Fill the
Well-known URL
with the previously copied OpenID Configuration endpoint URL (from here) and click onImport
to import the required endpoint URLs of the Gluu server.If you encounter into any SSL Handshake errors during the import action, please download and add the public cerificate of the Gluu server to the
<apim>/repository/resources/security/client-truststore.jks
to resolve the SSL errorsAs mentioned earlier, this will import and configure all required endpoints to configure the Gluu as a third-party key manager in the WSO2 API Manager.
-
Configure the values for
Consumer Key Claim URI
andScope Claim URI
Under the
Claim URIs
section, it is required to configure the claim URIs related toConsumer Key
andScope
. The default values of Gluu server as follows- Consumer Key Claim URI:
client_id
- Scope Claim URI:
scope
- Consumer Key Claim URI:
-
Add
and save the configurations
-
Navigate to the Devportal (/devportal) and click on
Sign-In
to login to the Devportal and then move toApplications
. -
Click on
ADD NEW APPLICATION
to create a new application -
Fill the required information and click on
Save
to create an Application -
In the following screen, go to
Production Keys
>OAuth2 Tokens
and select theGluu Key Manager
tab and fill the information to create an application and to generate the keys and access token. -
Click on
Generate Keys
to creat a client in the Gluu server and to generate the Consumer Key and Secret and a JWT access token.
If you have any APIs protected with scopes, then please follow the given instructions to configure the Gluu server to include and generate access token with the required scopes.
Assumption: We have an existing API with a scope called
'menu'
engaged to one of the API resource
- Login to the Gluu server and go to
OpenID Connect
>Scopes
screen and click onAdd Scope
to create - Enter the scope name in the
Display Name
field and click onAdd
to save the scope - Then, navigate to
OpenID Connect
>Clients
and open and edit the respective Gluu client that has been created in the Gluu server (respective to the Devportal Application) - Under the
Scopes
section, click onAdd Scope
and add the newly createdmenu
scope to the list. This is to enable and allow the respective client to issue the respective scope when generating an Access Token - Once the scopes are updated, click on
Update
to update the Gluu client
Now, you can successfully generate the Access Token from Gluu server with the required scopes (ex: menu
) and invoke the respective API in the API Manager server.