Configure OpenID Connect login with Azure AD

This configuration example has been tested by using Ubisecure SSO 8.6 and Azure AD Free license in Feb 2021.

Ubisecure Identity Platform can be configured to use external Identity Providers for user authentication. The prerequisite is that the Identity Provider implements one of the protocols supported by Ubisecure Identity Platform, typically SAML2 or OpenID Connect. For the list of all supported protocols, please refer to Authentication methods - SSO.

Microsoft Azure AD supports both SAML2 and OpenID Connect. This article describes how Azure AD can be configured as Identity Provider with OpenID Connect. For using SAML2 for the integration, please refer to https://ubisecuredev.atlassian.net/wiki/display/KNB/Lab+2.5%3A+Federation+Configuration.

Register Azure AD application

The following screenshots show how to register Ubisecure Identity Platform as an application at Azure Portal.

1. Select App Registrations and New Registration:


2. Give a display name for your application. The name will be displayed to users when they first time log in via Azure AD, and a consent is requested for using their Azure user profile. Based on your business/technical requirements, select the Azure AD accounts that can be used for accessing your application. The Redirect URI is not needed at this phase.


3. Click on Endpoints and save the OpenID Connect Metadata address, it will be needed in the next phase.

  

Create Ubisecure SSO authentication method

Note: With Ubisecure SSO 8.8.x or later, you can choose to use the Management User Interface instead of the Management API for configuring the OpenID Connect method:  https://ubisecuredev.atlassian.net/wiki/display/KNB/Configure+OpenID+Connect+authentication+method+in+SSO+Management+UI.

Identity Providers are configured as authentication methods for Ubisecure Identity Platform. You need to use the Ubisecure SSO Management API for creating and configuring Azure AD as an authentication method. If you haven't enabled the Management API in your environment, use the instructions here to do it first: Management API configuration - SSO.

Below the steps for configuring Azure AD as OpenID Connect provider are described. A generic process for creating and configuring an OpenID Connect authentication method is described here: OpenID Connect authentication method - SSO.

The configuration example is presented by using Curl commands. Additional information on using Curl to access the management API are available in the article Use the Ubisecure SSO Management API with curl. Would you like to use Postman instead, please contact Ubisecure Support or Sales Engineer for a preconfigured Postman Collection for this purpose.


1. Create Azure AD authentication method

To create an enabled authentication method named azure.oidc.1 with a Title Azure AD use this API call:

Create authentication method
curl --request PUT 'https://login.example.com/sso-api/method/azure.oidc.1' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer eyJjdHkiOiJKV...oH5OBg.K4AhK6Ca18Pd7wOJOy9sZw' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'title=Azure AD' \
--data-urlencode 'enabled=true' \
--data-urlencode 'configuration=OperationMode private' \
--data-urlencode 'methodType=OpenIDConnectMethod' \
--data-urlencode 'className=ubilogin.method.provider.openidconnect.OpenIDConnectMethod'

{
    "type": "method",
    "id": "/method/azure.oidc.1",
    "attributes": {
        "name": "azure.oidc.1",
        "methodType": "OpenIDConnectMethod",
        "className": "ubilogin.method.provider.openidconnect.OpenIDConnectMethod",
        "enabled": true,
        "title": "Azure AD",
        "configuration": [
            "OperationMode private"
        ]
    }
}


2. Register Azure AD metadata

Use the metadata address you saved on the step 3 of the chapter Register Azure AD Application above and fetch the metadata with a web browser. Copy the metadata as is to the API call. Within a Curl command you need hyphens around the metadata as in the following example.

Register metadata
curl --request PUT 'https://login.example.com/sso-api/method/azure.oidc.1/$attribute/metadata' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer eyJjdHkiOiJKV...oH5OBg.K4AhK6Ca18Pd7wOJOy9sZw' \
--header 'Content-Type: application/json' \
--data-raw '{"token_endpoint":"https://login.microsoftonline.com/organizations/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/organizations/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/{tenantid}/v2.0","request_uri_parameter_supported":false,"userinfo_endpoint":"https://graph.microsoft.com/oidc/userinfo","authorization_endpoint":"https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/organizations/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/organizations/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],"tenant_region_scope":null,"cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}'


