GithubHelp home page GithubHelp logo

216giorgiy / angular-connect-rest-sample Goto Github PK

View Code? Open in Web Editor NEW

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

0.0 1.0 0.0 164 KB

Use Microsoft Graph to access a user’s Microsoft account data from within an AngularJS web application. This sample uses REST calls directly to the Microsoft Graph endpoint and authenticates users with Microsoft Accounts or work or school Office 365 accounts.

License: MIT License

JavaScript 72.09% HTML 23.39% CSS 4.52%

angular-connect-rest-sample's Introduction

Microsoft Graph Connect Sample for AngularJS (REST)

Table of contents

Introduction

This sample shows how to connect an AngularJS 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. We also have an Angular connect sample that uses that Microsoft Graph JavaScript SDK.

Microsoft Graph Connect sample screenshot

This sample uses the Microsoft Authentication Library Preview for JavaScript (msal.js) to get an access token.

Prerequisites

To use the Microsoft Graph Connect sample for AngularJS, 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 Platforms, choose Add Platform.

  6. Choose Web.

  7. Make sure the Allow Implicit Flow check box is selected, and enter http://localhost:8080 as the Redirect URI.

  8. Choose Save.

Build and run the sample

  1. Download or clone the Microsoft Graph Connect Sample for AngularJS.

  2. Using your favorite IDE, open config.js in public/scripts.

  3. Replace the clientID placeholder value with the application ID of your registered Azure application.

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

npm install
  1. Run npm start to start the development server.

  2. Navigate to http://localhost:8080 in your web browser.

  3. Choose the Connect button.

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

  5. 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.

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.

Questions and comments

We'd love to get your feedback about this sample. 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].

Additional resources

Copyright (c) 2016 Microsoft. All rights reserved.

angular-connect-rest-sample's People

Contributors

andrewjmay avatar dan-silver avatar davidchesnut avatar martellaj avatar ricalo avatar tadaomachida avatar

Watchers

 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.