Creating a Custom OAuth Application
You must create a custom OAuth application to authenticate to via OAuth with AzureAD as an IdP.
Register and Configure an Azure AD App
In the Azure Portal, complete the following steps:
- Click App registrations.
- If this options isn't listed on the Azure Portal homepage, either search for "App registrations" in the search box or navigate to More services > Identity > Identity Management > App Registerations.
- Click + New Registration.
- Enter a name and select a supported account type.
- Under Redirect URI (optional), select the Web option in the first dropdown and enter a local redirect URL. For example: http://localhost:8080
- Click Register. The newly created app's Overview screen loads.
- Note the Application (client) ID and the Directory (tenant) ID. These will be used later.
- Click Add a certificate or secret. The Certificates & secrets page loads.
- Click + New client secret > Add.
- Note the Value of the newly created client secret. This will be used later to configure the adapter.
- Warning: This value is only visible when you first create the client secret.
- Navigate to Manage > Expose an API in the sidebar.
- Click Add next to "Application ID URI". Specify a URI starting with "api://" (e.g. "api://mydominorest") and click Save.
- Click + Add a scope. The Add a Scope pane appears.
- Fill out the form in accordance with one of the scopes you want to grant to the adapter and click Add scope to complete the registration. Refer to the Domino documentation regarding scopes for information about the available scopes.
- Repeat the previous two steps for each scope that you want to enable.
- Click Manage > API permissions in the sidebar.
- Click + Add a permission > APIs my organization uses and select your application's name. If your application is not visible, type its name in the search box. The Request API permissions menu appears.
- Under "Select permissions", enable the scopes you defined by selecting their check boxes, then click Add permissions to confirm the selection.
- In the sidebar, click Manage > Owners.
- Click + Add Owners. Select the check box for the desired user(s) and click Select.
- Click Manage > Authentication in the sidebar.
- Under "Implicit grant and hybrid flows", select the Access tokens (used for implicit flows) check box and click Save.
- Navigate in the sidebar to Manage > Manifest.
- Note the value of the "id" in the manifest. This will be used later.
- Change the value of accessTokenAcceptedVersion from null to 2 and click Save.
- Click Overview in the sidebar to return to the application Overview page, then click Endpoints.
- Note the following URL values for later use:
- OAuth 2.0 authorization endpoint (v2)
- OAuth 2.0 token endpoint (v2)
- OpenID Connect metadata document
Configuring the REST API
In your Domino server, create a JSON file in the keepconfig.d folder within your notesdata folder. Populate the file with the following content:
{ "jwt": { "your_filename": { "active": true, "providerUrl": "https://login.microsoftonline.com/[tenantid]/v2.0/.well-known/openid-configuration", "aud": "[application id]", "iss": "[issuer URL]", "algorithm": "RS256" } } }
Modify this sample content as follows:
- Replace "your_filename" with the name of the JSON file you created, without the ".json" extension. Do not remove the double quotes.
- Replace [tenantid] with your Tenant ID. This is the "Directory (tenant) ID" on the Azure application's Overview page.
- Replace [application id] with the value of the Application (client) ID from the application's Overview page, which you noted earlier.
- Replace [issuer URL] with the the "issuer" URL associated with your providerUrl above.
- To find this, open the providerUrl (with the Tenant ID inserted) in your browser and look for the value of the "issuer" attribute.