page_type | languages | products | description | urlFragment | |||
---|---|---|---|---|---|---|---|
sample |
|
|
This sample demonstrates a Python daemon console app calling the Microsoft Graph that is secured using the Microsoft identity platform. |
ms-identity-python-webapp |
A Python console daemon app calling Microsoft Graph
About this sample
Scenario
You want to write a daemon application that consumes organizational data using Microsoft Graph and using Microsoft Identity Platform to acquire tokens.
For details see Daemon apps scenario.
Structure of the repository
This repository contains a progressive tutorial made of two parts:
Sub folder | Description |
---|---|
1-Call-MsGraph-WithSecret | This sample application shows how to use the Microsoft identity platform endpoint to access the data of Microsoft business customers in a long-running, non-interactive process. The daemon application proves its identity using a client secret. It uses the OAuth 2 client credentials grant to acquire an access token, which can be used to call the Microsoft Graph and access organizational data |
2-Call-MsGraph-WithCertificate | This variation of the first sample shows how the application proves its identity using a certificate. |
Prerequisites
To run this sample, you'll need:
- Python 2.7+ or Python 3+
- MSAL Python
pip msal- An Azure Active Directory (Azure AD) tenant. For more information on how to get an Azure AD tenant, see how to get an Azure AD tenant.
Setup and run the sample
Download and extract the repository .zip file or, from your shell or command line:
git clone https://github.com/Azure-Samples/ms-identity-python-daemon.git
Then, see the readme of each sub-folder to understand how to setup and run the samples, and learn key concepts.
Contributing
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.