Skip to content

Latest commit

 

History

History
38 lines (26 loc) · 1.67 KB

README.md

File metadata and controls

38 lines (26 loc) · 1.67 KB

OmniAuth Office365

Gem Version Build Status Code Climate

Gem to authenticate applications to the Office365 v2.0 REST API via OAuth2.

Note An unmaintained (at least as of this writing) omniauth-office365 gem exists at https://github.com/simi/omniauth-office365. However, it's built on an older, deprecated version of the API.

Setup

Note Depending on the which scopes you choose, a successful response may not contain an access_token. In that cases, an error will be raised in the oauth2 gem. There's a PR that should address this: oauth-xx/oauth2#243.

Standard setup:

  # Add to your initializers/omniauth.rb

  use OmniAuth::Builder do
    provider :office365, ENV['OFFICE365_APP_ID'], ENV['OFFICE365_APP_SECRET'], :scope => 'https://outlook.office.com/mail.read'
  end

Setup with Devise:

  # Add to your devise.rb

  config.omniauth :office365, ENV['OFFICE365_APP_ID'], ENV['OFFICE365_APP_SECRET'], :scope => 'https://outlook.office.com/mail.read'