SlideShare a Scribd company logo
1 of 16
Download to read offline
Microsoft Graph API with
OutSystems
Event Subscriptions
Subscribe and handle Microsoft Graph API
change notifications in your application
February 8thth 11am (CET)
Stefan Weber
Senior Director Software Development
Telelink Business Services Germany GmbH
OutSystems MVP – AWS Community Builder
Fundamentals
 Overview of Microsoft Graph API subscriptions
 Basic Notifications and Rich Notifications
 Subscription Lifecycle
 Best Practices
Agenda
Implementation
 Prerequisites
 Entra Application Registration and Permissions
 OAuth access token client credential flow
 Subscribe and handle basic notifications
 Handle lifecycle events
 Subscribe and handle rich notifications
Previous Webinars on Microsoft Graph API with OutSystems
Application Permissions
Query Microsoft Graph API with application permissions.
Demonstration on how to acquire an access token from
Microsoft Entra with an OAuth client credentials flow.
https://youtu.be/yVK8WQz5qnU
Delegated Permissions
Query Microsoft Graph API with delegated (user) permissions.
Demonstration on how to acquire an access token from
Microsoft Entra with an OAuth authorization code flow.
https://youtu.be/2cSsg5ws1H4
Microsoft Graph API Event
Subscription
Microsoft Graph API event subscriptions allow you to subscribe to
changes in resources such as messages, calendars, and contacts
in Microsoft Graph. When a change occurs, the API sends a
notification to the subscribed application.
To create a subscription you must specify an event type – e.g.
create – and a resource using an application or delegated access
token with corresponding permissions (Scopes).
Subscriptions expire and get deleted automatically on
 Individual subscription expiry
 Resource subscription lifetime limit
 Access Token used for subscribing expires
if Lifecycle Notifications are not handled by your application.
Basic Notifications
A basic notifications only returns the event type and the
affected resource identifier back to your application.
In order to get the details of the affected resource you must
perform a Graph API query.
It is the easiest way to get started with Microsoft Graph API event
subscriptions.
Resource Events
Rich Notifications
Rich Notifications include the affected resource data besides the
event type and the resource identifier.
Resource data in Rich Notifications is encrypted by a Public Key
you must include when subscribing to an event and you need
the corresponding Private Key to decrypt the resource data.
You must specify explicitly which attributes should be
transported as encrypted resource data.
Lifecycle Events
Missed
Notification to your lifecycle events
endpoint on non-delivered event e.g.
because of Timeout.
Actions to take
 Acknowledge event by returning a
status code of 202 – Accepted
 Query the resource or perform a
delta query to take further action
Applicable only to Outlook Messages,
Events and Personal Contacts.
Subscription Removed
Triggered whenever a subscription is
removed from Microsoft Graph.
Applicable only to Outlook Messages,
Events and Contacts and Teams Chat
Messages.
Reauthorization Required
This events hits your lifecycle events
endpoint when
 The access token is about to
expire
 The subscription is about to expire
 A tenant administrator revoked
permissions for your application
Actions to take
 Acknowledge event by returning a
status code of 202 – Accepted
 Reauthorize and update
subscription
Application
 Configure application permissions on resources in your Entra
application registration.
Keep in mind that application permissions are very powerful and
additional actions should be taken to limit application permissions.
 Use the Client Credential OAuth2 flow to retrieve an access
token.
 Subscribe to resources using the access token.
 On Reauthorization Required lifecycle events simply request
a new access token via the Client Credential flow to
reauthorize and update a subscription
Subscribing as application or on-behalf of a user (delegated)
Delegated
 Configure delegated permissions on resources in your Entra
application registration.
 Make sure that you added the offline_access permission to
get a refresh token.
 Perform a Authorization Code OAuth2 flow to retrieve an
access token and refresh token.
 Subscribe to resources
 On Reauthorization Required lifecycle events use a valid
cached access token or retrieve a new access token using by
performing a token refresh operation.
Implementation
Prerequisites
 Access to your Azure Tenant using the Azure Portal
 Cloud Application Administrator role assigned to your user
account to register an application in your tenant.
 Powershell to generate a Public/Private key pair for Rich
