Skip to content

Commit

Permalink
Add note about scope/access_token issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffcarbs committed May 21, 2016
1 parent e6ae501 commit 29232bb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ Gem to authenticate applications to the Office365 v2.0 REST API via OAuth2.
* Developer Console: https://apps.dev.microsoft.com/
* Available Scopes: https://msdn.microsoft.com/office/office365/howto/authenticate-office-365-apis-using-v2#bk_Outlookscopes.

**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: https://github.com/intridea/oauth2/pull/243.

## Standard setup:

```ruby
# Add to your initializers/omniauth.rb

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

Expand All @@ -32,5 +34,5 @@ Gem to authenticate applications to the Office365 v2.0 REST API via OAuth2.
```ruby
# Add to your devise.rb

config.omniauth :office365, ENV['OFFICE365_APP_ID'], ENV['OFFICE365_APP_SECRET'], :scope => "profile"
config.omniauth :office365, ENV['OFFICE365_APP_ID'], ENV['OFFICE365_APP_SECRET'], :scope => 'https://outlook.office.com/mail.read'
```
2 changes: 1 addition & 1 deletion example/config.ru
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ require './app.rb'
use Rack::Session::Cookie, :secret => 'abc123'

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

run Sinatra::Application

0 comments on commit 29232bb

Please sign in to comment.