In this quick guide, you will learn about what an active directory is, how you can create an instance on Azure’s Active Directory, and also how to configure it from Spring boot which means how we can access the instance by configuring the instance properties
What is Active Directory?
Why use Active Directory?A cloud-native directory and identity platform offering these key advantages:
Who should use Active Directory?
Active Directory (AD) is a powerful tool for streamlining organizational data management. Administrators leverage AD to establish a clear hierarchical structure, assigning users to specific networks, defining profile pictures, and granting access permissions to resources like storage rooms. By centralizing these functions, AD significantly enhances efficiency and security.For instance, IT organizations can leverage this solution to safeguard sensitive employee information by implementing robust authentication and authorization protocols.Architecture of Active Directory
This shows the Active Directory workflow.
Creating Azure Active Directory Instance
1. Create an account on https://portal.azure.com then create a resource/tenant, then Identity, and then Azure Active Directory.
2. Enter your organization name and your Initial domain name. Copy the full URL of your directory; you will use that to add user accounts later in this tutorial. (For example: azureADsampledirectory.onmicrosoft.com.) Copy the full URL of your directory; you will use that to add user accounts later. (For example: azureADsampledirectory.onmicrosoft.com.)
When you have finished, select Create. It will take a few minutes to create the new resource.
3. When complete, select to access the new directory.
4. Copy the Tenant ID; you will use that value to configure your application.properties file later.
5. From the portal menu, select App registrations and then select Register an application.
6. Specify your application, and then select Register. When the page for your app registration appears, copy your Application ID and the Tenant ID.
7. Now, Click Certificates & secrets in the left navigation pane. Then select New client secret.
Add a Description and select duration in the Expires list. Click Add. The value for the key will be automatically filled in.
8. Now go to API permissions in the left navigation pane. Click Microsoft Graph and tick Access the directory as the signed-in user and Sign in and read user profile. Click Grant Permissions… and Yes when prompted.Click Grant admin consent for Azure Sample and select Yes.
9. After this, select Authentication and select Add a platform. Then select Web applications.Enter an endpoint URL that can accept data from azure as a new Redirect URI/Callback Response, and then select Configure to configure it.
10. Now we need to add a user to Active Directory. From the Overview page of your Active Directory, select Users, and then select New user.
When the User panel is displayed, enter the User name and Name. Then select Create.
Also, create a group of users for authentication. For this, we can select the user which we have created and form groups. Go back to the Users panel, select your test user, and select Reset password and reset it which we will be needed at the time of login.
Configure Active Directory through the app
Also, we need to configure WebSecurityConfig for authentication. This is how we can get connected to AD using spring boot.
Active Directory Advantages and Disadvantages:
Advantages
Disadvantages
Conclusion
This concise guide explores Active Directory on Azure. We'll delve into its fundamental concepts, the steps to create an Azure AD instance, and the practical application of integrating it with a Spring Boot application. By configuring the appropriate properties, you'll gain direct access to your Azure AD instance. Do check out our other blogs here.