GithubHelp home page GithubHelp logo

isabella232 / nodejs-connect-rest-sample Goto Github PK

View Code? Open in Web Editor NEW

This project forked from microsoftgraph/nodejs-connect-rest-sample

0.0 0.0 0.0 225 KB

[ARCHIVED] Use Microsoft Graph to access a user’s Microsoft account data from within a Node.js web application. This sample sends REST calls directly to the Microsoft Graph endpoint, and authenticates with the Azure AD v2.0 endpoint to support Microsoft Accounts and work or school accounts.

License: MIT License

JavaScript 83.29% CSS 2.21% HTML 11.41% Batchfile 1.81% Shell 1.28%

nodejs-connect-rest-sample's Introduction

[ARCHIVED] Microsoft Graph Connect Sample for Node.js

IMPORTANT

This project is being archived and replaced with the Build Node.js Express apps with Microsoft Graph. As part of the archival process, we're closing all open issues and pull requests.

You can continue to use this sample "as-is", but it won't be maintained moving forward. We apologize for any inconvenience.

Table of contents

Introduction

This sample shows how to connect a Node.js app to a Microsoft work or school (Azure Active Directory) or personal (Microsoft) account using the Microsoft Graph API to send an email. In addition, the sample uses the Office Fabric UI for styling and formatting the user experience.

Microsoft Graph Connect Sample for Node.js screenshot

Prerequisites

To use the Microsoft Graph Connect Sample for Node.js, you need the following:

Register the application

  1. Sign into the App Registration Portal using either your personal or work or school account.

  2. Choose Add an app.

  3. Enter a name for the app, and choose Create application.

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

  4. Copy the Application Id. This is the unique identifier for your app.

  5. Under Application Secrets, choose Generate New Password. Copy the password from the New password generated dialog.

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

  6. Under Platforms, choose Add Platform.

  7. Choose Web.

  8. Enter http://localhost:3000/token as the Redirect URI.

  9. Choose Save.

Build and run the sample

  1. Download or clone the Microsoft Graph Connect Sample for Node.js.

  2. Using your favorite IDE or code editor (we love Visual Studio Code), open utils/config.js.

  3. Replace the client_id and client_secret placeholder values with the Application Id and Application secret that you copied during app registration.

  4. In a command prompt, run the following command in the root directory. This installs the project dependencies.

npm install

  1. Run the following command to start the development server.

npm start

  1. Navigate to http://localhost:3000 in your web browser.

  2. Choose the Connect button.

  3. Sign in with your personal or work or school account and grant the requested permissions.

  4. Optionally edit the recipient's email address, and then choose the Send mail button. When the mail is sent, a Success message is displayed below the button.

Note: To understand the code for calling the Microsoft Graph API in a Node.js app, see Get started with Microsoft Graph in a Node.js app.

Questions and comments

We'd love to get your feedback about the Microsoft Graph Connect Sample for Node.js. You can send your questions and suggestions in the Issues section of this repository.

Questions about Microsoft Graph development in general should be posted to Stack Overflow. Make sure that your questions or comments are tagged 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) 2016 Microsoft. All rights reserved.

nodejs-connect-rest-sample's People

Contributors

andrewjmay avatar chrisdias avatar davidchesnut avatar iambmelt avatar imagentleman avatar jasonjoh avatar martellaj avatar o365devx avatar ricalo avatar tadaomachida avatar tsekityam avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.