{
    "token_endpoint": "https://login.microsoftonline.com/organizations/oauth2/v2.0/token",
    "token_endpoint_auth_methods_supported": [
        "client_secret_post",
        "private_key_jwt",
        "client_secret_basic"
    ],
    "jwks_uri": "https://login.microsoftonline.com/organizations/discovery/v2.0/keys",
    "response_modes_supported": [
        "query",
        "fragment",
        "form_post"
    ],
    "subject_types_supported": [
        "pairwise"
    ],
    "id_token_signing_alg_values_supported": [
        "RS256"
    ],
    "response_types_supported": [
        "code",
        "id_token",
        "code id_token",
        "id_token token"
    ],
    "scopes_supported": [
        "openid",
        "profile",
        "email",
        "offline_access"
    ],
    "issuer": "https://login.microsoftonline.com/{tenantid}/v2.0",
    "request_uri_parameter_supported": false,
    "userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo",
    "authorization_endpoint": "https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize",
    "device_authorization_endpoint": "https://login.microsoftonline.com/organizations/oauth2/v2.0/devicecode",
    "http_logout_supported": true,
    "frontchannel_logout_supported": true,
    "end_session_endpoint": "https://login.microsoftonline.com/organizations/oauth2/v2.0/logout",
    "claims_supported": [
        "sub",
        "iss",
        "cloud_instance_name",
        "cloud_instance_host_name",
        "cloud_graph_host_name",
        "msgraph_host",
        "aud",
        "exp",
        "iat",
        "auth_time",
        "acr",
        "nonce",
        "preferred_username",
        "name",
        "tid",
        "ver",
        "at_hash",
        "c_hash",
        "email"
    ],
    "tenant_region_scope": null,
    "cloud_instance_name": "microsoftonline.com",
    "cloud_graph_host_name": "graph.windows.net",
    "msgraph_host": "graph.microsoft.com",
    "rbac_url": "https://pas.windows.net"
}

Note: The attribute issuer is used as entityID of the authentication method and some SAML implementations may not accept curly braces within an entityID. If you are using SAML2 for connecting Ubisecure Identity Platform to your applications, before registering the metadata, it may be necessary to edit it as follows:

"issuer": "https://login.microsoftonline.com/{tenantid}/v2.0"
->
"issuer": "https://login.microsoftonline.com/"


3. Register Azure AD keys

Within the metadata, the keys are specified by the attribute jwks_uri. Use a web browser to fetch the keys from the specified address, and register them as follows.

