Office365 OAuth

OAuth Support for Office 365 Accounts

Nylas now offers support for Okta, OneLogin, and other leading SSO providers for all Office365 and GSuite accounts.

Tasia Potasinski | September 3, 2019

Today, we’re introducing OAuth support for Office 365 accounts! Now, you can authenticate user’s data to sync with your app more securely, gain more control over the data you access, and provide a smoother auth process for users.

  1. Authenticate User’s Accounts to Sync With Your Application Even More Securely

With OAuth for Office365, users can authenticate their inbox to sync with your app more securely by entering their credentials directly into the Microsoft login screen before being redirected back to your app. 

Users will start in your application. When asked to sync data with your app, they’ll be directed to this Microsoft hosted page to enter their credentials:

  1. Gain More Control Over the Data You Access

Gmail lead the way with enhanced security and controls for users over the types of data they sync with your app. With Nylas, you can apply the same security enhancements that Google requires to your Office 365 users through granular authentication scopes

Here’s an example view of the granular scopes splash screen that you could enable to communicate what types of user data you’re syncing:

  1. Provide a Smoother Authentication Process for Users

With OAuth for Office 365, users will be able to authenticate their inbox to sync data with your app via a secure, Microsoft auth flow, reducing authentication errors and helping users authenticate faster.

How OAuth Works

  1. Request a Nylas Code

Request

curl -X POST https://api.nylas.com/connect/authorize -d '{ 
    "client_id":  "nylas_client_id",
    "name":  "Erlich Bachman",
    "email_address":  "[email protected]",
    "provider":  "office365",
    "settings":      {
      "microsoft_client_id": "",
      "microsoft_client_secret": "",
      "microsoft_refresh_token":  "",
      "redirect_uri": "", # Redirect URI that the customer originally used to get the refresh/access tokens
    },
    "scopes":      "email.read_only,calendar"
  }'

Response

{"code": "the response code"}
  1. Get the Nylas access_token from code
  curl -X POST "https://api.nylas.com/connect/token" -d '{

    "client_id": "nylas-client-id",

    "client_secret": "nylas-client-secret",

    "code": "the-code"

  }'

Learn more about how to setup OAuth for Office 365 on our docs here.

About the Author

Tasia is the Director of Product Marketing at Nylas. She's passionate about communications and helping connect the world through APIs. In her free time, she writes and produces music.

Ready to Start Building?

Connect up to 10 accounts for free today. No credit card required.