Notifications.
Demo Application
GraphWebinar Event Subscriptions
Available on Forge
Rich Notifications
Certificate / Private Key
11
<#
Script generates a new certificate and private key
private-key.xml The private key in XML format
public.cer The public key base64 encoded
#>
$params = @{
Subject = "CN=Microsoft Graph Rich Notifications"
CertStoreLocation = "Cert:CurrentUserMy"
KeyExportPolicy = "Exportable"
KeyUsage = "DataEncipherment"
KeyAlgorithm = "RSA"
KeyLength = 2048
KeyUsageProperty = "All"
} # End Certificate Parameters
$cert = New-SelfSignedCertificate @params # Create Certificate in User Certificate Store (Personal)
$cert.PrivateKey.ToXmlString($true) | Out-File "private-key.xml" # Export the private key in XML Format
[System.Convert]::ToBase64String($cert.Export('Cert')) | Out-File "public.cer" # Export the certificate (public) as DER base64 encoded
Walkthrough
Best practices
 Try to avoid subscribing under application permissions. Use
delegated permission if possible.
 Use a single REST API to receive all Graph API webhooks.
Don‘t create separate endpoints for different use cases.
 For large volumes of subscriptions and events consider
Azure Event Grid (preview) or Lambda to AWS EventBridge.
 Master OAuth 2.0 Website
 Microsoft Developer Program
 Azure Portal
 Microsoft Learn – Authorization Code Flow
 Use the Microsoft Graph API documentation
 Microsoft Graph Explorer
 OAuth Token Exchange Forge component
 CryptoAPI Forge component
Additional Material
 Microsoft Graph Permission Reference
 Microsoft Graph API Lifecycle Events
 Notifications Endpoint Validation
 Rich Notifications
Introduction and Bedrock Knowledge Bases
 Overview of Amazon Bedrock
 Configuration and Model Access
 Creating a Knowledge Base
 Query Knowledge Base Information
 When to roll your own custom Knowledge Base
 Use Bedrock Knowledge Bases for Retrievable Augmented
Generation (RAG) in OutSystems applications.
March 2024
Coming up – Amazon Bedrock
Bedrock Agents and Action Groups
 Overview of Agents and AI Reasoning
 Create and Configure an Agent
 Add Knowledge Base(s) to an Agent
 Add Lambda Functions middleware to an Agent
 Use Bedrock Agents in OutSystems applications
April 2024
Stefan Weber
Senior Director Software Development
Telelink Business Services Germany GmbH
OutSystems MVP – AWS Community Builder
https://www.tbs.tech
https://www.linkedin.com/in/stefanweber1/
https://lcnc.blog

More Related Content

Similar to Microsoft Graph API with OutSystems Event Subscriptions

Managing enterprise applications, permissions, and consent in Azure Active Di...
Managing enterprise applications, permissions, and consent in Azure Active Di...Managing enterprise applications, permissions, and consent in Azure Active Di...
Managing enterprise applications, permissions, and consent in Azure Active Di...Peter Selch Dahl
 
TugaIT 2017 Office 365 Multi-factor authentication with Microsoft Azure Activ...
TugaIT 2017 Office 365 Multi-factor authentication with Microsoft Azure Activ...TugaIT 2017 Office 365 Multi-factor authentication with Microsoft Azure Activ...
TugaIT 2017 Office 365 Multi-factor authentication with Microsoft Azure Activ...Nuno Árias Silva
 
Event-Based API Patterns and Practices
Event-Based API Patterns and PracticesEvent-Based API Patterns and Practices
Event-Based API Patterns and PracticesLaunchAny
 
Microsoft identity manoj mittal
Microsoft identity manoj mittalMicrosoft identity manoj mittal
Microsoft identity manoj mittalManoj Mittal
 
2019 - Nova Code Camp - AuthZ fundamentals with ASP.NET Core
2019 - Nova Code Camp - AuthZ fundamentals with ASP.NET Core2019 - Nova Code Camp - AuthZ fundamentals with ASP.NET Core
2019 - Nova Code Camp - AuthZ fundamentals with ASP.NET CoreVladimir Bychkov
 
Community call: Develop multi tenant apps with the Microsoft identity platform
Community call: Develop multi tenant apps with the Microsoft identity platformCommunity call: Develop multi tenant apps with the Microsoft identity platform
Community call: Develop multi tenant apps with the Microsoft identity platformMicrosoft 365 Developer
 
