Configuring additional applications for Azure AD and ADFS

We will continue the deployment and configuration of more business apps to allow you to test the different authentication mechanisms. For our support, we configure ServiceNow with SAML and active user provisioning from Azure AD to ServiceNow:

  1. Navigate to Azure Active Directory | Enterprise Applications and add a New Application:

Adding a new Enterprise application
  1. Choose ServiceNow and add the app from the gallery:

Adding ServiceNow
  1. After adding the application, we will configure SAML to authenticate our users:

Using SAML as an authentication method
  1. In the Basic SAML Configuration, we add our ServiceNow instance information, as shown in the following screenshot:

Configuring the SAML options

The following URIs need to be used:

https://.service-now.com/navpage.do
https://.service-now.com
We will use the automatic configuration method for this chapter.
  1. For the manual configuration tasks, you can download the certificate by using the Base64 option:

Download the signing certificate
  1. Also, for manual configuration tasks, you can copy the following links into a Notepad:

Azure AD endpoints overview
  1. Next, we will assign our Service Management Application Access group to the application:

Assigning users to the application
  1. Now, we can start to configure the ServiceNow instance for Single Sign-On.
  1. First, we need to activate the Multi-Provider Single Sign-On Installer plugin:

Multi-Provider SSO feature in ServiceNow
  1. You will find this option in the navigation pane on the left-hand side: System Definition | Plugins.
  2. Activate the following plugin:

Activating the Multi-Provider SSO feature in ServiceNow
  1. Click the Activate button in the dialog:

Activation dialog
  1. Next, we will configure the plugin under Multi-Provider SSO | Administration | Properties:

Configuring the newly installed plugin
  1. The following features need to be activated:

Activating the custom properties for the provider
  1. If you want to use the manual configuration method, you need to use the information in your Notepad.
  2. We use the automatic option for the configuration; it's a little bit of a hidden option!
  3. You will find it under View step-by-step instructions as shown in the following screenshot, in the SAML configuration section:

Automatic configuration option for the ServiceNow SSO Provider
  1. Click the option and the following dialog appears; enter your ServiceNow administrative credentials:

Configuring the SAML connection
  1. Click Configure Now.
  2. Next, we can do additional configuration tasks on the ServiceNow part.
  3. Navigate to Multi-Provider SSO | Identity Providers:

Identity Provider configuration
  1. You will find the automatically generated Identity Provider:

Start configuring the newly created Azure AD connection in ServiceNow
  1. We need to remove the populated Identity Provider's SingleLogoutRequest URL.
  1. All the other fields can be left as their defaults:

Configuring the IdP including the Auto Redirect option
  1. Very important! Set the Auto Redirect IdP option, with the expected result:

Auto Redirect IdP option
  1. Next, we need to choose the correct certificate for our configuration by navigating to the X.509 section:

Configuring the correct certificate
  1. Save the configuration.

Now, we have finished the SAML configuration of SeviceNow and we will follow up with the user provisioning:

  1. Navigate to the Provisioning section of the ServiceNow application and change the Provisioning Mode to Automatic.
  2. Insert the following values:
    • Instance Name
    • Admin Username
    • Admin Password
    • Notification Email (and check Send an email notification when a failure occurs):

Configuring the SCIM provisioning feature
  1. Click Test Connection and you should receive a notification like the following example. The test of the connection is required to save:

Connection Test
  1. Next, we will take a look into the synchronization configuration for users and groups.
  2. Click the Synchronize Azure Active Directory Users to ServiceNow rule:

Configuring the Synchronization Rules
  1. You will find the active Attribute Mapping. If you need to handle special considerations, such as if you connect to a filled ServiceNow instance, you can modify the mappings to fit your needs:

Synchronization Rule Settings
  1. You will also get an actual overview of the Synchronization Details:

Synchronization details for monitoring and auditing
  1. By clicking on View the "Account Provisioning" category in the audit logs for full details you will get the following screenshot:

Actual state for the test user
  1. Next, we will change to the Organization | User section in your ServiceNow instance.
  2. Search for your test user, in my case [email protected], and you will see the result of the automatic provisioning:

