service accounts calendar

Now Available: Service Accounts for Calendar Authentication

4 min read

Your onboarding process sets the impression that new users carry through their entire lifetime with your product, which makes this a critical step of the user experience. 

The quickest and easiest way to onboard large organizations to your platform is using service accounts – the process by which a singular IT administrator automatically connects every user in their organization to your application. Service accounts also enables administrators to create company-wide settings at the administrator level, reducing friction for their organization. 

By offering service accounts, you allow your customers’ onboarding journey to be as productive and smooth as possible, you can convert them to early product champions and increase user activation and retention.

Today, we’re excited to announce the availability of service accounts for calendar with the Nylas Calendar API! Now, you can allow customers to onboard their entire organization, and manage their settings, via a single IT administrator at their organization in just a few minutes.

Service accounts joins the set of Nylas features including hosted auth and SSO for Okta and OneLogin, all geared towards making it easier than ever to auth customers to your platform securely.

How Service Accounts for Calendars Works

We’ve extended our Native Authentication APIs (i.e. our fully whitelabeled authentication option)  to support authenticating users with service accounts for their calendars.

Using our Native Authentication APIs, customers can authenticate user accounts for an entire organization using a single service account.

curl -X POST https://api.nylas.com/connect/authorize -d
'{
  "client_id": "<nylas_client_id>",
  "name": "<name>",
  "email_address": "<email_address>",
  "provider": "gmail",
  "settings": {
    "service_account_json": {
      "type": "service_account",
      "project_id": "metal-figure-239116",
      "private_key_id": "68ac9191dd3468915b4e52e0be785ba7c6873b14", 
      "private_key": "-----BEGIN PRIVATE KEY-----\nMI...J7tF8=\n-----END PRIVATE KEY-----\n",
      "client_email": "[email protected]",
      "client_id": "105691998485416876281",
      "auth_uri": "https://accounts.google.com/o/oauth2/auth",
      "token_uri": "https://oauth2.googleapis.com/token",
      "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
      "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/test-service-account%40metal-figure-239116.iam.gserviceaccount.com"
    }
  }
  "scopes": "<scopes>"
}'

 

The workflow itself looks like this:

 

 

Service Accounts for GSuite

Authenticating GSuite accounts looks like this:

curl -X POST https://api.nylas.com/connect/authorize -d
   '{
       "client_id": "<nylas_client_id>",
       "name": "Joe User",
       "email_address": "[email protected]",
       "provider": "gmail",
       "settings": {
           "service_account_json": {
             "type": "service_account",
             "project_id": "metal-figure-239116",
             "private_key_id": "68ac9191dd3468915b4e52e0be785ba7c6873b14",
             "private_key": "-----BEGIN PRIVATE KEY-----\nMI...J7tF8=\n-----END PRIVATE KEY-----\n",
             "client_email": "[email protected]",
             "client_id": "105691998485416876281",
             "auth_uri": "https://accounts.google.com/o/oauth2/auth",
             "token_uri": "https://oauth2.googleapis.com/token",
             "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
             "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/test-service-account%40metal-figure-239116.iam.gserviceaccount.com"
           }
       }
       "scopes": "calendar"
   }'

Service Accounts for Office 365

Authenticating Office 365 accounts through service accounts is simple. It looks like this:

curl -X POST https://api.nylas.com/connect/authorize -d '{ 
  "client_id":     "nylas_client_id",
  "name":          "Joe User",
  "email_address": "[email protected]",    
  "provider":      "exchange",
  "settings":      {
        "microsoft_client_id":      "",
        "microsoft_client_secret":     "",
        "microsoft_refresh_token":     "",
        "redirect_uri":             "",
        "service_account": true
  },
  "scopes": "calendar"
}'

Beyond Service Accounts

In addition to service accounts, Nylas provides front-end scheduling tools in Nylas Scheduler: a customizable widget that powers sophisticated automated scheduling tools like instant schedule, round-robin for fairness, round robin based on first availability, time zone support, and more.

Get started with service accounts today by signing up for a free Nylas developer account.

Related resources

How to schedule time slots and check availability?

Building a scheduling application that displays the organizer’s available timeslots seems like a simple problem…

Nylas’ 2024 predictions: Navigating AI, connectivity, and the future of work

Explore the transformative impact of AI, the evolution of global connectivity, and the reshaping of workplace culture in the digital era in Nylas’ 2024 predictions.

Grouping email threads with Ruby and Nylas

Use the Nylas Email API and Ruby to group email threads into a single view, and easily access complete conversations within your app.