Skip to content

NT-D/RoomFinder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RoomFinder

This is demo project for booking meeting room in Office 365 Tenant by Google Assistant (Home).

What you can learn

Current version limitation

Solution description

Current Architecture

architecture

Prerequisites

  • Install Node.js in your development environment. I assume you can understand es6.
  • Basic TypeScript knowledge. Please learn from tutorial document
  • I assume you have O365 tenant. If you want to try O365, you can try trhough [Free trial] in product page
  • In addition to it, I assume you have meeting room as resource mail box in O365 tenant. If you dont't have it, you can make it with this document

How to setup

For OAuth authentication, need to register app and pickup Client ID and Client Secret. In addition to it, need to set redirect url and scope. You can learn how to setup with following section.

Register app in Microsoft App registration portal

  1. Register(create) new app in the app registration portal with this document. Please save your Applicaion Id(Client ID) and Password(Client Secret) in the clipboard.
  2. Add platform as Web with [Add Platform]button.
  3. Paste https://oauth-redirect.googleusercontent.com/r/<Your project id> in the [Redirect URLs]text box.
  4. Add Calendars.ReadWrite.Shared and User.Read delegated permissions in the [Microsoft Graph Permissions]section.
  5. Save your change.

Setup Dialog flow (Basic)

Setup Dialog flow (Authentication)

Implementing Account Linking with following parameters.

Property name Value
Grant type Authorization code
Client ID Application Id generated in app registration portal
Client secret Password generated in app registration portal
Authorization URL https://login.microsoftonline.com/common/oauth2/v2.0/authorize
Token URL https://login.microsoftonline.com/common/oauth2/v2.0/token
Scopes https://graph.microsoft.com/Calendars.ReadWrite.Shared https://graph.microsoft.com/User.Read

Important: You need to turn on [Sign in required] in the [Integration menu] in dialog flow console.

How to run

  1. git clone https://github.com/NT-D/RoomFinder.git
  2. npm install in terminal(or command prompt) for installing node modules
  3. npm run watch in another terminal for trans-complie .ts to .js file
  4. npm run start in terminal for starting app.
  5. Setup ngrok and create forwarding url (ex. You will get the url like https://c349cad0.ngrok.io)
  6. Set previous url in the Fulfillment settings in dialog flow.

Implementation description

How to get access token

You can get access token through this code in app.ts.

dialogApp.getUser().accessToken

Call MS Graph by app

You can call graph API like this code in msgraphService.ts.

export async function getUserInfo(accessToken: string): Promise<msGraph.User> {
    const response = await fetch(`${apiEndpointUrl}/me`, { method: 'GET', headers: { 'Authorization': `Bearer ${accessToken}` } });
    return await response.json() as msGraph.User;
}

Userful resources

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published