Verifying the synchronized test user in ServiceNow

The initial synchronization takes longer to perform than subsequent synchronizations, which occur approximately every 40 minutes as long as the service is running.

The next scenario we want to accomplish is the use of OpenID Connect and your on-premises ADFS infrastructure. To follow the authentication flow, use Chapter 6Managing Authentication Protocols.

To configure this scenario on your YD1APP01 server, we need to copy the active-directory-dotnet-webapp-openidconnect folder from the code package to your desktop.

We configure your ADFS server (YD1ADS01) on your domain controller to get the following expected result at the end, a full working OpenID authenticated application:

Result of the following configuration steps

In the next steps, we will configure the scenario:

  1. We start with the creation of a new application group including a Server application (standalone application):

Configuring the new application group
  1. Next, a Client Id is generated; copy the ID to a notepad.
  1. Enter the redirect URI, https://localhost:44320/, under which the application will run:

Providing the application properties
  1. Click Next and check Generate a shared secret box; copy the key to the notepad:

Generating the shared key
  1. Complete the wizard.
  2. Next, we will create the Web API configuration by double-clicking on your new application group.
  1. Choose Add application:

Web API configuration
  1. Use the Web API option:

Choosing the Web API option
  1. Next, add the Identifier for the API: https://inovitdemos.ch/OpenIDDemo.
  2. Click Next in the Access Control Policy section and all the other sections to finish the wizard.
  3. For now, we change to the YD1APP01 server and open our Visual Studio.
  4. Open the Solution file of the demo code: WebApp-OpenIDConnect-DotNet.sln.
  5. Navigate in Solution Explorer to the web.config file: WebApp-OpenIDConnect-DotNet.sln.
  6. Modify the code so that it looks like the following example:
    • Copy your Client Id from your notepad.
    • Configure the ida:ADFSDiscoveryDoc value so that it contains your ADFS FQDN: https://login.inovitdemos.ch.
    • Verify that the ida:PostLogoutRedirectUri value contains https://localhost:44320/:
 <appSettings>
<add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
<add key="ida:ClientId" value="40ef7c28-2172-4e4d-84b5-e9a284b94f75" />
<add key="ida:ADFSDiscoveryDoc" value="https://login.inovitdemos.ch/adfs/.well-known/openid- configuration" />
<add key="ida:PostLogoutRedirectUri" value="https://localhost:44320/" />
</appSettings>
  1. Next, navigate to the App_Start section and the Startup.Auth.cs file.
  2. Directly under the public partial class Startup, the code needs to look like the following to tweak the OpenID Connect middleware initialization logic:
private static string clientId = ConfigurationManager.AppSettings["ida:ClientId"];
//private static string aadInstance = ConfigurationManager.AppSettings["ida:AADInstance"];
//private static string tenant = ConfigurationManager.AppSettings["ida:Tenant"];
private static string metadataAddress = ConfigurationManager.AppSettings["ida:ADFSDiscoveryDoc"];
private static string postLogoutRedirectUri = ConfigurationManager.AppSettings["ida:PostLogoutRedirectUri"];
//string authority = String.Format(CultureInfo.InvariantCulture, aadInstance, tenant);
We don't need the Azure AD configuration, so we comment this part out!
  1. Next, we need to modify the OpenID Connect middleware options:
app.UseOpenIdConnectAuthentication(
new OpenIdConnectAuthenticationOptions
{
ClientId = clientId,
//Authority = authority,
MetadataAddress = metadataAddress,
RedirectUri = postLogoutRedirectUri,
PostLogoutRedirectUri = postLogoutRedirectUri
ADFS does enforce the redirect_uri in the request. Azure AD doesn't do that.
  1. Now, we can verify the app; press F5 in Visual Studio. To analyze the traffic, you can use Fiddler. Note that you will be stuck with Fiddler on the authentication part:

Fiddler result of the authentication
  1. Well done, you have configured an application that uses OpenID Connect!
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.204.201