CoLabora March 2022 - Improve security posture by implementing new Azure AD ...
CoLabora March 2022 -  Improve security posture by implementing new Azure AD ...CoLabora March 2022 -  Improve security posture by implementing new Azure AD ...
CoLabora March 2022 - Improve security posture by implementing new Azure AD ...Peter Selch Dahl
 
SPSLisbon 2017 Office 365 Multi-factor Authentication with Microsoft Azure Ac...
SPSLisbon 2017 Office 365 Multi-factor Authentication with Microsoft Azure Ac...SPSLisbon 2017 Office 365 Multi-factor Authentication with Microsoft Azure Ac...
SPSLisbon 2017 Office 365 Multi-factor Authentication with Microsoft Azure Ac...Nuno Árias Silva
 
Granite state #spug The #microsoftGraph and #SPFx on steroids with #AzureFunc...
Granite state #spug The #microsoftGraph and #SPFx on steroids with #AzureFunc...Granite state #spug The #microsoftGraph and #SPFx on steroids with #AzureFunc...
Granite state #spug The #microsoftGraph and #SPFx on steroids with #AzureFunc...Vincent Biret
 
Deep Dive on User Sign-up Sign-in with Amazon Cognito - AWS Online Tech Talks
Deep Dive on User Sign-up Sign-in with Amazon Cognito - AWS Online Tech TalksDeep Dive on User Sign-up Sign-in with Amazon Cognito - AWS Online Tech Talks
Deep Dive on User Sign-up Sign-in with Amazon Cognito - AWS Online Tech TalksAmazon Web Services
 
24032022 Zero Trust for Developers Pub.pdf
24032022 Zero Trust for Developers Pub.pdf24032022 Zero Trust for Developers Pub.pdf
24032022 Zero Trust for Developers Pub.pdfTomasz Kopacz
 
Azure AD B2C Webinar Series: Custom Policies Part 1
Azure AD B2C Webinar Series: Custom Policies Part 1Azure AD B2C Webinar Series: Custom Policies Part 1
Azure AD B2C Webinar Series: Custom Policies Part 1Vinu Gunasekaran
 
Display Microsoft Teams status on your smart light
Display Microsoft Teams status on your smart lightDisplay Microsoft Teams status on your smart light
Display Microsoft Teams status on your smart lightMohamed Ashiq Faleel
 
Securing Serverless Workloads with Cognito and API Gateway Part II - AWS Secu...
Securing Serverless Workloads with Cognito and API Gateway Part II - AWS Secu...Securing Serverless Workloads with Cognito and API Gateway Part II - AWS Secu...
Securing Serverless Workloads with Cognito and API Gateway Part II - AWS Secu...Amazon Web Services
 
Implement Authorization in your Apps with Microsoft identity platform-June 2020
Implement Authorization in your Apps with Microsoft identity platform-June 2020Implement Authorization in your Apps with Microsoft identity platform-June 2020
Implement Authorization in your Apps with Microsoft identity platform-June 2020Microsoft 365 Developer
 
Identity Management for Your Users and Apps: A Deep Dive on Amazon Cognito - ...
Identity Management for Your Users and Apps: A Deep Dive on Amazon Cognito - ...Identity Management for Your Users and Apps: A Deep Dive on Amazon Cognito - ...
Identity Management for Your Users and Apps: A Deep Dive on Amazon Cognito - ...Amazon Web Services
 
Add End User Sign-in, User Management, and Security to Your Mobile and Web Ap...
Add End User Sign-in, User Management, and Security to Your Mobile and Web Ap...Add End User Sign-in, User Management, and Security to Your Mobile and Web Ap...
Add End User Sign-in, User Management, and Security to Your Mobile and Web Ap...Amazon Web Services
 
Deep Dive on Amazon Cognito - March 2017 AWS Online Tech Talks
Deep Dive on Amazon Cognito - March 2017 AWS Online Tech TalksDeep Dive on Amazon Cognito - March 2017 AWS Online Tech Talks
Deep Dive on Amazon Cognito - March 2017 AWS Online Tech TalksAmazon Web Services
 
Raleigh DevDay 2017: Managing User Onboarding, Sign-up, Sign-in, Identity and...
Raleigh DevDay 2017: Managing User Onboarding, Sign-up, Sign-in, Identity and...Raleigh DevDay 2017: Managing User Onboarding, Sign-up, Sign-in, Identity and...
Raleigh DevDay 2017: Managing User Onboarding, Sign-up, Sign-in, Identity and...Amazon Web Services
 