Register keys
curl --request PUT 'https://login.example.com:8443/sso-api/method/azure.oidc.1/$attribute/jwks' \
--header 'Accept: application/jwk-set+json' \
--header 'Content-Type: application/jwk-set+json' \
--header 'Authorization: Bearer eyJjdHkiOiJKV...oH5OBg.K4AhK6Ca18Pd7wOJOy9sZw' \
--data-raw '{"keys":[{"kty":"RSA","use":"sig","kid":"nOo3ZDrODXEK1jKWhXslHR_KXEg","x5t":"nOo3ZDrODXEK1jKWhXslHR_KXEg","n":"oaLLT9hkcSj2tGfZsjbu7Xz1Krs0qEicXPmEsJKOBQHauZ_kRM1HdEkgOJbUznUspE6xOuOSXjlzErqBxXAu4SCvcvVOCYG2v9G3-uIrLF5dstD0sYHBo1VomtKxzF90Vslrkn6rNQgUGIWgvuQTxm1uRklYFPEcTIRw0LnYknzJ06GC9ljKR617wABVrZNkBuDgQKj37qcyxoaxIGdxEcmVFZXJyrxDgdXh9owRmZn6LIJlGjZ9m59emfuwnBnsIQG7DirJwe9SXrLXnexRQWqyzCdkYaOqkpKrsjuxUj2-MHX31FqsdpJJsOAvYXGOYBKJRjhGrGdONVrZdUdTBQ","e":"AQAB","x5c":["MIIDBTCCAe2gAwIBAgIQN33ROaIJ6bJBWDCxtmJEbjANBgkqhkiG9w0BAQsFADAtMSswKQYDVQQDEyJhY2NvdW50cy5hY2Nlc3Njb250cm9sLndpbmRvd3MubmV0MB4XDTIwMTIyMTIwNTAxN1oXDTI1MTIyMDIwNTAxN1owLTErMCkGA1UEAxMiYWNjb3VudHMuYWNjZXNzY29udHJvbC53aW5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qp7AnAcVrcbiXA/bmMCnFWuNNahcaAKiJTxYlKDaDIiPN35yECYbDj0PBWJUxobrvj5I275jbikkp8QSLYnSU/v7dMDUbxSLfZ7zsTuaF2Qx+L62PsYTwLzIFX3M8EMSQ6h68TupFTi5n0M2yIXQgoRoNEDWNJZ/aZMY/gqT02GQGBWrh+/vJ"],"issuer":"https://login.microsoftonline.com/{tenantid}/v2.0"},{"kty":"RSA","use":"sig","kid":"DqUu8gf-nAgcyjP3-SuplNAXAnc","x5t":"DqUu8gf-nAgcyjP3-SuplNAXAnc","n":"1n7-nWSLeuWQzBRlYSbS8RjvWvkQeD7QL9fOWaGXbW73VNGH0YipZisPClFv6GzwfWECTWQp19WFe_lASka5-KEWkQVzCbEMaaafOIs7hC61P5cGgw7dhuW4s7f6ZYGZEzQ4F5rHE-YNRbvD51qirPNzKHk3nji1wrh0YtbPPIf--NbI98bCwLLh9avedOmqESzWOGECEMXv8LSM-B9SKg_4QuBtyBwwIakTuqo84swTBM5w8PdhpWZZDtPgH87Wz-_WjWvk99AjXl7l8pWPQJiKNujt_ck3NDFpzaLEppodhUsID0ptRA008eCU6l8T-ux19wZmb_yBnHcV3pFWhQ","e":"AQAB","x5c":["MIIC8TCCAdmgAwIBAgIQYVk/tJ1e4phISvVrAALNKTANBgkqhkiG9w0BAQsFADAjMSEwHwYDVQQDExhsb2dpbi5taWNyb3NvZnRvbmxpbmUudXMwHhcNMjAxMjIxMDAwMDAwWhcNMjUxMjIxMDAwMDAwWjAjMSEwHwYDVQQDExhsb2dpbi5taWNyb3NvZnRvbmxpbmUudXMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDWfv6dZIt65ZDMFGVhJtLxGO9a+RB4PtAv185ZoZdtbvdU0YfRiKlmKw8KUW/obPB9YQJNZCnX1YV7+UBKRrn4oRaRBXMJsQxppp84izuELrU/lwaDDt2G5bizt/plgZkTNDgXmscT5g1Fu8PnWqKs83MoeTeeOLXCuHRi1s88h/741sj3xsLAsuH1q9506aoRLNY4YQIQxe/wtIz4H1IqD/hC4G3IHDAhqRO6qjzizBMEznDw92GlZlkO0+AfztbP79aNa+T30CNeXuXylY9AmIo26O39yTc0MWnNosSmmh2FSwgPSm1EDTTx4JTqXxP67HX3BmZv/IGcdxXekVaFAgMBAAGjITAfMB0GA1UdDgQWBBQ2r//lgTPcKughDkzmCtRlw+P9SzANBgkqhkiG9w0BAQsFAAOCAQEAsFdRyczNWh/qpYvcIZbDvWYzlrmFZc6blcUzns9zf7sUWtQZrZPu5DbetV2Gr2r3qtMDKXCUaR+pqoy3I2zxTX3x8bTNhZD9YAgAFlTLNSydTaK5RHyB/5kr6B7ZJeNIk3PRVhRGt6ybCJSjV/VYVkLR5fdLP+5GhvBESobAR/d0ntriTzp7/tLMb/oXx7w5Hu1m3I8rpMocoXfH2SH1GLmMXj6Mx1dtwCDYM6bsb3fhWRz9O9OMR6QNiTnq8q9wn1QzBAnRcswYzT1LKKBPNFSasCvLYOCPOZCL+W8N8jqa9ZRYNYKWXzmiSptgBEM24t3m5FUWzWqoLu9pIcnkPQ=="],"issuer":"https://login.microsoftonline.com/{tenantid}/v2.0"}]}'

