SlideShare a Scribd company logo
Programming 
Azure Active Directory
Programming Azure Active Directory (DevLink 2014)
17 
COLUMBUS, OH OCTOBER 17, 2014 CLOUDDEVELOP.ORG
Opening Keynote 
Scott Guthrie 
October 21st, 2014 
8:00am – 5:00pm PST 
http://azureconf.net
Assume you know what Microsoft Azure is 
and likely have an Azure subscription. 
This is not a Active Directory design session. 
Review common scenarios . . . Yours may be 
different. 
We’re not going to cover it all today . . . 
large, complicated topics with many 
options/scenarios.
Azure Active Directory - 
What is it?
Multi-tenant “directory-as-a-service” 
Identity & access for on-premises and 
cloud applications 
NOT a cloud version of 
Windows Server AD 
Image Source: http://technet.microsoft.com/en-us/library/jj573650.aspx
Extend Windows Server AD 
to the cloud 
Directory & identity services 
w/o need for Windows 
Server AD 
Each O365 tenant has 
instance of AAD 
Your App 
AAD 
Authentication 
platform 
Directory 
store 
Active Directory
Register an application with Azure AD 
Permissions 
Open source Azure AD authentication libraries
Programming Azure Active Directory (DevLink 2014)
Visual Studio 2013 wizard makes it easy 
Register the application in Azure AD 
Set a database 
Set Sign-On URL, App ID and Reply URL 
Basic set of claims available from AAD
Working with the Graph
Read
Read 
Write
REST API Endpoints
REST API Endpoints 
Authentication with Azure AD
REST API Endpoints 
Authentication with Azure AD 
Role Based Access Control (RBAC)
REST API Endpoints 
Authentication with Azure AD 
Role Based Access Control (RBAC) 
Differential Queries
REST API Endpoints 
Authentication with Azure AD 
Role Based Access Control (RBAC) 
Differential Queries 
Directory Extensions
What’s in the directory? 
REST Graph API
Graph URL 
Tenant 
(domain or objectID) 
https://graph.windows.net/ 
Entity 
(user, group, role, etc) 
?$filter=givenName eq 'Jon'&api-version=2013-11-08 
OData query 
($filter, $top) 
collierdemo.onmicrosoft.com/ 
API Version 
users
Active Directory Authentication Library (ADAL) 
for .NET
Microsoft.Azure.ActiveDirectory.GraphClient 
GraphConnection
Graph Security
My 
Application 
Service-to-Service 
OAuth 2.0 Grant Type Client Credentials 
Azure AD Authentication Endpoint 
(OAuth) 
(https://graph.windows.net) 
REST Service 
(validates token, 
process, returns data) 
Authorization 
Check 
Azure Active Directory 
1) Request JWT token (provide 
clienID and secret) 
2) Return 
JWT token 
3) HTTP Request w/ JWT token 
4) Return response
OAuth 2.0 Grant Type = Client Credentials 
// get OAuth token using Client Credentials 
string tenantName = "GraphDir1.onMicrosoft.com"; 
string issuingAuthority = "https://login.windows.net/" + tenantName; 
AuthenticationContext authenticationContext = new AuthenticationContext(issuingAuthority,false); 
// Config for OAuth client credentials 
string clientId = "118473c2-7619-46e3-a8e4-6da8d5f56e12"; 
string clientSecret = "hOrJ0r0TZ4GQ3obp+vk3FZ7JBVP+TX353kNo6QwNq7Q="; 
ClientCredential clientCred = new ClientCredential(clientId, clientSecret); 
string resource = "https://graph.windows.net"; 
string token; 
AuthenticationResult authenticationResult = authenticationContext.AcquireToken(resource, clientCred); 
token = authenticationResult.AccessToken; 
* Some values removed for readability 
OAuth 2.0 grant type, client_id, and client_secret configured in Azure portal
OAuth 2.0 Grant Type = Client Credentials 
POST https://login.windows.net/GraphDir1.onMicrosoft.com/oauth2/token 
Content-Type: application/x-www-form-urlencoded 
client-request-id: 1e38c3d3-dca3-42ff-8149-5db607b3488c 
return-client-request-id: true 
resource=https%3A%2F%2Fgraph.windows.net& 
client_id=118473c2-7619-46e3-a8e4-6da8d5f56e12& 
client_secret=hOrJ0r0TZ4GQ3obp%2Bvk3FZ7JBVP%2BTX353kNo6QwNq7Q%3D& 
grant_type=client_credentials 
* Some values removed for readability
OAuth 2.0 Grant Type = Client Credentials 
Content-Type: application/json; charset=utf-8 
client-request-id: 1e38c3d3-dca3-42ff-8149-5db607b3488c 
Content-Length: 1160 
{"token_type":"Bearer","expires_in":"3599","expires_on":"1407640794","not_before":"1407636894","resource":"https: 
//graph.windows.net","access_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6ImtyaU1QZG1Cdng2OHNrV 
DgtbVBBQjNCc2VlQSJ9.eyJhdWQiOiJodHRwczovL2dyYXBoLndpbmRvd3MubmV0IiwiaXNzIjoiaHR0cHM6Ly9zdHMud 
2luZG93cy5uZXQvNGZkMmIyZjItZWEyNy00ZmU1LWE4ZjMtN2IxYTdjOTc1ZjM0LyIsImlhdCI6MTQwNzYzNjg5NCwib 
mJmIjoxNDA3NjM2ODk0LCJleHAiOjE0MDc2NDA3OTQsInZlciI6IjEuMCIsInRpZCI6IjRmZDJiMmYyLWVhMjctNGZlNS1 
hOGYzLTdiMWE3Yzk3NWYzNCIsIm9pZCI6ImIwZGVhNTFlLWJkMDQtNGI5OS05NmEyLTE0ZDk5YjE5YmM2YSI………… 
………….."} 
* Some values removed for readability
Programming Azure Active Directory (DevLink 2014)
1. Leverage ADAL and Graph Library 
2. Obtain authentication token 
3. Set GraphSetting with API version of choice 
4. Set filter properties (if desired) 
5. Get, Create, or Delete User, Group, 
Application, etc.
Provide means to bring on-premises / custom 
schema extensions to Azure AD.
Programming Azure Active Directory (DevLink 2014)
1. Obtain authentication token 
2. Write against REST API directly 
3. Ability to set custom properties on directory 
objects
Azure AD extends directory authentication to the cloud 
Enables single sign-on for web applications 
CRUD objects in the directory
Azure AD Graph API 
Azure AD Samples 
Azure AD Graph Team Blog 
Graph Explorer 
Building Web Apps and Mobile Apps Using Microsoft Azure Active 
Directory for Identity Management
Questions?
Programming Azure Active Directory (DevLink 2014)

More Related Content

PPTX
More Cache for Less Cash (DevLink 2014)
PPTX
Automating Your Microsoft Azure Environment (DevLink 2014)
PDF
Using Windows Azure for Solving Identity Management Challenges (Visual Studio...
PPTX
More Cache for Less Cash
PPTX
Windows Azure Mobile Services - The Perfect Partner
PPTX
Inside Azure Diagnostics (DevLink 2014)
PPTX
What's New for the Windows Azure Developer? Lots! (July 2013)
PPTX
Inside Azure Diagnostics
More Cache for Less Cash (DevLink 2014)
Automating Your Microsoft Azure Environment (DevLink 2014)
Using Windows Azure for Solving Identity Management Challenges (Visual Studio...
More Cache for Less Cash
Windows Azure Mobile Services - The Perfect Partner
Inside Azure Diagnostics (DevLink 2014)
What's New for the Windows Azure Developer? Lots! (July 2013)
Inside Azure Diagnostics

What's hot (15)

PPTX
Using Windows Azure for Solving Identity Management Challenges
PPTX
Automating Your Azure Environment
PPTX
10 Ways to Gaurantee Your Azure Project will Fail
PPTX
Inside Azure Resource Manager
PPTX
Windows Azure: Lessons From the Field
PDF
Global Windows Azure Bootcamp : Cedric Derue playing with php on azure. (spon...
PPTX
Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...
PPTX
Introduction to Windows Azure AppFabric Applications
PDF
Infrastructure as Code for Beginners
PPTX
Containerless in the Cloud with AWS Lambda
PPTX
What's new in the July 2017 Update for Dynamics 365 - Developer features
PDF
Making connected apps with BaaS (Droidcon Bangalore 2014)
PDF
JavaOne LATAM 2015 - Batch Processing: Processamento em Lotes no Mundo Corpor...
PDF
Global Azure Bootcamp 2017 - Why I love S2D for MSSQL on Azure
PPTX
Presentation Tier optimizations
Using Windows Azure for Solving Identity Management Challenges
Automating Your Azure Environment
10 Ways to Gaurantee Your Azure Project will Fail
Inside Azure Resource Manager
Windows Azure: Lessons From the Field
Global Windows Azure Bootcamp : Cedric Derue playing with php on azure. (spon...
Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...
Introduction to Windows Azure AppFabric Applications
Infrastructure as Code for Beginners
Containerless in the Cloud with AWS Lambda
What's new in the July 2017 Update for Dynamics 365 - Developer features
Making connected apps with BaaS (Droidcon Bangalore 2014)
JavaOne LATAM 2015 - Batch Processing: Processamento em Lotes no Mundo Corpor...
Global Azure Bootcamp 2017 - Why I love S2D for MSSQL on Azure
Presentation Tier optimizations
Ad

Similar to Programming Azure Active Directory (DevLink 2014) (20)

PPTX
Azure from scratch part 2 By Girish Kalamati
PPTX
CTU June 2011 - Windows Azure App Fabric
PPTX
Deep Dive into Office 365 API for Azure AD
PPTX
Community call: Develop multi tenant apps with the Microsoft identity platform
PPTX
Azure Mobile Services Workshop
PDF
Identity Days 2020 - Quelles sont les méthodes et le niveau de sécurisation/r...
PPTX
Azure Active Directory - An Introduction for Developers
PDF
AllTheTalks.Online 2020: "Basics of OAuth 2.0 and OpenID Connect"
PDF
24032022 Zero Trust for Developers Pub.pdf
PPTX
Microsoft Azure Identity and O365
PDF
Automating Cloud Operations: Everything You Wanted to Know about cURL and REST
PDF
When and Why Would I use Oauth2?
PPTX
RBAC in Azure Kubernetes Service AKS
PPTX
Going Serverless with Azure Functions
PPTX
Secure Credential Management with CredHub - DaShaun Carter & Sharath Sahadevan
PDF
OAuth 2.0 and Library
PDF
Keeping Pace with OAuth’s Evolving Security Practices.pdf
PPTX
Azure AD App Proxy Login Scenarios with an On Premises Applications - TSPUG
PDF
What the Heck is OAuth and OIDC - Denver Developer Identity Workshop 2020
PDF
Microsoft graph and power platform champ
Azure from scratch part 2 By Girish Kalamati
CTU June 2011 - Windows Azure App Fabric
Deep Dive into Office 365 API for Azure AD
Community call: Develop multi tenant apps with the Microsoft identity platform
Azure Mobile Services Workshop
Identity Days 2020 - Quelles sont les méthodes et le niveau de sécurisation/r...
Azure Active Directory - An Introduction for Developers
AllTheTalks.Online 2020: "Basics of OAuth 2.0 and OpenID Connect"
24032022 Zero Trust for Developers Pub.pdf
Microsoft Azure Identity and O365
Automating Cloud Operations: Everything You Wanted to Know about cURL and REST
When and Why Would I use Oauth2?
RBAC in Azure Kubernetes Service AKS
Going Serverless with Azure Functions
Secure Credential Management with CredHub - DaShaun Carter & Sharath Sahadevan
OAuth 2.0 and Library
Keeping Pace with OAuth’s Evolving Security Practices.pdf
Azure AD App Proxy Login Scenarios with an On Premises Applications - TSPUG
What the Heck is OAuth and OIDC - Denver Developer Identity Workshop 2020
Microsoft graph and power platform champ
Ad

More from Michael Collier (6)

PPTX
Windows Azure Mobile Services - The Perfect Partner
PPTX
What's New for the Windows Azure Developer? Lots!!
PPTX
Windows Azure for Developers - Service Management
PPTX
Windows Phone 7 and Windows Azure – A Match Made in the Cloud
PPTX
The Hybrid Windows Azure Application
PPTX
Windows Azure for Developers - Building Block Services
Windows Azure Mobile Services - The Perfect Partner
What's New for the Windows Azure Developer? Lots!!
Windows Azure for Developers - Service Management
Windows Phone 7 and Windows Azure – A Match Made in the Cloud
The Hybrid Windows Azure Application
Windows Azure for Developers - Building Block Services

Recently uploaded (20)

PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
A Presentation on Artificial Intelligence
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Empathic Computing: Creating Shared Understanding
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Electronic commerce courselecture one. Pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
NewMind AI Monthly Chronicles - July 2025
Encapsulation_ Review paper, used for researhc scholars
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
A Presentation on Artificial Intelligence
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Empathic Computing: Creating Shared Understanding
Dropbox Q2 2025 Financial Results & Investor Presentation
The AUB Centre for AI in Media Proposal.docx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
Electronic commerce courselecture one. Pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Spectral efficient network and resource selection model in 5G networks
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Unlocking AI with Model Context Protocol (MCP)
The Rise and Fall of 3GPP – Time for a Sabbatical?
NewMind AI Monthly Chronicles - July 2025

Programming Azure Active Directory (DevLink 2014)

  • 3. 17 COLUMBUS, OH OCTOBER 17, 2014 CLOUDDEVELOP.ORG
  • 4. Opening Keynote Scott Guthrie October 21st, 2014 8:00am – 5:00pm PST http://azureconf.net
  • 5. Assume you know what Microsoft Azure is and likely have an Azure subscription. This is not a Active Directory design session. Review common scenarios . . . Yours may be different. We’re not going to cover it all today . . . large, complicated topics with many options/scenarios.
  • 6. Azure Active Directory - What is it?
  • 7. Multi-tenant “directory-as-a-service” Identity & access for on-premises and cloud applications NOT a cloud version of Windows Server AD Image Source: http://technet.microsoft.com/en-us/library/jj573650.aspx
  • 8. Extend Windows Server AD to the cloud Directory & identity services w/o need for Windows Server AD Each O365 tenant has instance of AAD Your App AAD Authentication platform Directory store Active Directory
  • 9. Register an application with Azure AD Permissions Open source Azure AD authentication libraries
  • 11. Visual Studio 2013 wizard makes it easy Register the application in Azure AD Set a database Set Sign-On URL, App ID and Reply URL Basic set of claims available from AAD
  • 13. Read
  • 16. REST API Endpoints Authentication with Azure AD
  • 17. REST API Endpoints Authentication with Azure AD Role Based Access Control (RBAC)
  • 18. REST API Endpoints Authentication with Azure AD Role Based Access Control (RBAC) Differential Queries
  • 19. REST API Endpoints Authentication with Azure AD Role Based Access Control (RBAC) Differential Queries Directory Extensions
  • 20. What’s in the directory? REST Graph API
  • 21. Graph URL Tenant (domain or objectID) https://graph.windows.net/ Entity (user, group, role, etc) ?$filter=givenName eq 'Jon'&api-version=2013-11-08 OData query ($filter, $top) collierdemo.onmicrosoft.com/ API Version users
  • 22. Active Directory Authentication Library (ADAL) for .NET
  • 25. My Application Service-to-Service OAuth 2.0 Grant Type Client Credentials Azure AD Authentication Endpoint (OAuth) (https://graph.windows.net) REST Service (validates token, process, returns data) Authorization Check Azure Active Directory 1) Request JWT token (provide clienID and secret) 2) Return JWT token 3) HTTP Request w/ JWT token 4) Return response
  • 26. OAuth 2.0 Grant Type = Client Credentials // get OAuth token using Client Credentials string tenantName = "GraphDir1.onMicrosoft.com"; string issuingAuthority = "https://login.windows.net/" + tenantName; AuthenticationContext authenticationContext = new AuthenticationContext(issuingAuthority,false); // Config for OAuth client credentials string clientId = "118473c2-7619-46e3-a8e4-6da8d5f56e12"; string clientSecret = "hOrJ0r0TZ4GQ3obp+vk3FZ7JBVP+TX353kNo6QwNq7Q="; ClientCredential clientCred = new ClientCredential(clientId, clientSecret); string resource = "https://graph.windows.net"; string token; AuthenticationResult authenticationResult = authenticationContext.AcquireToken(resource, clientCred); token = authenticationResult.AccessToken; * Some values removed for readability OAuth 2.0 grant type, client_id, and client_secret configured in Azure portal
  • 27. OAuth 2.0 Grant Type = Client Credentials POST https://login.windows.net/GraphDir1.onMicrosoft.com/oauth2/token Content-Type: application/x-www-form-urlencoded client-request-id: 1e38c3d3-dca3-42ff-8149-5db607b3488c return-client-request-id: true resource=https%3A%2F%2Fgraph.windows.net& client_id=118473c2-7619-46e3-a8e4-6da8d5f56e12& client_secret=hOrJ0r0TZ4GQ3obp%2Bvk3FZ7JBVP%2BTX353kNo6QwNq7Q%3D& grant_type=client_credentials * Some values removed for readability
  • 28. OAuth 2.0 Grant Type = Client Credentials Content-Type: application/json; charset=utf-8 client-request-id: 1e38c3d3-dca3-42ff-8149-5db607b3488c Content-Length: 1160 {"token_type":"Bearer","expires_in":"3599","expires_on":"1407640794","not_before":"1407636894","resource":"https: //graph.windows.net","access_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6ImtyaU1QZG1Cdng2OHNrV DgtbVBBQjNCc2VlQSJ9.eyJhdWQiOiJodHRwczovL2dyYXBoLndpbmRvd3MubmV0IiwiaXNzIjoiaHR0cHM6Ly9zdHMud 2luZG93cy5uZXQvNGZkMmIyZjItZWEyNy00ZmU1LWE4ZjMtN2IxYTdjOTc1ZjM0LyIsImlhdCI6MTQwNzYzNjg5NCwib mJmIjoxNDA3NjM2ODk0LCJleHAiOjE0MDc2NDA3OTQsInZlciI6IjEuMCIsInRpZCI6IjRmZDJiMmYyLWVhMjctNGZlNS1 hOGYzLTdiMWE3Yzk3NWYzNCIsIm9pZCI6ImIwZGVhNTFlLWJkMDQtNGI5OS05NmEyLTE0ZDk5YjE5YmM2YSI………… ………….."} * Some values removed for readability
  • 30. 1. Leverage ADAL and Graph Library 2. Obtain authentication token 3. Set GraphSetting with API version of choice 4. Set filter properties (if desired) 5. Get, Create, or Delete User, Group, Application, etc.
  • 31. Provide means to bring on-premises / custom schema extensions to Azure AD.
  • 33. 1. Obtain authentication token 2. Write against REST API directly 3. Ability to set custom properties on directory objects
  • 34. Azure AD extends directory authentication to the cloud Enables single sign-on for web applications CRUD objects in the directory
  • 35. Azure AD Graph API Azure AD Samples Azure AD Graph Team Blog Graph Explorer Building Web Apps and Mobile Apps Using Microsoft Azure Active Directory for Identity Management

Editor's Notes

  • #12: Show via Azure management portal Sign up for Azure AD Delete a tenant Register a new application in Azure AD Set for single sign-on mcadmin@collierdemo.onmicrosoft.com / test!123
  • #19: The Check Group Membership operation is performed by invoking the IsMemberOf function on the directory service. This function returns a Boolean value that indicates whether a specified user, group, or contact is a member of a specified group. The operation is transitive, that is, if User A is a member of Group B and Group B is a member of Group C and the function is invoked with User A and Group C as parameters, it will return true. You can contrast this with the memberOf navigation property for User A, which is intransitive and would therefore not return Group C in its result set because User A is a member of Group C only through its membership in Group B. http://msdn.microsoft.com/en-us/library/azure/dn151601.aspx
  • #22: DirectoryObject is the base type for the following entity types: Application, Device,DirectoryLinkChange, Contact, Group, Role, ServicePrincipal, TenantDetail, and User. http://msdn.microsoft.com/en-us/library/windowsazure/jj134105.aspx
  • #28: ADAL
  • #34: Use snippets in Postman
  • #43: These are the four primary application scenarios supported by Azure AD: • Web Browser to Web Application: A user needs to sign in to a web application that is secured by Azure AD. • Native Application to Web API: A native application that runs on a phone, tablet, or PC needs to authenticate a user to get resources from a web API that is secured by Azure AD. • Web Application to Web API: A web application needs to get resources from a web API secured by Azure AD. • Daemon or Server Application to Web API: A daemon application or a server application with no web user interface needs to get resources from a web API secured by Azure AD. http://msdn.microsoft.com/en-us/library/azure/dn499820.aspx