Dev Dives: Master advanced authentication and performance in Productivity Act...
Dev Dives: Master advanced authentication and performance in Productivity Act...Dev Dives: Master advanced authentication and performance in Productivity Act...
Dev Dives: Master advanced authentication and performance in Productivity Act...UiPathCommunity
 

Similar to Microsoft Graph API with OutSystems Event Subscriptions (20)

Managing enterprise applications, permissions, and consent in Azure Active Di...
Managing enterprise applications, permissions, and consent in Azure Active Di...Managing enterprise applications, permissions, and consent in Azure Active Di...
Managing enterprise applications, permissions, and consent in Azure Active Di...
 
TugaIT 2017 Office 365 Multi-factor authentication with Microsoft Azure Activ...
TugaIT 2017 Office 365 Multi-factor authentication with Microsoft Azure Activ...TugaIT 2017 Office 365 Multi-factor authentication with Microsoft Azure Activ...
TugaIT 2017 Office 365 Multi-factor authentication with Microsoft Azure Activ...
 
Event-Based API Patterns and Practices
Event-Based API Patterns and PracticesEvent-Based API Patterns and Practices
Event-Based API Patterns and Practices
 
Microsoft identity manoj mittal
Microsoft identity manoj mittalMicrosoft identity manoj mittal
Microsoft identity manoj mittal
 
2019 - Nova Code Camp - AuthZ fundamentals with ASP.NET Core
2019 - Nova Code Camp - AuthZ fundamentals with ASP.NET Core2019 - Nova Code Camp - AuthZ fundamentals with ASP.NET Core
2019 - Nova Code Camp - AuthZ fundamentals with ASP.NET Core
 
Community call: Develop multi tenant apps with the Microsoft identity platform
Community call: Develop multi tenant apps with the Microsoft identity platformCommunity call: Develop multi tenant apps with the Microsoft identity platform
Community call: Develop multi tenant apps with the Microsoft identity platform
 
CoLabora March 2022 - Improve security posture by implementing new Azure AD ...
CoLabora March 2022 -  Improve security posture by implementing new Azure AD ...CoLabora March 2022 -  Improve security posture by implementing new Azure AD ...
CoLabora March 2022 - Improve security posture by implementing new Azure AD ...
 
SPSLisbon 2017 Office 365 Multi-factor Authentication with Microsoft Azure Ac...
SPSLisbon 2017 Office 365 Multi-factor Authentication with Microsoft Azure Ac...SPSLisbon 2017 Office 365 Multi-factor Authentication with Microsoft Azure Ac...
SPSLisbon 2017 Office 365 Multi-factor Authentication with Microsoft Azure Ac...
 
Granite state #spug The #microsoftGraph and #SPFx on steroids with #AzureFunc...
Granite state #spug The #microsoftGraph and #SPFx on steroids with #AzureFunc...Granite state #spug The #microsoftGraph and #SPFx on steroids with #AzureFunc...
Granite state #spug The #microsoftGraph and #SPFx on steroids with #AzureFunc...
 
Deep Dive on User Sign-up Sign-in with Amazon Cognito - AWS Online Tech Talks
Deep Dive on User Sign-up Sign-in with Amazon Cognito - AWS Online Tech TalksDeep Dive on User Sign-up Sign-in with Amazon Cognito - AWS Online Tech Talks
Deep Dive on User Sign-up Sign-in with Amazon Cognito - AWS Online Tech Talks
 
24032022 Zero Trust for Developers Pub.pdf
24032022 Zero Trust for Developers Pub.pdf24032022 Zero Trust for Developers Pub.pdf
24032022 Zero Trust for Developers Pub.pdf
 
Azure AD B2C Webinar Series: Custom Policies Part 1
Azure AD B2C Webinar Series: Custom Policies Part 1Azure AD B2C Webinar Series: Custom Policies Part 1
Azure AD B2C Webinar Series: Custom Policies Part 1
 
Display Microsoft Teams status on your smart light
Display Microsoft Teams status on your smart lightDisplay Microsoft Teams status on your smart light
Display Microsoft Teams status on your smart light
 
Securing Serverless Workloads with Cognito and API Gateway Part II - AWS Secu...
Securing Serverless Workloads with Cognito and API Gateway Part II - AWS Secu...Securing Serverless Workloads with Cognito and API Gateway Part II - AWS Secu...
Securing Serverless Workloads with Cognito and API Gateway Part II - AWS Secu...
 
