OAuth2 – CMiC Configuration
Note This article is still under construction. More information will be provided in the upcoming weeks.
Overview
CMiC OAuth2 support is based on the JWT Access token and has registered key details (appid, issuer uri, jwks uri) in CMiC that will be used to validate requests it will accept.
The access token is passed in the Authorization header and the Bearer {access token} value.
Note For OAuth2 to be supported the whole environment will be switched, we suggest a separate environment is created for OAuth2 rather than modifying the existing one.
Requirements
-
Register the application in Azure. Alternatively, use an existing one that is going to serve back JWT access tokens.
-
Gather the following three pieces of information:
-
Application (client) ID
-
This is the unique identifier for the registered application.
-
Review How to Get Application ID.
-
-
Token Issuer
-
The issuer who is going to generate your JWT access token.
-
ex. https://sts.windows.net/{azure_tenant_id}/
-
Replace {azure_tenant_id} with the tenant of the application.
-
-
Can be found in the openid-configuration.
-
Review How to Get Issuer and jwks_uri.
-
-
Jwks uri (Json web key set)
-
The key set which is used to sign the JWT access token.
-
This can be found in the openid-configuration.
-
Review How to Get Issuer and jwks_uri.
-
-
Information Inserted into CMiC
The following information needs to be inserted into CMiC:
insert into da.sdapi_app_registration_tn t
(APIIA_APPLICATION_ID, APIIA_ISSUER_URI, APIIA_JWKS_URI)
values
('{application id}', '{issuer_uri}', '{jwks_uri}');
Example
insert into da.sdapi_app_registration_tn t
(APIIA_APPLICATION_ID, APIIA_ISSUER_URI, APIIA_JWKS_URI)
values
('12345', 'https://sts.windows.net/{tenant_id}/', 'https://login.windows.net/common/discovery/keys');
List of CMiC App Properties
The following describes the different cmicapp.properties and what they're used for.
cmic.oauth2.ipcheck.enabled
To enable or disable the IP check. This is enabled by default.
cmic.oauth2.remove.domainFromUser
To remove the domain from the CMiC user. For example, if the property value is cmic.ca, then all emails with @cmic.ca will be removed and only the username portion will be passed as the CMiC user.
cmic.oauth2.user.claim.name
This is a specific token claim which holds the CMiC username.