{
    "keys": [
        {
            "kty": "RSA",
            "use": "sig",
            "kid": "nOo3ZDrODXEK1jKWhXslHR_KXEg",
            "x5t": "nOo3ZDrODXEK1jKWhXslHR_KXEg",
            "n": "oaLLT9hkcSj2tGfZsjbu7Xz1Krs0qEicXPmEsJKOBQHauZ_kRM1HdEkgOJbUznUspE6xOuOSXjlzErqBxXAu4SCvcvVOCYG2v9G3-uIrLF5dstD0sYHBo1VomtKxzF90Vslrkn6rNQgUGIWgvuQTxm1uRklYFPEcTIRw0LnYknzJ06GC9ljKR617wABVrZNkBuDgQKj37qcyxoaxIGdxEcmVFZXJyrxDgdXh9owRmZn6LIJlGjZ9m59emfuwnBnsIQG7DirJwe9SXrLXnexRQWqyzCdkYaOqkpKrsjuxUj2-MHX31FqsdpJJsOAvYXGOYBKJRjhGrGdONVrZdUdTBQ",
            "e": "AQAB",
            "x5c": [
                "MIIDBTCCAe2gAwIBAgIQN33ROaIJ6bJBWDCxtmJEbjANBgkqhkiG9w0BAQsFADAtMSswKQYDVQQDEyJhY2NvdW50cy5hY2Nlc3Njb250cm9sLndpbmRvd3MubmV0MB4XDTIwMTIyMTIwNTAxN1oXDTI1MTIyMDIwNTAxN1owLTErMCkGA1UEAxMiYWNjb3VudHMuYWNjZXNzY29udHJvbC53aW5kb3dzLm5ldDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKGiy0/YZHEo9rRn2bI27u189Sq7NKhInFz5hLCSjgUB2rmf5ETNR3RJIDiW1M51LKROsTrjkl45cxK6gcVwLuEgr3L1TgmBtr/Rt/riKyxeXbLQ9LGBwaNVaJrSscxfdFbJa5J+qzUIFBiFoL7kE8ZtbkZJWBTxHEyEcNC52JJ8ydOhgvZYykete8AAVa2TZAbg4ECo9+6nMsaGsSBncRHJlRWVycq8Q4HV4faMEZmZ+iyCZRo2fZufXpn7sJwZ7CEBuw4qycHvUl6y153sUUFqsswnZGGjqpKSq7I7sVI9vjB199RarHaSSbDgL2FxjmASiUY4RqxnTjVa2XVHUwUCAwEAAaMhMB8wHQYDVR0OBBYEFI5mN5ftHloEDVNoIa8sQs7kJAeTMA0GCSqGSIb3DQEBCwUAA4IBAQBnaGnojxNgnV4+TCPZ9br4ox1nRn9tzY8b5pwKTW2McJTe0yEvrHyaItK8KbmeKJOBvASf+QwHkp+F2BAXzRiTl4Z+gNFQULPzsQWpmKlz6fIWhc7ksgpTkMK6AaTbwWYTfmpKnQw/KJm/6rboLDWYyKFpQcStu67RZ+aRvQz68Ev2ga5JsXlcOJ3gP/lE5WC1S0rjfabzdMOGP8qZQhXk4wBOgtFBaisDnbjV5pcIrjRPlhoCxvKgC/290nZ9/DLBH3TbHk8xwHXeBAnAjyAqOZij92uksAv7ZLq4MODcnQshVINXwsYshG1pQqOLwMertNaY5WtrubMRku44Dw7R"
            ],
            "issuer": "https://login.microsoftonline.com/{tenantid}/v2.0"
        },
        {
            "kty": "RSA",
            "use": "sig",
            "kid": "l3sQ-50cCH4xBVZLHTGwnSR7680",
            "x5t": "l3sQ-50cCH4xBVZLHTGwnSR7680",
            "n": "sfsXMXWuO-dniLaIELa3Pyqz9Y_rWff_AVrCAnFSdPHa8__Pmkbt_yq-6Z3u1o4gjRpKWnrjxIh8zDn1Z1RS26nkKcNg5xfWxR2K8CPbSbY8gMrp_4pZn7tgrEmoLMkwfgYaVC-4MiFEo1P2gd9mCdgIICaNeYkG1bIPTnaqquTM5KfT971MpuOVOdM1ysiejdcNDvEb7v284PYZkw2imwqiBY3FR0sVG7jgKUotFvhd7TR5WsA20GS_6ZIkUUlLUbG_rXWGl0YjZLS_Uf4q8Hbo7u-7MaFn8B69F6YaFdDlXm_A0SpedVFWQFGzMsp43_6vEzjfrFDJVAYkwb6xUQ",
            "e": "AQAB",
            "x5c": [
                "MIIDBTCCAe2gAwIBAgIQWPB1ofOpA7FFlOBk5iPaNTANBgkqhkiG9w0BAQsFADAtMSswKQYDVQQDEyJhY2NvdW50cy5hY2Nlc3Njb250cm9sLndpbmRvd3MubmV0MB4XDTIxMDIwNzE3MDAzOVoXDTI2MDIwNjE3MDAzOVowLTErMCkGA1UEAxMiYWNjb3VudHMuYWNjZXNzY29udHJvbC53aW5kb3dzLm5ldDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALH7FzF1rjvnZ4i2iBC2tz8qs/WP61n3/wFawgJxUnTx2vP/z5pG7f8qvumd7taOII0aSlp648SIfMw59WdUUtup5CnDYOcX1sUdivAj20m2PIDK6f+KWZ+7YKxJqCzJMH4GGlQvuDIhRKNT9oHfZgnYCCAmjXmJBtWyD052qqrkzOSn0/e9TKbjlTnTNcrIno3XDQ7xG+79vOD2GZMNopsKogWNxUdLFRu44ClKLRb4Xe00eVrANtBkv+mSJFFJS1Gxv611hpdGI2S0v1H+KvB26O7vuzGhZ/AevRemGhXQ5V5vwNEqXnVRVkBRszLKeN/+rxM436xQyVQGJMG+sVECAwEAAaMhMB8wHQYDVR0OBBYEFLlRBSxxgmNPObCFrl+hSsbcvRkcMA0GCSqGSIb3DQEBCwUAA4IBAQB+UQFTNs6BUY3AIGkS2ZRuZgJsNEr/ZEM4aCs2domd2Oqj7+5iWsnPh5CugFnI4nd+ZLgKVHSD6acQ27we+eNY6gxfpQCY1fiN/uKOOsA0If8IbPdBEhtPerRgPJFXLHaYVqD8UYDo5KNCcoB4Kh8nvCWRGPUUHPRqp7AnAcVrcbiXA/bmMCnFWuNNahcaAKiJTxYlKDaDIiPN35yECYbDj0PBWJUxobrvj5I275jbikkp8QSLYnSU/v7dMDUbxSLfZ7zsTuaF2Qx+L62PsYTwLzIFX3M8EMSQ6h68TupFTi5n0M2yIXQgoRoNEDWNJZ/aZMY/gqT02GQGBWrh+/vJ"
            ],
            "issuer": "https://login.microsoftonline.com/{tenantid}/v2.0"
        },
        {
            "kty": "RSA",
            "use": "sig",
            "kid": "DqUu8gf-nAgcyjP3-SuplNAXAnc",
            "x5t": "DqUu8gf-nAgcyjP3-SuplNAXAnc",
            "n": "1n7-nWSLeuWQzBRlYSbS8RjvWvkQeD7QL9fOWaGXbW73VNGH0YipZisPClFv6GzwfWECTWQp19WFe_lASka5-KEWkQVzCbEMaaafOIs7hC61P5cGgw7dhuW4s7f6ZYGZEzQ4F5rHE-YNRbvD51qirPNzKHk3nji1wrh0YtbPPIf--NbI98bCwLLh9avedOmqESzWOGECEMXv8LSM-B9SKg_4QuBtyBwwIakTuqo84swTBM5w8PdhpWZZDtPgH87Wz-_WjWvk99AjXl7l8pWPQJiKNujt_ck3NDFpzaLEppodhUsID0ptRA008eCU6l8T-ux19wZmb_yBnHcV3pFWhQ",
            "e": "AQAB",
            "x5c": [
                "MIIC8TCCAdmgAwIBAgIQYVk/tJ1e4phISvVrAALNKTANBgkqhkiG9w0BAQsFADAjMSEwHwYDVQQDExhsb2dpbi5taWNyb3NvZnRvbmxpbmUudXMwHhcNMjAxMjIxMDAwMDAwWhcNMjUxMjIxMDAwMDAwWjAjMSEwHwYDVQQDExhsb2dpbi5taWNyb3NvZnRvbmxpbmUudXMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDWfv6dZIt65ZDMFGVhJtLxGO9a+RB4PtAv185ZoZdtbvdU0YfRiKlmKw8KUW/obPB9YQJNZCnX1YV7+UBKRrn4oRaRBXMJsQxppp84izuELrU/lwaDDt2G5bizt/plgZkTNDgXmscT5g1Fu8PnWqKs83MoeTeeOLXCuHRi1s88h/741sj3xsLAsuH1q9506aoRLNY4YQIQxe/wtIz4H1IqD/hC4G3IHDAhqRO6qjzizBMEznDw92GlZlkO0+AfztbP79aNa+T30CNeXuXylY9AmIo26O39yTc0MWnNosSmmh2FSwgPSm1EDTTx4JTqXxP67HX3BmZv/IGcdxXekVaFAgMBAAGjITAfMB0GA1UdDgQWBBQ2r//lgTPcKughDkzmCtRlw+P9SzANBgkqhkiG9w0BAQsFAAOCAQEAsFdRyczNWh/qpYvcIZbDvWYzlrmFZc6blcUzns9zf7sUWtQZrZPu5DbetV2Gr2r3qtMDKXCUaR+pqoy3I2zxTX3x8bTNhZD9YAgAFlTLNSydTaK5RHyB/5kr6B7ZJeNIk3PRVhRGt6ybCJSjV/VYVkLR5fdLP+5GhvBESobAR/d0ntriTzp7/tLMb/oXx7w5Hu1m3I8rpMocoXfH2SH1GLmMXj6Mx1dtwCDYM6bsb3fhWRz9O9OMR6QNiTnq8q9wn1QzBAnRcswYzT1LKKBPNFSasCvLYOCPOZCL+W8N8jqa9ZRYNYKWXzmiSptgBEM24t3m5FUWzWqoLu9pIcnkPQ=="
            ],
            "issuer": "https://login.microsoftonline.com/{tenantid}/v2.0"
        }
    ]
}


