SlideShare a Scribd company logo
Azure AD for browser-based application developers
Agenda
Troubleshooting
Checklist
Securely
handling API
Keys
‱Azure Cognitive
Services
‱Azure Function Proxy
‱“Easy auth”
Registering
and coding a
Single Page
Application
‱Simple
JavaScript/jQuery calls
MS Graph API
‱TypeScript and React
calls MS Graph API
Azure AD
Concepts
‱Version confusion
‱Subscription confusion
‱Terminology confusion
‱Permission confusion
Azure ACS Azure AD v1 Endpoint Azure AD v2 Endpoint Azure AD B2C
Federation with “social”
accounts (Google,
Facebook, Microsoft, etc)
Azure AD only “Unified” Azure AD +
Microsoft accounts
Federation with “social”
accounts (Google,
Facebook, Microsoft, etc)
Static consent model Static consent model Dynamic consent model Static consent, admins
only
Program with ADAL Program with MSAL Program with MSAL
Deprecated – will be
turned off November
2018*
Easy to write your own
services
Limitations when building
your own services
Highly scalable
Highly customizable
No “on behalf of” flow
Register in Azure Service
Bus (or in SharePoint for
add-ins and S2S)
Register in Azure Portal,
PowerShell etc.
New app registration
portal
Azure Portal B2C
Apps can be single or
multi-tenant
All apps are multi-tenant
(for now)
 On-premises AD federation
 Multi-factor authentication
 B2B federation
Azure subscriptions
Office365
Your apps
Multi-tenant
partner apps
Daemon applications
Web browsers
Native applications
Application
gallery
Synchronise users
from your AD DS
 Consent model
 Conditional access
 Self-service password, group mgmt
Azure AD Key Concepts
App Registration
‱ Application ID – uniquely identifies an app
‱ App Secret – effectively the password for app
“service account”; not used w/implicit flow
‱ Redirect URI – used to direct responses back to
your app
‱ More depending on the flow you plan to use
Resources – e.g. https://graph.windows.net or your
app’s GUID – These are apps secured with Azure AD -
not to be confused with ARM resources
Scopes – e.g. Directory.Read
These are permissions that are specific to each
resource
Azure AD for browser-based application developers
‱ Unique identifier for an instance of Azure ADTenant ID, Directory ID
‱ Unique identifier for an application
App ID, Application ID,
Client ID
‱ Password used to authenticate the application
App Secret, App Key,
Client Secret
‱ App registration applied to a service, possibly in
another tenant
Enterprise Application,
Service Principal
Azure AD for browser-based application developers
App type
Who can
consent
Effective
Permissions
Delegated Permissions
(Get access on behalf of users)
App Permissions
(Get access as a service)
Mobile, Web and Single page app
Service and Daemon
Elevate permissions
Users can consent
for their data
Admin can consent
for them or for all users
Only admin
can consent
App
permissions
User
permissions
App
permissions
Application permissionDelegated permission (user permission)
OAuth 2.0
When calling from Use this flow Permission
Browser  Web service Implicit Flow User
 Web service  Web service On-Behalf-Of Flow User
Daemon or Web Service  Web
Service
Client Credentials Flow App
Native application  Web Service Authorization Code Flow
(client obtains auth code then access
token; SSO scenarios; client does not
handle user passwords)
or
User Credentials Flow
(client passes username and password)
User
OAuth 2.0
Implicit Flow
Browser Apps
Microsoft Graph
Groups
People
Conversations
Files
Insights
Azure AD for browser-based application developers
The Challenge
API keys in the browser
can be stolen by anyone
using the browser’s built-
in developer tools
Azure Function Proxies
‱ Light-weight API management
‱ Change URL, manipulate request and
response
‱ Inherits the configuration of your Function
App – including “EasyAuth”
functions proxies
Azure AD for browser-based application developers
Troubleshooting Checklist
1. Does it work in Postman?
NOTE: Postman’s client credential flow does not work
with Azure AD; make the call manually!
2. Is the App ID correct?
3. Is the App Secret correct? Expired? Did you recently
make a major change to the App registration that
might invalidate the App Secret?
4. Are permissions correct? Are you using the right kind
of permission (App permissions for client credentials
flow; Delegated for everything else!)
5. Have you pressed the “Grant” button to grant
permission?
6. In your Auth URL are you referencing the right
resource (the one you plan to access?)
7. Are you using Implicit flow, and if so, is
allowImplicitFlow set in the app manifest?
Resources Sample code
https://link.bobg.tv/ImplicitFlow
 “30 Days Graph” with article
