You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/providers/Teams.md
+51-20Lines changed: 51 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,21 +7,58 @@ author: nmetulev
7
7
8
8
# Microsoft Teams provider
9
9
10
-
Use the Teams provider inside your Microsoft Teams App, inside a Tab, to power it with Microsoft Graph access.
10
+
Use the Teams provider inside your Microsoft Teams Tab to facilitate authentication and Microsoft Graph access to all components.
11
11
12
-
Visit [the authentication docs](../providers.md) to learn more about the role of providers in the Microsoft Graph Toolkit
12
+
Visit [the authentication docs](../providers.md) to learn more about the role of providers in the Microsoft Graph Toolkit.
13
13
14
14
## Getting started
15
15
16
-
Initialize the provider inside your html using the `mgt-teams-provider` component.
16
+
Before using the Teams provider, you will need to make sure you have referenced the [Microsoft Teams SDK](https://docs.microsoft.com/en-us/javascript/api/overview/msteams-client?view=msteams-client-js-latest#using-the-sdk) in your page.
17
+
18
+
Here is an example using the provider in HTML (via CDN):
See [sample](https://github.com/microsoftgraph/microsoft-graph-toolkit/tree/master/samples/teams-tab) for full example
61
+
25
62
## Configuring your Teams App
26
63
27
64
If you are just getting started with Teams Apps, you can follow the getting started guide [here](https://docs.microsoft.com/en-us/microsoftteams/platform/concepts/tabs/tabs-overview). You could also use the [App Studio](https://docs.microsoft.com/en-us/microsoftteams/platform/get-started/get-started-app-studio) to quickly develop your app manifest for Microsoft Teams.
@@ -42,20 +79,14 @@ Make sure to enable Implicit Grant Flow as this is a requirement for web apps re
42
79
43
80
### Create the popup page
44
81
45
-
In order to login with your Teams credentials, you need to provide a URL that the Teams App with open in a popup, which will follow the authentication flow. This URL needs to be in your domain, and it needs to call the `TeamsProvider.handleAuth();` method. That's the only thing that this page needs to do. For example (if you are using parcel to bundle your app) - `auth.html`:
82
+
In order to login with your Teams credentials, you need to provide a URL that the Teams App with open in a popup, which will follow the authentication flow. This URL needs to be in your domain, and it needs to call the `TeamsProvider.handleAuth();` method. That's the only thing that this page needs to do. For example:
After you publish this page in your website, you need to get it's URL and use it in the `auth-popup-url` property. This URL also needs to be configured as a valid redirect URI at your app configuration, at the AAD portal.
92
+
After you publish this page in your website, you need to get it's URL and use it in the `auth-popup-url/authPopupUrl` property. This URL also needs to be configured as a valid redirect URI at your app configuration, at the AAD portal.
For the quickest way to run this sample, you will need:
4
+
5
+
* Visual Studio Code
6
+
*[Live Server extension in Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer)
7
+
*[ngrok](https://ngrok.com/)
8
+
9
+
1. Visit the [Microsoft identity platform documentation](https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app) to learn more about creating a new application and retrieving a clientId. Add the client id in `index.html`
10
+
11
+
> Note: Msal only supports the Implicit Flow for OAuth. Make sure to enable Implicit Flow in your application in the Azure Portal (it is not enabled by default). Under `Authentication`, find the `Implicit grant` section and check both checkboxes for `Access tokens` and `ID tokens`
12
+
13
+
2. Open `index.html` with Live Server and start `ngrok` in terminal/cmd
14
+
15
+
```bash
16
+
ngrok http [port]
17
+
```
18
+
19
+
Live Server default port is `8080`
20
+
21
+
4. Go back to the application registration in the Azure portal and add the redirect url. The redirect url is your ngrok url with the auth page appended.
22
+
23
+
Ex: `https://b5d9404b.ngrok.io/auth.html`
24
+
25
+
5. Now you can use [App Studio](https://docs.microsoft.com/en-us/microsoftteams/platform/get-started/get-started-app-studio) to quickly develop your app manifest for Microsoft Teams and test the app. Use the ngrok url for the tab url.
0 commit comments