Implement Authorization in your Apps with Microsoft identity platform-June 2020
Implement Authorization in your Apps with Microsoft identity platform-June 2020Implement Authorization in your Apps with Microsoft identity platform-June 2020
Implement Authorization in your Apps with Microsoft identity platform-June 2020
 
Identity Management for Your Users and Apps: A Deep Dive on Amazon Cognito - ...
Identity Management for Your Users and Apps: A Deep Dive on Amazon Cognito - ...Identity Management for Your Users and Apps: A Deep Dive on Amazon Cognito - ...
Identity Management for Your Users and Apps: A Deep Dive on Amazon Cognito - ...
 
Add End User Sign-in, User Management, and Security to Your Mobile and Web Ap...
Add End User Sign-in, User Management, and Security to Your Mobile and Web Ap...Add End User Sign-in, User Management, and Security to Your Mobile and Web Ap...
Add End User Sign-in, User Management, and Security to Your Mobile and Web Ap...
 
Deep Dive on Amazon Cognito - March 2017 AWS Online Tech Talks
Deep Dive on Amazon Cognito - March 2017 AWS Online Tech TalksDeep Dive on Amazon Cognito - March 2017 AWS Online Tech Talks
Deep Dive on Amazon Cognito - March 2017 AWS Online Tech Talks
 
Raleigh DevDay 2017: Managing User Onboarding, Sign-up, Sign-in, Identity and...
Raleigh DevDay 2017: Managing User Onboarding, Sign-up, Sign-in, Identity and...Raleigh DevDay 2017: Managing User Onboarding, Sign-up, Sign-in, Identity and...
Raleigh DevDay 2017: Managing User Onboarding, Sign-up, Sign-in, Identity and...
 
Dev Dives: Master advanced authentication and performance in Productivity Act...
Dev Dives: Master advanced authentication and performance in Productivity Act...Dev Dives: Master advanced authentication and performance in Productivity Act...
Dev Dives: Master advanced authentication and performance in Productivity Act...
 

Recently uploaded

Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
software engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxsoftware engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxnada99848
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 

Recently uploaded (20)

Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
software engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxsoftware engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptx
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 

