46

Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

Embed Size (px)

Citation preview

Page 1: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory
Page 2: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

Deep Dive into the Windows Azure Active Directory Graph API: Data Model, Schema, Query, and More

Edward WuMicrosoft

WAD-B308

Page 3: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

Agenda• Azure Active Directory• Graph API Intro• Authentication/Authorization• Example Read Operations• Example Write Operations• Differential Query• Partner Solutions: atwork, AIX Concept

GmbH• Resources

Page 4: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

Azure Active Directory’s User Base is Growing

Today, global enterprises run on Windows Server Active Directory• 90% of US enterprises and 70% of international corporations use

Active Directory

• Over 400 million Active Directory users

• Active Directory users will move to Azure Active Directory.

Impressive growth of Azure Active Directory users since 2011

• Over 3 million companies, 469K active tenants last week

• Approaching 146 million directory users, 16 million active users last week

• For the past 3 months, 25,000 new users have logged into Azure Active Directory for the first time

Page 5: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

Graph API ScenariosReading from Azure Active Directory • Implement People or Group Picker – List/Search users/groups• Design Workflows that lookup Manager/Direct Report

relationships• Make Authorization Decisions: determine Users’ Group and

Role Membership• Check Tenant and Users’ subscribed services such as

Exchange, SharePoint, Lync, Dynamics CRM, Intune, GSM• Requesting changed data – “delta changes”

Writing to Azure Active Directory• Updating Users and Groups• Setting Users’ Password• Adding Users to Groups/Roles• Provisioning/Deprovisioning Users

Page 6: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

Graph API• RESTful interface to Azure Active Directory• Tenant Specific – queries are scoped to individual tenant

context• Programmatic access to directory objects such as Users,

Groups, Contacts, Tenant Information, Roles• Access relationships: members, memberOf, manager,

directReports

• Requests use standard HTTP methods• GET, POST, PATCH, DELETE to create, read, update, and

delete• Response support JSON, XML, standard HTTP status

codes• Compatible with OData V3

• OAuth 2.0 for authentication, role-based assignment for app and user authorization

Page 7: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

Connecting to Windows Azure Active Directory

7

WindowsAzureActive

DirectoryDirectory SynchOn Premises

Active Directory

PowerShell

Admin Portal

Multi Tenant EnvironmentDivided into Tenants

Typed objects Example: Users, Groups, Contacts, Roles, Licenses

RelationshipsMember/Member of, Manager/Direct reports

REST OAuth

Applications

Applications

LDAPKerberos

REST Interface

Administration Scripting

,PowerShell

GraphAPI

Page 8: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

Query Format

https://graph.windows.net/contoso.com/users?api-version=2013-04-05&$filter=state eq ‘WA’

Graph URL

(static)

Specific entity type, such as users, groups, contacts, tenantDetails, roles, applications, etc.

Tenant of interest – can be tenant’s verified domain or objectId.

API version – “2013-04-05” is the Supported GA version

Optional Odata query arguments: $filter, $top

API version – “2013-04-05” is the 1.0 version

Page 9: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

Demo

Graph Explorer Browser based Query toolhttp://graphExplorer.cloudapp.net/

Example:https://graph.windows.net/GraphDir1.OnMicrosoft.com/users/[email protected]/$links/directReportsNote: objects, properties, actions are case sensitive

Page 10: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

Authentication and Authorization to Graph APIService-to-ServiceOAuth 2.0 grant type client credentials

Directory

Application

2. Return token

1. Request JWT token(pass input claims)

REST ServiceValidates token, processes request, returns data

AuthorizationCheck3. HTTP Request

with JWT Token

Windows Azure Active Directory

Azure AD Authentication Endpoint (OAuth)

4. Return Response and Data

Page 11: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

Authentication - Acquiring a tokenOAuth 2.0 grant type=client credentials POSThttps://login.windows.net/contoso.com/oauth2/token?api-version=1.0HEADERSContent-Type: application/x-www-form-urlencodedBODYgrant_type=client_credentials&resource=https%3a%2f%2fgraph.windows.net&client_id=52752c8e-d73c-4f9a-a0f9-2d75607ecb8e&client_secret=qKDjII5%2FK8WyKj6sRo5a5vD6%2Bm74uk1A%2BpIlM%3DRESPONSE: 200 OK

Token will be returned back to the calling application if all values are validNotes: OAuth 2.0 Client Credential grant type, client_id and client_secret are pre-configured through the Azure Management Portal, under Active Directory/Applications

Page 12: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

GEThttps://graph.windows.net/contoso.com/users?api-version=2013-04-05HEADERSAuthorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ik5HVEZ2ZEstZnl0aEV1T….Content-type: Application/JSON;odata=minimalmetadata

RESPONSE: 200 OKRETURN User Objects in JSON

Getting User information

GEThttps://graph.windows.net/contoso.com/users/[email protected]/thumbnailPhoto?api-version=2013-04-05HEADERSAuthorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ik5HVEZ2ZEstZnl0aEV1T….Content-type: Application/JSON;odata=minimalmetadata

