Slide 16
Slide 16 text
Registering Entra applications with Graph SDK
graph_client = GraphServiceClient(credentials=credential, scopes=scopes)
graph_client.applications.post(Application(
display_name=f"ChatGPT Sample Client App {identifier}",
sign_in_audience="AzureADMyOrg",
web=WebApplication(
redirect_uris=["http://YOUR-APP-URL/.auth/login/aad/callback"],
implicit_grant_settings=ImplicitGrantSettings(enable_id_token_issuance=True)),
required_resource_access=[
RequiredResourceAccess(
resource_app_id="00000003-0000-0000-c000-000000000000",
resource_access=[
ResourceAccess(id="e1fe6dd8-ba31-4d61-89e7-88639da4683d", type="Scope"), # Graph User.Read
ResourceAccess(id="7427e0e9-2fba-42fe-b0c0-848c9e6a8182", type="Scope"), # offline_access
ResourceAccess(id="37f7f235-527c-4136-accd-4a02d197296e", type="Scope"), # openid
ResourceAccess(id="14dad69e-099b-42c9-810b-d002981feec1", type="Scope"), # profile
])]))
Graph SDKs available in C#, Go, Java, JavaScript, PHP, Powershell, Python
auth_init.py
aka.ms/azai/auth-builtin