Configure Azure Entra as an OpenID Provider¶
Register your app¶
Sign in to the Microsoft Entra admin center.
Browse to Applications > App registrations using the sidebar.
Enter the name of your application, like
spiffworkflow-backend.Under supported account types, you will likely want “Accounts in this organizational directory only”
Skip the redirect URL. We will do that later.
Click Register.
In the new view, copy and note the following:
Application (client) ID. It is your Client ID.
Directory (tenant) ID. This is part of your server URL.
Configure your app¶
Select Authentication from the sidebar.
Under Platform configurations, select “+ Add a platform”
In the pane that opens, select Web.
Under Redirect URIs, add
http://localhost:8000/v1.0/login_returnLeave Front-chanel logout URL blank.
Leave the checkboxes unchecked under Implicit grant and hybrid flows.
Click Configure.
Add additional Redirect URLs¶
You will need to add more redirect URLs.
Follow these instructions for the following URL patterns:
https://<domainname>/v1.0/login_return
Under Web > Redirect URIs, click Add URI.
Type in the URL pattern.
Create a Client Secret¶
Select Certificates & Secrets from the sidebar.
Click + New client secret
In the pane that opens, enter a description and expiration, then click Add.
Copy the Value using the icon after the string and note this value. This is your Client Secret Key.
Add groups claim to the token¶
The basic steps are:
Select Token configuration from the sidebar.
Select Add groups claim.
Select the group types to return (Security groups, or Directory roles, All groups, and/or Groups assigned to the application)
Select Save.
For more information about these settings read the Microsoft documentation
Configure Spiff Workflow¶
Set the following environment variables on your SpiffWorkflow backend server to connect with your Azure Entra instance:
# OpenID Server URL
SPIFFWORKFLOW_BACKEND_OPEN_ID_SERVER_URL=https://login.microsoftonline.com/<YOUR_DIRECTORY_(TENANT)_ID>
# Client ID and Secret Key from Okta
SPIFFWORKFLOW_BACKEND_OPEN_ID_CLIENT_ID=<YOUR_CLIENT_ID>
SPIFFWORKFLOW_BACKEND_OPEN_ID_CLIENT_SECRET_KEY=<YOUR_CLIENT_SECRET_KEY>
# Additional valid issuers (don't forget the trailing slash)
SPIFFWORKFLOW_BACKEND_OPEN_ID_ADDITIONAL_VALID_ISSUERS: "https://sts.windows.net/<YOUR_DIRECTORY_(TENANT)_ID>/"
# OpenID Scopes (includes groups)
SPIFFWORKFLOW_BACKEND_OPENID_SCOPE="openid profile email groups"
# Allow OpenID Provider to manage user groups
SPIFFWORKFLOW_BACKEND_OPEN_ID_IS_AUTHORITY_FOR_USER_GROUPS: true