RESPONSE: 200 OKRETURN: data representing User’s thumb nail photo

Page 13: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

Demo

• Using Fiddler• Authenticate (get an Oauth access token) + Query the Graph

Page 14: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

Azure Management Portal POST

https://login.windows.net/contoso.com/oauth2/token?api-version=1.0HEADERSContent-Type: application/x-www-form-urlencodedBODYgrant_type=client_credentials&resource=https%3a%2f%2fgraph.windows.net&client_id=52752c8e-d73c-4f9a-a0f9-2d75607ecb8e&client_secret=qKDjII5%2FK8WyKj6sRo5a5vD6%2Bm44uk1A%2BpIlM%3DRESPONSE: 200 OKNotes: Oauth 2.0 Client Credential grant type, client_id and client_secret are pre-configured through the Azure Management Portal, under Active Directory/Applications

Page 15: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

Demo

Registering an Application on the Portalhttps://manage.windowsAzure.com

Page 16: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

Write Operations

• Write operations on Users, Groups• User Provisioning• Group Management Update• User password Reset

• Read only objects: Roles, Subscriptions• Note:• Transitive Group Lookup /isMemberOf is implemented as a POST

operation

Page 17: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

Create a New UserPOSThttps://graph.windows.net/contoso.com/users?api-version=2013-04-05HEADERSContent-Type: application/jsonAuthorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ik5HVEZ2ZEstZnl0aEV1T….BODY { "accountEnabled":true, "userPrincipalName":"[email protected]", "displayName":"New User", "passwordProfile":{ "password":"VStrongP@ssword1", "forceChangePasswordNextLogin":true}, "mailNickname":"NewUser"} RESPONSE: 201 CreatedNotes: (1)the password must meet the tenant’s Accepted password complexity requirements.(2 )the minimum set of properties to create a user is shown in the example above.(3) setting the user’s usage location is not shown above.

User Creation

Page 18: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

Update Group or Role membership

POST

https://Graph.windows.net/contoso.com/groups/02a8a087-a371-43f9-94df-cf0f654de307/$links/members?api-version=2013-04-05 HEADERSContent-Type: application/jsonAuthorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ik5HVEZ2ZEstZnl0aEV1T….

BODY:{ "url":"https://graph.windows.net/contoso.com/directoryObjects/93d8feee-6365-4b3b-98c0-14da134a2b1e"} 

RESPONSE: 204

Notes: replace /groups with /roles to support Role membership updates

Add a User to a Group

Page 19: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

Reset a User’s passwordPATCHhttps://graph.windows.net/contoso.com/users/[email protected]?api-version=2013-04-05 HEADERSContent-Type: application/jsonAuthorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ik5HVEZ2ZEstZnl0aEV1T….

BODY:{ "passwordProfile": { "password":"newPassword1!", "forceChangePasswordNextLogin":false }} 

RESPONSE: 204Notes: password must meet the tenant’s accepted password policy (matching password complexity, length and password re-use policy)

Reset a User’s password

Page 20: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

Assigning a License to a UserUser License Assignment PreviewPOST https://graph.windows.net/graphtest9.onMicrosoft.com/users/[email protected]/assignLicense?api-version=2013-04-10-previewHEADERSContent-Type: application/jsonAuthorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ik5HVEZ2ZEstZnl0aEV1T….BODY:  { "addLicenses": [ { "disabledPlans": [], "skuId": "6fd2c87f-b296-42f0-b197-1e91e994b900" } ],  "removeLicenses":null} RESPONSE: 200Notes: 1. the user being assigned a License must have a valid Usage location property (by default, creating a new user doesn’t assign a usage location, therefore you should validate that the user has a usage location before executing license assignment).2. The SkuID can be acquired by getting licenses that the Tenant owns. The following request will return subscribed SKU data. GET https://graph.windows.net/GraphDir1.OnMicrosoft.com/subscribedSkus?api-version=2013-04-05 

Page 21: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

DemoRead and Write Operations in C#Visual Studio Project using WCF Data Services 5.3+ Graph Helper Class

Page 22: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

Introduction to Differential Query

• Efficient way to learn about new changes that have occurred in the directory since the last query

• Where it is not feasible to rewrite an existing application to integrate directly with Azure AD, developers can write a Differential Query client to:• Synchronize application local data store with Azure AD• Provide impendence matching

Page 23: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

Differential Query Format

https://graph.windows.net/contoso.com/directoryObjects?api-version=2013-04-05&deltaLink=

Graph URL

(static)

Resource set of interest – To indicate specific entity type, specify “users” / “groups” / “contacts”. Use “directoryObjects” to include all 3 entities types.

Tenant of interest – can be tenant’s verified domain or objectId.

API version – “2013-04-05” is the 1.0 version

Empty, to indicate this is an initial query. Subsequent queries contains deltaLink/nextLink value obtained from previous response.

