GPT How-to: Configuring Microsoft Graph + OAuth (and various third party APIs)
With OpenAI's latest advancements, particularly the GPT feature and its enhanced assistant capabilities, integrating AI with Microsoft Graph and third-party APIs has become more dynamic and important.
This guide focuses on configuring GPTs, Microsoft Graph with OAuth for seamless interaction, leveraging GPT's improved context understanding and automated abilities. The integration extends GPT's reach, enabling it to interact with extensive Microsoft 365 data and services but could be used for pretty much any API that uses Oauth like HubSpot or Google.
The integration of these advanced GPT capabilities with Microsoft Graph unlocks unprecedented possibilities. Microsoft Graph serves as a rich data source encompassing various Microsoft 365 services like Azure AD, Office 365, and more. By tapping into this repository, GPTs can leverage the vast array of organizational data, enhancing AI-driven functionalities.
You can try my functional version here.
Potential Applications
Step by Step Guide
Step 1: Register Your Application in Azure Active Directory
Step 2: Obtain Application (Client) ID and Directory (Tenant) ID
After registration, note the "Application (client) ID" and "Directory (tenant) ID" from the app overview page.
领英推荐
Step 3: Create a Client Secret
Step 4: Set Up OAuth in Your Application
{
"openapi": "3.0.0",
"info": {
"title": "Microsoft Graph API Example",
"version": "1.0"
},
"servers": [
{
"url": "https://graph.microsoft.com/v1.0"
}
],
"paths": {
"/me": {
"get": {
"operationId": "getUserProfile",
"summary": "Get current user profile",
"responses": {
"200": {
"description": "Successful response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserProfile"
}
}
}
}
},
"security": [
{
"OAuth2": []
}
]
}
}
},
"components": {
"schemas": {
"UserProfile": {
"type": "object",
"properties": {
"displayName": {
"type": "string"
},
"mail": {
"type": "string"
}
}
}
},
"securitySchemes": {
"OAuth2": {
"type": "oauth2",
"flows": {
"authorizationCode": {
"authorizationUrl": "https://login.microsoftonline.com/{tenant}/oauth2/v2.0/authorize",
"tokenUrl": "https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token",
"scopes": {
"User.Read": "Read user profile"
}
}
}
}
}
}
}
Step 5: Configure Redirect URI
Step 6: Reauthorize and Test
Additional Notes
Expert Bubble Developer | Helping Non-Technical Founders and Small Businesses build and launch apps with nocode.
10 个月Hello Reuven Cohen. This is amazing. Exactly what I'm trying to do. I followed the steps. I was able to initialize the sign in process. I had to change a few things. But when I'm redirected to the callback url, I get a "Missing Access Token" message at the top of the screen for a quick second. It happens too quickly for me take a picture. Have you encountered this before? If so, any suggestions? Thanks
Founder | Client and project intel for your tech services business.
11 个月Things are moving so fast that Microsoft is starting to eat its own newly released products.
CEO HubOne, Accelerated Ultra AI Clusters NVIDIA BLACKWELL & High Compute Immersion, UltraScaler Partner Driven, Growth Capital, 100% Green Power & Technology - Institutional Invest-Ability Utility
11 个月Commenting for wider reach this is such a great post !
Freelance Senior Video Editor | AI Film Director | Remote Editing Using Lucidlink
11 个月Reuven Cohen This is so appreciated. Creating a GPT that needs an API. I do wish it worked with IOS too
Fractional Chief Product Officer / Chief Technology Officer, Cloud as the canvas for AI. AI in Healthcare. Random walker in the technology landscape & future Asteroid farmer
11 个月Yup, this is so cool and infinite possibilities