How do I setup OAuth 2.0 with CMiC?
Learn how to connect SmartBarrel to CMiC using OAuth 2.0 authentication.
Setting Up the Connection
CMiC OAuth 2.0 requires setup in three places: CMiC, Azure (or your identity provider), and SmartBarrel. Your CMiC administrator and IT team will need to complete the first two steps before you can connect in SmartBarrel.
Step 1: CMiC Setup
Your CMiC administrator will need to:
- Create a dedicated API service account in CMiC for the SmartBarrel integration. For detailed steps, refer to the CMiC Developer API Account documentation: https://developers.cmicglobal.com/v1/docs/developer-api-account Note down the following from the service account:
- Client ID (e.g. ACME)
- User ID (e.g. SMARTBARREL)
- Create an API role and assign the required API endpoints to it
- Register your Azure app in CMiC using your Azure Issuer URL and Application (Client) ID, and assign the role to the app
For steps 2 and 3, refer to the CMiC API Security Configuration documentation: https://docs.cmicglobal.com/portal/Content/E_Reference_Material/CMiC_API_Access_Setup/Reference/API_Access_Setup/Security/API_Security_Configuration.htm
Step 2: Azure Entra ID Setup
Your IT team will need to create an App Registration in Microsoft Entra ID (https://entra.microsoft.com) and configure it to work with CMiC. This includes:
- Creating the App Registration and a Client Secret
- Setting an Application ID URI
- Updating the app Manifest
- Adding a custom cmicuser claim using the service account details from Step 1 (format: ClientID||UserID, e.g. ACME||SMARTBARREL)
For detailed steps, refer to the CMiC Microsoft Entra ID Application documentation: https://docs.cmicglobal.com/portal/Content/E_Reference_Material/OAuth/References/OAuth2_Microsoft_Entra_ID_App.htm
Step 3: Connect in SmartBarrel
Once the above is complete, gather the following from your Azure and CMiC administrators:
- Endpoint: Your CMiC OAuth API URL. Note: this is different from the Basic Auth URL. For cloud users you can find your OAuth URL in the following URL: https://developers.cmicglobal.com/v1/docs/cloud-api-server-urls
- Token URL: Your Azure token endpoint (e.g. https://login.microsoftonline.com/your-tenant-id/oauth2/v2.0/token)
- Client ID: The Application (Client) ID from your Azure App Registration
- Client Secret: The client secret value created in Azure
- Scope: api://your-client-id/.default (filled in automatically if left blank)
To connect the integration, follow these steps:
- Navigate to the SmartBarrel dashboard and click Integrations in the left-hand sidebar menu.
- Find the CMiC integration card and click Connect.
- Select OAuth 2.0 as the Authentication Method.
- Enter your Endpoint, Token URL, Client ID, Client Secret, and Scope.
- Click Connect. SmartBarrel will verify the credentials and confirm the connection.
