OfficeDev/Outlook-Add-in-JavaScript-UseIdentityToken

Name: Outlook-Add-in-JavaScript-UseIdentityToken

Owner: Office Developer

Description: Shows how to use a client token from the Exchange server to provide authentication for users of a mail add-in for Outlook.

Created: 2015-08-14 19:52:42.0

Updated: 2017-05-15 05:50:00.0

Pushed: 2018-01-31 20:28:37.0

Homepage: null

Size: 960

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Outlook Add-in: Use a client identity token

Table of contents

Summary

This sample shows how to use a client token from the Exchange server to provide authentication for users of your mail add-in for Outlook.

Prerequisites

This sample requires the following:

Key components of the sample

The sample solution contains the following key files:

UseIdentityToken project

UseIdentityTokenWeb project

UseIdentityTokenService project

Description of the code

This sample shows how to use a client token from the Exchange server to provide authentication for users of your mail add-in. The Exchange server issues a token that is unique to the mailbox

on the server. You can use this token to associate a mailbox with services that you provide to a mail add-in.

The sample is divided in two parts:

The web service uses the following steps to process the token:

This sample does not validate the service user name and password in any way. A credential request is considered valid if it contains both a user name and password. Credentials do not expire from the cache in this sample; however, all the cached identifiers and user names are lost when you stop running the sample application.

This sample requires a valid server certificate on the Exchange server. If the Exchange server is using its default self-signed certificate, you will need to add the certificate to your local trusted certificate store. You can find instructions for exporting and installing a self-signed certificate on TechNet.

Build and debug

The add-in will be activated on any email message in the user's Inbox. You can make it easier to test the add-in by sending one or more email messages to your test account before you run the sample.

  1. Open the solution in Visual Studio, and press F5 to build the sample.
  2. Connect to an Exchange account by providing the email address and password for an Exchange 2013 server, and allow the server to configure the email account.
  3. In the browser, log on with the email account by entering the account name and password.
  4. Select a message in the Inbox, and click Use Identity Token in the add-in bar that renders above the message.
  5. Click the Send unique Exchange ID to service button to send a request to the Exchange server.
  6. The server will prompt you to log on. You can type anything in the service user name and password boxes. This sample does not validate the contents of the text boxes.
  7. Click the Send unique Exchange ID to service button again. This time, a response is returned from the server without a request for a user name and password.

If you have another email message in your Inbox, you can switch to that email message, show the Use Identity Token add-in, and click the button again. The response will be returned from the server without a request for a user name or password.

Troubleshooting

You might encounter following issues when you use Outlook Web App to test a mail add-in for Outlook:

If the add-in loads but does not run, try to build the solution in Visual Studio (Build > Build Solution). Check the Error List for missing dependencies and add them as needed.

Questions and comments

Additional resources
Copyright

Copyright (c) 2015 Microsoft. All rights reserved.

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.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.