4. Get OpenID Connect registration request

Azure AD does not use a registration protocol, but this is a way to get the redirect_uri that is needed in Azure AD configuration.

Get redirect_uri
curl --request GET 'https://login.example.com/sso-api/method/azure.oidc.1/$attribute/registration' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer eyJjdHkiOiJKV...oH5OBg.K4AhK6Ca18Pd7wOJOy9sZw'

{
    "redirect_uris": [
        "https://login.example.com/uas/return/azure.oidc.1/redirect"
    ],
    "grant_types": [
        "authorization_code"
    ],
    "response_types": [
        "code"
    ],
    "jwks": {
        "keys": [
            {
                "kid": "5g2Oe2XTjSclW_Q39BJ2lYmU_lE",
                "kty": "RSA",
                "n": "0xavPW6yRPshCUP1I6bx8m7TtyjeSo16Gj3wmzdGv8HWW0aZqW4zlKIYQjYfIip2niZHrr8KmyIwqkhsWyJFlN5tzuafrip5wm89eCkf3U5GNpFKrNt7vZEFdaSMV_uwiNLBQptLIggfMskvaVk_rhMikpV-U70Y9tzGfmMxQmIU_OrxX-s0OizSIbeXZ8Fj9d0yuKG1eY-FfxcbOxlp2enyxrrcTFU240GtkozLWrs841RQYzP-NY6SC9_tQwVX72UfPVAtvSBhYEdGoKgGblx2N8XPlKGraYBY6x8VHLTOQXDjHOYXCj_EDh6c-glk5R8qfZzSknJCD6d0LL3tGw",
                "e": "AQAB"
            }
        ]
    },
    "scope": "openid",
    "id_token_signed_response_alg": "RS256",
    "token_endpoint_auth_method": "private_key_jwt"
}


Complete the Azure AD configuration

Copy the redirect_uri from the previous step and update it to the Azure AD application as follows:

    


Copy the client_id and client_secret as follows. They are needed in the next step. Depending on your security requirements, you may choose to define an expiration time for your client secret.

      


Complete the authentication method configuration

Update the client_id and client_secret to the authentication method:

Register client_id and client_secret
curl --request PUT 'https://login.example.com/sso-api/method/azure.oidc.1/$attribute/registration' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer eyJjdHkiOiJKV...oH5OBg.K4AhK6Ca18Pd7wOJOy9sZw' \
--header 'Content-Type: application/json' \
--data-raw '{
   "client_id":"688a8f19-56d9-4412-ab6d-4e0ab1f77550",
   "client_secret":"6lW2_CbV5z5PO.twXSvg5U_sdD.DBY6EVm",
   "id_token_signed_response_alg":"none"
}'

Now the Azure AD authentication method configuration is ready. Please use normal procedures to define it as an authentication method for your applications.