Page 24: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

Differential Query DemoGraph Explorerhttps://graph.windows.net/graphDir1.OnMicrosoft.com/users?api-version=2013-04-05&deltaLink=

Page 25: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

Other OAuth 2.0 Authentication for Graph• I showed you OAuth 2.0 Grant type = Client

Credentials• OAuth 2.0 Grant type = Authorization Code • Includes User Authentication and Delegation

• After the User Authn and approves delegated access, the Client App receives an authorization code, which can be redeemed for a token (and refresh token).

• Previewhttp://blogs.msdn.com/b/aadgraphteam/archive/2013/05/17/using-oauth-2-0-authorization-code-grant-for-delegated-access-of-directory-via-aad-graph.aspx

Page 26: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

Partners

Page 27: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

Manage YOUR Office 365 users, groups and

licenses

Delegate

365

Page 28: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

MARTINA GROMCEOatworkOFFICE 365 [email protected]@magrom

Knowledge increases by sharing. So, pass it on!

Knowledge increases by sharing. So, pass it on! atwork.at

Our passion:

Office 365Windows AzureSharePoint AppsOffice AppsFacebook AppsWeb DevelopmentSoftware Development

Page 29: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

Why Delegate365 ?

Office 365 has a role based access model

Customers, like Franchisers, Universities, Communities, Schools or anyone who wants a dezentralized administration is interested in delegated admin rights for other users

With Delegate 365 they are able to split administration rights among users

Page 30: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

Delegate365 Administration

[email protected]

[email protected]

[email protected]

[email protected]

Portal-Admin

BerlinMunich

BerlinVienna

HRFinance

Page 31: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

Access to an user object

[email protected]

[email protected]

[email protected]

[email protected]

Domain + OU

Page 32: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

Delegate365 portal key features

Portal-Admin,Administrators,OU & domains

Management of users, aliases, groups, licenses

Fully compatible with WAAD, Office 365, Online CRM

Modern, responsive HTML5-portal

White Label-version for resellers

Runs in Windows Azure

Page 33: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

DemoDelegat

e365

Page 34: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

Delegate365 next features

Optimization Localization Statistics

Package

- Azure Gallery- Office Store- Win 8 Store

Delegate

365

Page 35: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

Projections to lower network traffic

Single call operations (create user and assign license in a single call)

User authentication in addition to SPN credentials

Our WAAD Graph API wishlist

More filtering options, eg. Search for example .EndsWith

Page 36: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

Enroll for the preview today!

Delegate365.com

Delegate

365

Thanks for your interest!www.atwork.at

Page 37: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

• HQ in Aachen Germany• Founded 2003 • Microsoft Gold Certified ISV• Providing Solutions for K-12 Market• More than 1.000 Customers

AixConcept GmbH

Page 38: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

Office 365 Management Portal

• Multi Tenant Support• Multi Language Support• User Management depends on Graph API• Creates both: security and distribution

groups• Creates SharePoint sites for each class and

course• Creates special mailboxes for rooms and

equipment• Hosted on Windows Azure

Page 39: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

DEMO

Sebastian FillingerChief Software Architect

Page 40: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

Contact InformationBusiness ContactThomas Jordans, [email protected]

Developer ContactSebastian Fillinger, [email protected]

Page 41: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

What do you plan to build ?• Tell me more about your applications• Give me feedback• Ask your questions - let us help to unblock

you• Would you like to be an early adopter?

[email protected] API Survey (can remain Anonymous)https://microsoft.qualtrics.com/SE/?SID=SV_3OFY7hFRayuoxI9

Page 42: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

Resources ( 1 )

• Graph Explorer• http://graphExplorer.cloudapp.net

• Graph Sample Applications C#, PHP, Java• http://msdn.microsoft.com/en-us/library/hh974459.aspx

• Sign up for your Azure AD tenant and Trial Azure Account• https://account.windowsazure.com/organization

• Walk-through Sign-On, Graph and Multi-tenant App• http://msdn.microsoft.com/en-us/library/dn151121.aspx

Page 43: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

Resources (2)

• Team Blog • http://blogs.msdn.com/b/aadgraphteam/

• Preview of Authentication using OAuth Authorization Code• http://blogs.msdn.com/b/aadgraphteam/archive/

2013/05/17/using-oauth-2-0-authorization-code-grant-for-delegated-access-of-directory-via-aad-graph.aspx

Page 44: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

msdn

Resources for Developers

http://microsoft.com/msdn

Learning

Microsoft Certification & Training Resources

www.microsoft.com/learning

TechNet

Resources

Sessions on Demand

http://channel9.msdn.com/Events/TechEd

Resources for IT Professionals

http://microsoft.com/technet

Page 45: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

Evaluate this session

Scan this QR code to evaluate this session.

Page 46: Today, global enterprises run on Windows Server Active Directory 90% of US enterprises and 70% of international corporations use Active Directory

© 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.