Azure AD 3-legged OAuth 2.0 API Security Profile¶
Within a security profile, you can configure Microsoft Azure Active Directory (AD) as an OAuth 2.0 identity provider to provide API consumers access to an API using Azure AD authentication.
This page shows how to configure and use Azure AD authentication with a Jitterbit Custom, OData, or Proxy API by following these steps:
- Configuring Azure AD as an Identity Provider
Configure an OAuth 2.0 application and obtain the Client ID, Client Secret, and Directory ID that you will need to use as input for configuring a security profile in API Manager.
- Granting API Permissions to Jitterbit Harmony
Grant Jitterbit Harmony permissions to use the Azure AD APIs with the OAuth 2.0 application you created in the previous step.
- Configuring a Security Profile in API Manager
Configure and test Azure AD as the identity provider in API Manager. You will need to use the Client ID, Client Secret, and Directory ID obtained in the first step.
- Assigning a Security Profile in API Manager
Assign the security profile to one or more Jitterbit Custom, OData, or Proxy APIs.
- Accessing an API with Azure AD Authentication
API consumers are then able to use Azure AD authentication to consume Jitterbit Custom, OData, or Proxy APIs that the security profile is assigned to.
For additional information, see the Microsoft Azure documentation Configure an OpenID/OAuth application from the Azure AD app gallery.
For Azure AD 2-legged OAuth security profile configuration, see Azure AD 2-legged OAuth 2.0 API Security Profile.
Microsoft Azure AD Premium P1 edition is required to set up and use Azure AD as an identity provider.
Follow these steps to configure an OAuth 2.0 application in the Microsoft Azure portal and obtain the Client ID, Client Secret, and Directory ID needed for configuring Azure AD as an identity provider for a security profile:
Log in to the Microsoft Azure portal.
In the Microsoft Azure portal, go to App registrations and click New registration:
On the Register an application screen, specify the initial details of the application:
- Enter a Name. For example, Jitterbit API Manager APIs.
- Under Supported account types, select the appropriate option for your situation.
- Under Redirect URI (optional), use the dropdown to select Web and enter the
swagger-uiURI value appropriate for your region (see Finding My Region):
After clicking Register, on the Overview screen for the new application, the Application (client) ID and Directory (tenant) ID are displayed. Retain these for later use, as they will be required when configuring the security profile in API Manager:
On the Overview screen, click the link under Redirect URIs:
The Authentication screen for the application is displayed. Follow these steps to add two additional redirect URI values appropriate for your Harmony organization and region:
To obtain the additional URI values, in API Manager, open the security profile configuration screen and copy these values (the image below is cropped to show the relevant areas):
On the Authentication screen for the application in the Microsoft Azure portal, under the Web section, click Add URI and enter each additional URI value obtained above. Then click Save:
Under the Manage category on the left, select Certificates & secrets. Then, under Client secrets, click New client secret:
Provide a Description and set the secret to Never expire. Then click Add:
Use the Copy to clipboard icon to copy the new client secret. Retain this for later use, as it will be required when configuring the security profile in API Manager.
2. Granting API Permissions to Jitterbit Harmony¶
Follow these steps to grant Jitterbit Harmony permissions to use the Azure AD APIs with the OAuth 2.0 application that you created in the section Configuring Azure AD as an Identity Provider. If continuing from the previous section, you can start at step 3 below.
Log in to the Microsoft Azure portal.
In the Microsoft Azure portal, go to App registrations and select the OAuth 2.0 application that you created in the section Configuring Azure AD as an Identity Provider (in the example, called Jitterbit API Manager APIs).
Under the Manage category on the left, select API permissions. Then, under Configured permissions, click Add a permission:
On the Request API permissions screen, under the Microsoft APIs tab, select the Microsoft Graph API:
On the Request API permissions screen, select Delegated permissions:
The section Select permissions is now displayed. Within it, select these permissions:
Under OpenId permissions, select offline_access, openid, and profile:
Under User, select User.Read:
Once these permissions have been selected, at the bottom of the Request API permissions screen, click Add permissions.
You are returned to the API permissions screen for the application. Under Configured permissions, click Grant admin consent for \<Directory>:
Acknowledge the dialog to grant consent for the directory:
Under Configured permissions, the Status column should now show that consent has been granted for each added permission:
3. Configuring a Security Profile in API Manager¶
The Profile Name must not contain any spaces. If the Profile Name contains spaces, you will receive an error when attempting to access an API using that security profile. Azure AD returns an error similar to this:
The reply URL specified in the request does not match the reply URLs configured for the application.
During configuration, select OAuth 2.0 as the authentication Type and Azure AD as the OAuth Provider:
Enter the OAuth Client ID and OAuth Client Secret obtained in Configuring Azure AD as an Identity Provider.
Edit the OpenID Discovery URL, the OAuth Authorization URL, the OAuth Token URL, and the User Info URL to replace the placeholder directory ID (
yourDirectoryID) with the Directory ID obtained in the Overview section of your app in the Microsoft Azure portal.
Click Test Client ID + Secret to verify connectivity with the identity provider using the configuration.
4. Assigning a Security Profile in API Manager¶
To use the security profile with an API, follow the instructions for configuring a Custom API, OData Service, or Proxy API and select the security profile configured with Azure AD OAuth 2.0 authentication.
5. Accessing an API with Azure AD Authentication¶
To consume the API, use the link to Copy URL and use it within the calling application:
If the API supports GET, you can also paste the URL into a web browser to consume the API manually.
When 3-legged OAuth 2.0 is being used, the browser redirects to the native login interface for Azure AD. Provide your credentials to authenticate with Azure AD.
If the authentication is successful, the expected payload is displayed in the web browser.