explaining sample code
https://link.bobg.tv/30DaysGraph
 Azure AD Documentation
https://link.bobg.tv/AAD-Docs
 Microsoft Graph Explorer
https://link.bobg.tv/MSGraphExplorer
 Extending SharePoint with ADAL
and MS Graph API (Julie Turner)
https://link.bobg.tv/SPADAL
 Call MS Graph API tutorial (SPA)
https://link.bobg.tv/JSMSAL
Azure AD for browser-based application developers

More Related Content

PDF
O365Con18 - Introduction to Azure Web Applications - Eric Shupps
PDF
SPTECHCON - Who are You and What Do You Want - Working with OAuth in SharePoi...
PPTX
The bits and pieces of Azure AD B2C
PDF
Azure AD B2C – integration in a bank
PDF
O365Con18 - External Collaboration with Azure B2B - Sjoukje Zaal
PPTX
Creating Cloud-Ready Enterprise Applications with the SharePoint 2013 Add-In ...
PPTX
Introduction to Azure AD and Azure AD B2C
PPTX
To sign in and beyond: Doing more with your applications and Azure AD
O365Con18 - Introduction to Azure Web Applications - Eric Shupps
SPTECHCON - Who are You and What Do You Want - Working with OAuth in SharePoi...
The bits and pieces of Azure AD B2C
Azure AD B2C – integration in a bank
O365Con18 - External Collaboration with Azure B2B - Sjoukje Zaal
Creating Cloud-Ready Enterprise Applications with the SharePoint 2013 Add-In ...
Introduction to Azure AD and Azure AD B2C
To sign in and beyond: Doing more with your applications and Azure AD

What's hot (18)

PPTX
OAuth in SharePoint 2013
PPTX
Azure Saturday: External Collaboration With Azure AD B2B
PPTX
Dear Azure: External collaboration with Azure AD B2B
PPTX
Azure AD B2C Webinar Series: Identity Protocols OIDC and OAuth2 part 2
PPTX
Azure B2C
PPTX
Azure AD B2C Webinar Series: Custom Policies Part 2 Policy Walkthrough
PPTX
Azure AD B2C An Introduction - DogFoodCon 2018
PPTX
Microsoft Teams community call - February 2020
PPTX
Azure AD B2C Webinar Series: Custom Policies Part 1
PPTX
Azure AD Presentation - @ BITPro - Ajay
PPTX
Intelligent Cloud Conference: Azure AD B2C Application security made easy
PPTX
70 346 Managing office 365 identities
PPTX
Azure AD B2C Webinar Series: Identity Protocols OIDC and OAuth2 part 1
PPTX
Implement Authorization in your Apps with Microsoft identity platform-June 2020
PDF
SPUnite17 Introduction to Azure Web Applications
PDF
SPUnite17 Who Are You and What Do You Want
PPTX
Microsoft identity platform community call-May 2020
PPTX
How to Use Stormpath in angular js
OAuth in SharePoint 2013
Azure Saturday: External Collaboration With Azure AD B2B
Dear Azure: External collaboration with Azure AD B2B
Azure AD B2C Webinar Series: Identity Protocols OIDC and OAuth2 part 2
Azure B2C
Azure AD B2C Webinar Series: Custom Policies Part 2 Policy Walkthrough
Azure AD B2C An Introduction - DogFoodCon 2018
Microsoft Teams community call - February 2020
Azure AD B2C Webinar Series: Custom Policies Part 1
Azure AD Presentation - @ BITPro - Ajay
Intelligent Cloud Conference: Azure AD B2C Application security made easy
70 346 Managing office 365 identities
Azure AD B2C Webinar Series: Identity Protocols OIDC and OAuth2 part 1
Implement Authorization in your Apps with Microsoft identity platform-June 2020
SPUnite17 Introduction to Azure Web Applications
SPUnite17 Who Are You and What Do You Want
Microsoft identity platform community call-May 2020
How to Use Stormpath in angular js
Ad

