All Projects → microsoftgraph → contoso-airlines-teams-sample

microsoftgraph / contoso-airlines-teams-sample

Licence: MIT license
No description, website, or topics provided.

Programming Languages

javascript
184084 projects - #8 most used programming language
C#
18002 projects
HTML
75241 projects

Contoso Airlines sample for Microsoft Teams Graph APIs

This sample demonstrates using the Microsoft Graph APIs for Microsoft teams to automate team lifecycles for Contoso Airlines: every night, they create a new team for each flight they are flying the following day, and after the flight, they archive the team.

Build and run

To run, you'll need to register your application.

  1. Sign into the Azure app registration portal using either your personal or work or school account.

  2. Choose New registration near the top.

  3. Enter a name for the app. Under Supported account types, select Accounts in any organizational directory and personal Microsoft accounts (e.g. Skype, Xbox, Outlook.com).

  4. For Redirect URI (optional), choose Web and then enter http://localhost:55065/.

    The app overview page displays, listing the properties of your app.

  5. Copy the value for Application (client) ID. This is the unique identifier for your app.

  6. Select the Certificated & secrets page. Under Client secrets, choose New client secret.

  7. Enter a label for the client secret and select an expiration period. Select Add.

  8. Copy the value for your new client secret. This is the only time you will be able to see this value.

    You'll use the application ID and secret to configure the sample app in the next section.

  9. Navigate to the Authentication page.

  10. Under Advanced settings, find the Implicit grant section. Check the boxes for Access tokens and ID tokens to enable implicit flow.

    These options enable the hybrid flow. During authentication, this enables the app to receive both sign-in info (the id_token) and artifacts (in this case, an authorization code) that the app can use to obtain an access token.

  11. Choose Save at the top.

  12. Create a file named Web.config.secrets (put it next to Web.config), and add in your application ID and client (app) secret:

<?xml version="1.0" encoding="utf-8"?>
  <appSettings >
    <add key="ida:AppId" value="xxxxx"/>
    <add key="ida:AppSecret" value="xxxxx"/>
  </appSettings>

Code of note

Note: To understand the code for calling the Microsoft Graph API in an ASP.NET MVC app, see Get started with Microsoft Graph in an ASP.NET 4.6 MVC app.

A lot of this code came from the Graph Quickstart for ASP.NET MVC.

Questions and comments

We'd love to get your feedback about this sample. You can send us your questions and suggestions in the Issues section of this repository.

Your feedback is important to us. Connect with us on Stack Overflow. Tag your questions with [MicrosoftGraph].

Contributing

If you'd like to contribute to this sample, see CONTRIBUTING.md.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Additional resources

Copyright

Copyright (c) 2018 Microsoft. All rights reserved.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].