Microsoft Graph API with OutSystems Event Subscriptions

  • 1. Microsoft Graph API with OutSystems Event Subscriptions Subscribe and handle Microsoft Graph API change notifications in your application February 8thth 11am (CET) Stefan Weber Senior Director Software Development Telelink Business Services Germany GmbH OutSystems MVP – AWS Community Builder
  • 2. Fundamentals  Overview of Microsoft Graph API subscriptions  Basic Notifications and Rich Notifications  Subscription Lifecycle  Best Practices Agenda Implementation  Prerequisites  Entra Application Registration and Permissions  OAuth access token client credential flow  Subscribe and handle basic notifications  Handle lifecycle events  Subscribe and handle rich notifications
  • 3. Previous Webinars on Microsoft Graph API with OutSystems Application Permissions Query Microsoft Graph API with application permissions. Demonstration on how to acquire an access token from Microsoft Entra with an OAuth client credentials flow. https://youtu.be/yVK8WQz5qnU Delegated Permissions Query Microsoft Graph API with delegated (user) permissions. Demonstration on how to acquire an access token from Microsoft Entra with an OAuth authorization code flow. https://youtu.be/2cSsg5ws1H4
  • 4. Microsoft Graph API Event Subscription Microsoft Graph API event subscriptions allow you to subscribe to changes in resources such as messages, calendars, and contacts in Microsoft Graph. When a change occurs, the API sends a notification to the subscribed application. To create a subscription you must specify an event type – e.g. create – and a resource using an application or delegated access token with corresponding permissions (Scopes). Subscriptions expire and get deleted automatically on  Individual subscription expiry  Resource subscription lifetime limit  Access Token used for subscribing expires if Lifecycle Notifications are not handled by your application.
  • 5. Basic Notifications A basic notifications only returns the event type and the affected resource identifier back to your application. In order to get the details of the affected resource you must perform a Graph API query. It is the easiest way to get started with Microsoft Graph API event subscriptions. Resource Events Rich Notifications Rich Notifications include the affected resource data besides the event type and the resource identifier. Resource data in Rich Notifications is encrypted by a Public Key you must include when subscribing to an event and you need the corresponding Private Key to decrypt the resource data. You must specify explicitly which attributes should be transported as encrypted resource data.
  • 6. Lifecycle Events Missed Notification to your lifecycle events endpoint on non-delivered event e.g. because of Timeout. Actions to take  Acknowledge event by returning a status code of 202 – Accepted  Query the resource or perform a delta query to take further action Applicable only to Outlook Messages, Events and Personal Contacts. Subscription Removed Triggered whenever a subscription is removed from Microsoft Graph. Applicable only to Outlook Messages, Events and Contacts and Teams Chat Messages. Reauthorization Required This events hits your lifecycle events endpoint when  The access token is about to expire  The subscription is about to expire  A tenant administrator revoked permissions for your application Actions to take  Acknowledge event by returning a status code of 202 – Accepted  Reauthorize and update subscription
  • 7. Application  Configure application permissions on resources in your Entra application registration. Keep in mind that application permissions are very powerful and additional actions should be taken to limit application permissions.  Use the Client Credential OAuth2 flow to retrieve an access token.  Subscribe to resources using the access token.  On Reauthorization Required lifecycle events simply request a new access token via the Client Credential flow to reauthorize and update a subscription Subscribing as application or on-behalf of a user (delegated) Delegated  Configure delegated permissions on resources in your Entra application registration.  Make sure that you added the offline_access permission to get a refresh token.  Perform a Authorization Code OAuth2 flow to retrieve an access token and refresh token.  Subscribe to resources  On Reauthorization Required lifecycle events use a valid cached access token or retrieve a new access token using by performing a token refresh operation.
  • 9. Prerequisites  Access to your Azure Tenant using the Azure Portal  Cloud Application Administrator role assigned to your user account to register an application in your tenant.  Powershell to generate a Public/Private key pair for Rich Notifications.
  • 10. Demo Application GraphWebinar Event Subscriptions Available on Forge
  • 11. Rich Notifications Certificate / Private Key 11 <# Script generates a new certificate and private key private-key.xml The private key in XML format public.cer The public key base64 encoded #> $params = @{ Subject = "CN=Microsoft Graph Rich Notifications" CertStoreLocation = "Cert:CurrentUserMy" KeyExportPolicy = "Exportable" KeyUsage = "DataEncipherment" KeyAlgorithm = "RSA" KeyLength = 2048 KeyUsageProperty = "All" } # End Certificate Parameters $cert = New-SelfSignedCertificate @params # Create Certificate in User Certificate Store (Personal) $cert.PrivateKey.ToXmlString($true) | Out-File "private-key.xml" # Export the private key in XML Format [System.Convert]::ToBase64String($cert.Export('Cert')) | Out-File "public.cer" # Export the certificate (public) as DER base64 encoded
  • 13. Best practices  Try to avoid subscribing under application permissions. Use delegated permission if possible.  Use a single REST API to receive all Graph API webhooks. Don‘t create separate endpoints for different use cases.  For large volumes of subscriptions and events consider Azure Event Grid (preview) or Lambda to AWS EventBridge.
  • 14.  Master OAuth 2.0 Website  Microsoft Developer Program  Azure Portal  Microsoft Learn – Authorization Code Flow  Use the Microsoft Graph API documentation  Microsoft Graph Explorer  OAuth Token Exchange Forge component  CryptoAPI Forge component Additional Material  Microsoft Graph Permission Reference  Microsoft Graph API Lifecycle Events  Notifications Endpoint Validation  Rich Notifications
  • 15. Introduction and Bedrock Knowledge Bases  Overview of Amazon Bedrock  Configuration and Model Access  Creating a Knowledge Base  Query Knowledge Base Information  When to roll your own custom Knowledge Base  Use Bedrock Knowledge Bases for Retrievable Augmented Generation (RAG) in OutSystems applications. March 2024 Coming up – Amazon Bedrock Bedrock Agents and Action Groups  Overview of Agents and AI Reasoning  Create and Configure an Agent  Add Knowledge Base(s) to an Agent  Add Lambda Functions middleware to an Agent  Use Bedrock Agents in OutSystems applications April 2024
  • 16. Stefan Weber Senior Director Software Development Telelink Business Services Germany GmbH OutSystems MVP – AWS Community Builder https://www.tbs.tech https://www.linkedin.com/in/stefanweber1/ https://lcnc.blog