Azure Services Part 2— Integrate Azure Active Directory with PHP Application

Sahani Rajapakshe
4 min readAug 8, 2020

This article series have been written as a partial requirement for the course : SENG 41283 : Distributed and Cloud Computing. The areas I discussed here are :

  • setting up a sample environment in Azure cloud platform
  • the cloud infrastructure setup for a simple PHP web application using the available services in Azure environment.

Azure Active Directory

Introduction

Azure AD is Microsoft’s cloud based identity and user management server, which helps access to resources in.

For example, all employees in an organization need access to some Azure services to perform their tasks. They can access services like SQL databases or Azure container services when the administrator assigns them separate user_id and password. Employees, as well as administrators, often find it hard to manage multiple user logins at the same time. It creates more of a hassle for administrators working in an organization that involves more than 1000 employees.

That’s where the Azure Active Directory(Azure AD) comes into play. With this administrator able to handle multiple users without any issue.

What is Azure AD ?

Azure Active Directory is Microsoft’s multi-tenant, cloud-based directory and identity management service. This offers identity and access capabilities for applications running in Microsoft Azure and for applications running in an on-premises environment. Azure AD’s strength lies in the flexibility afforded to it by being entirely cloud-based. This means that it can either act as an organisation’s only directory, or it can sync with an on-premises directory via Azure AD Connect.

Benefits with Azure AD

AAD Overview

Azure AD, as the name suggests, is a directory — a container for your user names, credentials and access rights (typically to information-based resources).

  1. One place for identity and access management

It’s an one place to go for managing user identities and permissions. there can assign users to groups individually or using rules driven by attributes, and also can use groups to assign licences and application access.

Your details will display here. Or you can add users to grant privileges to access to the application.

2. One identity for all applications

Whilst your users’ Azure AD identities are perfect for signing into Microsoft applications, it is also highly compatible with apps developed everywhere else.

3. Security

Azure AD achieves malicious or accidental harm and to protect their users from identity theft with a range of measures, including threat detection, conditional access, multi-factor authentication, privileged identity management and more.

4. Ease of use

Getting access to resources should be easy for end-users.

5. Collaboration

Azure AD allows you to invite external (guest) users into your directory to assign access.

With the Azure AD, one of the main things we can do is App Registration. So , let’s register our application in Azure AD . This is a Php based application.

How it works?

You can find the App Registration in the left panel of the Default Directory.

Click on + button to add new registration and You can add your details and create App Registration.

overview

For frontend of the application , here is used Php based one. In the application there are login page, main page and several sub pages. For authentication purpose what I used is like this. This is for secure routing purpose.

We can configure redirect URL. When the app is running it will check the Azure AD registered URL s and configurations.

auth.php

Let’s see with next article. Thank You!

References —

--

--

Sahani Rajapakshe

I would say I’m… Someone who is modest, hard-working and consistently sets firm goals for myself. Then, once I’ve defined my benchmarks, I take the necessary st