Similar to Azure AD for browser-based application developers (20)

PDF
Programming with Azure Active Directory
PPTX
Azure for SharePoint Developers - Workshop - Part 1: Azure AD
PPTX
Developing Apps with Azure AD
PDF
24032022 Zero Trust for Developers Pub.pdf
PPTX
Programming Azure Active Directory (DevLink 2014)
PPTX
Microsoft Azure Identity and O365
PPTX
Microsoft Graph API Webinar Application Permissions
PPTX
7 Deadly Sins in Azure AD App Development
PPTX
Azure from scratch part 2 By Girish Kalamati
PDF
Modern Authentication With Azure Active Directory For Web Applications Develo...
PPTX
Microsoft Graph API Delegated Permissions
PDF
Application Security- App security
PPTX
Microsoft identity manoj mittal
PDF
Dev Dives: Master advanced authentication and performance in Productivity Act...
PPTX
Enterprise Access Control Patterns for Rest and Web APIs
PPTX
Identity and o365 on Azure
PPTX
Securing an Azure Function REST API with Azure Active Directory
PDF
Microsoft graph and power platform champ
PPTX
Deep Dive into Office 365 API for Azure AD
PDF
AAD und .NET
Programming with Azure Active Directory
Azure for SharePoint Developers - Workshop - Part 1: Azure AD
Developing Apps with Azure AD
24032022 Zero Trust for Developers Pub.pdf
Programming Azure Active Directory (DevLink 2014)
Microsoft Azure Identity and O365
Microsoft Graph API Webinar Application Permissions
7 Deadly Sins in Azure AD App Development
Azure from scratch part 2 By Girish Kalamati
Modern Authentication With Azure Active Directory For Web Applications Develo...
Microsoft Graph API Delegated Permissions
Application Security- App security
Microsoft identity manoj mittal
Dev Dives: Master advanced authentication and performance in Productivity Act...
Enterprise Access Control Patterns for Rest and Web APIs
Identity and o365 on Azure
Securing an Azure Function REST API with Azure Active Directory
Microsoft graph and power platform champ
Deep Dive into Office 365 API for Azure AD
AAD und .NET
Ad

More from Bob German (20)

PPTX
Introduction to the Microsoft Bot Framework v4
PPTX
Adaptive cards 101
PPTX
Introduction to Teams Development - North American Collaboration Summit
PPTX
Future-proof Development for Classic SharePoint
PPTX
Azure for SharePoint Developers - Workshop - Part 4: Bots
PPTX
Azure for SharePoint Developers - Workshop - Part 3: Web Services
PPTX
Azure for SharePoint Developers - Workshop - Part 2: Azure Functions
PPTX
Azure for SharePoint Developers - Workshop - Part 5: Logic Apps
PPTX
Mastering Azure Functions
PPTX
Going with the Flow: Rationalizing the workflow options in SharePoint Online
PPTX
Modern SharePoint, the Good, the Bad, and the Ugly
PPTX
Developing JavaScript Widgets
PPTX
Introduction to TypeScript
PPTX
Developing JavaScript Widgets
PPTX
TypeScript and SharePoint Framework
PPTX
German introduction to sp framework
PPTX
SPSNYC - Next Generation Portals
PPTX
Typescript 102 angular and type script
PPTX
Typescript 101 introduction
PPTX
Search First Migration - Using SharePoint 2013 Search for SharePoint 2010
Introduction to the Microsoft Bot Framework v4
Adaptive cards 101
Introduction to Teams Development - North American Collaboration Summit
Future-proof Development for Classic SharePoint
Azure for SharePoint Developers - Workshop - Part 4: Bots
Azure for SharePoint Developers - Workshop - Part 3: Web Services
Azure for SharePoint Developers - Workshop - Part 2: Azure Functions
Azure for SharePoint Developers - Workshop - Part 5: Logic Apps
Mastering Azure Functions
Going with the Flow: Rationalizing the workflow options in SharePoint Online
Modern SharePoint, the Good, the Bad, and the Ugly
Developing JavaScript Widgets
Introduction to TypeScript
Developing JavaScript Widgets
TypeScript and SharePoint Framework
German introduction to sp framework
SPSNYC - Next Generation Portals
Typescript 102 angular and type script
Typescript 101 introduction
Search First Migration - Using SharePoint 2013 Search for SharePoint 2010

