rdtsai / angular-connect-sample

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 with the Microsoft Graph JavaScript SDK to send an email. In addition, the sample uses the Office Fabric UI for styling and formatting the user experience.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Microsoft Graph JavaScript SDK Connect Sample for AngularJS

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 with the Microsoft Graph JavaScript SDK to send an email. In addition, the sample uses the Office Fabric UI for styling and formatting the user experience.

![Microsoft Graph Connect sample screenshot](./README assets/screenshot.png)

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/login 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, including the HelloJS client-side authententication library and the Microsoft Graph JavaScript SDK.

npm install
bower 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 opencode@microsoft.com 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

Copyright (c) 2016 Microsoft. All rights reserved.

About

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 with the Microsoft Graph JavaScript SDK to send an email. In addition, the sample uses the Office Fabric UI for styling and formatting the user experience.

License:MIT License


Languages

Language:JavaScript 63.9%Language:HTML 30.5%Language:CSS 5.6%