Recently uploaded (20)

PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PDF
Digital Strategies for Manufacturing Companies
PPTX
history of c programming in notes for students .pptx
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
Operating system designcfffgfgggggggvggggggggg
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
System and Network Administration Chapter 2
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PPTX
ai tools demonstartion for schools and inter college
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
System and Network Administraation Chapter 3
PDF
medical staffing services at VALiNTRY
PPTX
Odoo POS Development Services by CandidRoot Solutions
Design an Analysis of Algorithms II-SECS-1021-03
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Wondershare Filmora 15 Crack With Activation Key [2025
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
Digital Strategies for Manufacturing Companies
history of c programming in notes for students .pptx
Upgrade and Innovation Strategies for SAP ERP Customers
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Operating system designcfffgfgggggggvggggggggg
CHAPTER 2 - PM Management and IT Context
How to Choose the Right IT Partner for Your Business in Malaysia
System and Network Administration Chapter 2
Odoo Companies in India – Driving Business Transformation.pdf
Which alternative to Crystal Reports is best for small or large businesses.pdf
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
ai tools demonstartion for schools and inter college
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
System and Network Administraation Chapter 3
medical staffing services at VALiNTRY
Odoo POS Development Services by CandidRoot Solutions

Azure AD for browser-based application developers

  • 2. Agenda Troubleshooting Checklist Securely handling API Keys ‱Azure Cognitive Services ‱Azure Function Proxy ‱“Easy auth” Registering and coding a Single Page Application ‱Simple JavaScript/jQuery calls MS Graph API ‱TypeScript and React calls MS Graph API Azure AD Concepts ‱Version confusion ‱Subscription confusion ‱Terminology confusion ‱Permission confusion
  • 3. Azure ACS Azure AD v1 Endpoint Azure AD v2 Endpoint Azure AD B2C Federation with “social” accounts (Google, Facebook, Microsoft, etc) Azure AD only “Unified” Azure AD + Microsoft accounts Federation with “social” accounts (Google, Facebook, Microsoft, etc) Static consent model Static consent model Dynamic consent model Static consent, admins only Program with ADAL Program with MSAL Program with MSAL Deprecated – will be turned off November 2018* Easy to write your own services Limitations when building your own services Highly scalable Highly customizable No “on behalf of” flow Register in Azure Service Bus (or in SharePoint for add-ins and S2S) Register in Azure Portal, PowerShell etc. New app registration portal Azure Portal B2C Apps can be single or multi-tenant All apps are multi-tenant (for now)
  • 4.  On-premises AD federation  Multi-factor authentication  B2B federation Azure subscriptions Office365 Your apps Multi-tenant partner apps Daemon applications Web browsers Native applications Application gallery Synchronise users from your AD DS  Consent model  Conditional access  Self-service password, group mgmt
  • 5. Azure AD Key Concepts App Registration ‱ Application ID – uniquely identifies an app ‱ App Secret – effectively the password for app “service account”; not used w/implicit flow ‱ Redirect URI – used to direct responses back to your app ‱ More depending on the flow you plan to use Resources – e.g. https://graph.windows.net or your app’s GUID – These are apps secured with Azure AD - not to be confused with ARM resources Scopes – e.g. Directory.Read These are permissions that are specific to each resource
  • 7. ‱ Unique identifier for an instance of Azure ADTenant ID, Directory ID ‱ Unique identifier for an application App ID, Application ID, Client ID ‱ Password used to authenticate the application App Secret, App Key, Client Secret ‱ App registration applied to a service, possibly in another tenant Enterprise Application, Service Principal
  • 9. App type Who can consent Effective Permissions Delegated Permissions (Get access on behalf of users) App Permissions (Get access as a service) Mobile, Web and Single page app Service and Daemon Elevate permissions Users can consent for their data Admin can consent for them or for all users Only admin can consent App permissions User permissions App permissions Application permissionDelegated permission (user permission)
  • 10. OAuth 2.0 When calling from Use this flow Permission Browser  Web service Implicit Flow User  Web service  Web service On-Behalf-Of Flow User Daemon or Web Service  Web Service Client Credentials Flow App Native application  Web Service Authorization Code Flow (client obtains auth code then access token; SSO scenarios; client does not handle user passwords) or User Credentials Flow (client passes username and password) User
  • 14. The Challenge API keys in the browser can be stolen by anyone using the browser’s built- in developer tools
  • 15. Azure Function Proxies ‱ Light-weight API management ‱ Change URL, manipulate request and response ‱ Inherits the configuration of your Function App – including “EasyAuth”
  • 18. Troubleshooting Checklist 1. Does it work in Postman? NOTE: Postman’s client credential flow does not work with Azure AD; make the call manually! 2. Is the App ID correct? 3. Is the App Secret correct? Expired? Did you recently make a major change to the App registration that might invalidate the App Secret? 4. Are permissions correct? Are you using the right kind of permission (App permissions for client credentials flow; Delegated for everything else!) 5. Have you pressed the “Grant” button to grant permission? 6. In your Auth URL are you referencing the right resource (the one you plan to access?) 7. Are you using Implicit flow, and if so, is allowImplicitFlow set in the app manifest?
  • 19. Resources Sample code https://link.bobg.tv/ImplicitFlow  “30 Days Graph” with article explaining sample code https://link.bobg.tv/30DaysGraph  Azure AD Documentation https://link.bobg.tv/AAD-Docs  Microsoft Graph Explorer https://link.bobg.tv/MSGraphExplorer  Extending SharePoint with ADAL and MS Graph API (Julie Turner) https://link.bobg.tv/SPADAL  Call MS Graph API tutorial (SPA) https://link.bobg.tv/JSMSAL

Editor's Notes

  • #2: You can build amazing user experiences with modern web technology, but to make it useful you almost always need to call web services. Many of these services, such as the Microsoft Graph and custom Web APIs, require an Azure AD access token. That sounds easy, but it's often very confusing to developers who are new to it. Other web services need only an API key, which is easily stolen by anyone who knows how to use the browser's developer tools. In this session you'll learn the essentials for using Azure AD from your browser-based code. You'll learn about the different Azure AD endpoints - a point of confusion for sure - and when to use them. Then for each one, you'll learn how to register your client application and how to get that all important access token. As a bonus, you'll learn how to create your own Azure AD secured services and use an Azure Function Proxy to hide API keys for other services so they use Azure AD instead of an easily copied key value. Don't miss this quick, practical session that will get you consuming Azure AD web services in no time! DEMO SETUP: - VS Code - http-server - chrome – localhost:8080 - firefox – Azure portal - Postman
  • #4: “There is nothing permanent except change” – Heraclitus
  • #8: “The beginning of wisdom is the definition of terms” – Plato “A rose by any other name would smell as sweet” – Shakespeare
  • #11: Microsoft Build 2017
  • #12: Most useful in SharePoint: - Implicit flow on web pages - Client credentials flow for background jobs or elevating privileges in a web service
  • #14: Microsoft graph began with people in the directory. People, groups, and relationships (e.g. a manager, a group member) Then content like files Then conversations in Skype 4 Biz, email, teams, online meetings; even conversations in Word comments Then insights gathered by learning from all that information
  • #15: Demo the site V1 and V2 registrations – show: - permissions - implicit flow - reply URLs Code walk-through
  • #19: Postman - Show API key Azure portal - function app - Show proxy - Show easy auth Postman - Show AAD auth