# Office 365 Login?

**URL:** https://meta.discourse.org/t/office-365-login/51579
**Category:** Support
**Created:** [Octobre 15, 2016, 2:57 UTC](https://meta.discourse.org/t/office-365-login/51579 "2016-10-15T02:57:02Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![watchmanmonitor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/watchmanmonitor/32/430970_2.png) [@watchmanmonitor](https://meta.discourse.org/u/watchmanmonitor)
#### Post date: [Octobre 15, 2016, 2:57 UTC](https://meta.discourse.org/t/office-365-login/51579/1 "2016-10-15T02:57:02Z")

</div>

Just like Discourse has built in 3rd party authentication to google, is there a way to offer Office 365 login?

---

<div class="post-metadata">

### Author: ![watchmanmonitor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/watchmanmonitor/32/430970_2.png) [@watchmanmonitor](https://meta.discourse.org/u/watchmanmonitor)
#### Post date: [Octobre 15, 2016, 2:59 UTC](https://meta.discourse.org/t/office-365-login/51579/2 "2016-10-15T02:59:34Z")

</div>

Kinda like [Auth0’s plugin](https://meta.discourse.org/t/auth0-single-sign-on-for-enterprise-and-support-for-20-social-providers/12713/), but only for Office365

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [Octobre 15, 2016, 4:23 UTC](https://meta.discourse.org/t/office-365-login/51579/3 "2016-10-15T04:23:17Z")

</div>

I threw together what I think is necessary, but for the life of me, I can’t figure out where to signup to get an API id and secret key ☹

[https://github.com/cpradio/discourse-plugin-office365-auth](https://github.com/cpradio/discourse-plugin-office365-auth)

If you are feeling adventurous, give it a try. Or if you know where to signup an application and can provide me with said URL, that would be great too.

---

<div class="post-metadata">

### Author: ![scombs](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/scombs/32/48616_2.png) [@scombs](https://meta.discourse.org/u/scombs)
#### Post date: [Octobre 15, 2016, 8:37 UTC](https://meta.discourse.org/t/office-365-login/51579/4 "2016-10-15T08:37:05Z")

</div>

> [@cpradio](#):
>
> if you know where to signup an application and can provide me with said URL, that would be great too

Will this do it? Office 365 login option would be really nice.

[https://dev.outlook.com/appregistration](https://dev.outlook.com/appregistration)

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [Octobre 15, 2016, 10:40 UTC](https://meta.discourse.org/t/office-365-login/51579/5 "2016-10-15T10:40:27Z")

</div>

Cool, I’ll play around with it today/tomorrow to see if I can get this 100% operational. Looks like it is close, but not quite there. 🙂

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [Octobre 16, 2016, 7:20 UTC](https://meta.discourse.org/t/office-365-login/51579/6 "2016-10-16T19:20:12Z")

</div>

I’ve made progress, but I’m getting a credentials error, not 100% sure why  
[https://github.com/cpradio/discourse-plugin-office365-auth/tree/beta](https://github.com/cpradio/discourse-plugin-office365-auth/tree/beta)

Unfortunately, the time I have to spend is a bit limited right now and so I don’t know when I’ll get back to this. If anyone wants to take a shot at the error, here it is and feel free to submit a PR.

```plaintext
Message (3 copies reported)

(microsoft_office365) Authentication failure! invalid_credentials: OAuth2::Error, 
Backtrace

/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/logster-1.2.5/lib/logster/logger.rb:76:in `add_with_opts'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/logster-1.2.5/lib/logster/logger.rb:37:in `add'
/usr/local/lib/ruby/2.3.0/logger.rb:507:in `error'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:158:in `log'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:474:in `fail!'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-oauth2-1.3.1/lib/omniauth/strategies/oauth2.rb:82:in `rescue in callback_phase'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-oauth2-1.3.1/lib/omniauth/strategies/oauth2.rb:71:in `callback_phase'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:227:in `callback_call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:184:in `call!'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:164:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:186:in `call!'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:164:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:186:in `call!'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:164:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:186:in `call!'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:164:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:186:in `call!'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:164:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:186:in `call!'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:164:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:186:in `call!'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:164:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:186:in `call!'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:164:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/omniauth-1.3.1/lib/omniauth/builder.rb:63:in `call'
/var/www/discourse/config/initializers/008-rack-cors.rb:15:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-1.6.4/lib/rack/conditionalget.rb:25:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-1.6.4/lib/rack/head.rb:13:in `call'
/var/www/discourse/lib/middleware/anonymous_cache.rb:127:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/flash.rb:260:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-1.6.4/lib/rack/session/abstract/id.rb:225:in `context'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-1.6.4/lib/rack/session/abstract/id.rb:220:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/cookies.rb:560:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/query_cache.rb:36:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.7.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:88:in ` __run_callbacks__'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/callbacks.rb:81:in `run_callbacks'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/logster-1.2.5/lib/logster/middleware/reporter.rb:31:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/railties-4.2.7.1/lib/rails/rack/logger.rb:38:in `call_app'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/railties-4.2.7.1/lib/rails/rack/logger.rb:22:in `call'
/var/www/discourse/config/initializers/100-quiet_logger.rb:13:in `call_with_quiet_assets'
/var/www/discourse/config/initializers/100-silence_logger.rb:26:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/request_id.rb:21:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-1.6.4/lib/rack/methodoverride.rb:22:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-1.6.4/lib/rack/runtime.rb:18:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-1.6.4/lib/rack/sendfile.rb:113:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-mini-profiler-0.10.1/lib/mini_profiler/profiler.rb:171:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/message_bus-2.0.2/lib/message_bus/rack/middleware.rb:62:in `call'
/var/www/discourse/lib/middleware/request_tracker.rb:73:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/railties-4.2.7.1/lib/rails/engine.rb:518:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/railties-4.2.7.1/lib/rails/application.rb:165:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/railties-4.2.7.1/lib/rails/railtie.rb:194:in `public_send'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/railties-4.2.7.1/lib/rails/railtie.rb:194:in `method_missing'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-1.6.4/lib/rack/urlmap.rb:66:in `block in call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-1.6.4/lib/rack/urlmap.rb:50:in `each'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/rack-1.6.4/lib/rack/urlmap.rb:50:in `call'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:562:in `process_client'
/var/www/discourse/lib/scheduler/defer.rb:85:in `process_client'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:658:in `worker_loop'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:508:in `spawn_missing_workers'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/unicorn-5.1.0/lib/unicorn/http_server.rb:132:in `start'
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/unicorn-5.1.0/bin/unicorn:126:in `<top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.3.0/bin/unicorn:23:in `load'
/var/www/discourse/vendor/bundle/ruby/2.3.0/bin/unicorn:23:in `<main>'
Env

hostname	ubuntu-app
process_id	[322, 9341, 16374]
application_version	[2dfc0ddf8104b7374846add8b5e9a6ac0acb913b, 6aa2e49be9a3dc81548b474968c12ff3afa1132c]
HTTP_HOST	sandbox.cpradio.org
REQUEST_URI	[/auth/microsoft_office365/callback?code=redacted&state=redacted, /auth/microsoft_office365/callback?code=redacted&state=redacted, /auth/microsoft_office365/callback?code=redacted&state=redacted]
REQUEST_METHOD	GET
HTTP_USER_AGENT	Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36
HTTP_ACCEPT	text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
HTTP_REFERER	[https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=redacted&redirect_uri=https%3A%2F%2Fsandbox.cpradio.org%2Fauth%2Fmicrosoft_office365%2Fcallback&response_type=code&scope=openid+email+profile+https%3A%2F%2Foutlook.office.com%2Fcontacts.read&state=redacted, https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=redacted&redirect_uri=https%3A%2F%2Fsandbox.cpradio.org%2Fauth%2Fmicrosoft_office365%2Fcallback&response_type=code&scope=openid+email+profile+https%3A%2F%2Foutlook.office.com%2Fcontacts.read&state=redacted, https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=redacted&redirect_uri=https%3A%2F%2Fsandbox.cpradio.org%2Fauth%2Fmicrosoft_office365%2Fcallback&response_type=code&scope=openid+email+profile+https%3A%2F%2Foutlook.office.com%2Fcontacts.read&state=redacted]
HTTP_X_FORWARDED_FOR	redacted
HTTP_X_REAL_IP	redacted
params	
code	[redacted]
state	[redacted]

```

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [Octobre 19, 2016, 4:32 UTC](https://meta.discourse.org/t/office-365-login/51579/7 "2016-10-19T04:32:51Z")

</div>

Okay, I think I have this working. More later today, but for now I need sleep 🙂

---

<div class="post-metadata">

### Author: ![watchmanmonitor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/watchmanmonitor/32/430970_2.png) [@watchmanmonitor](https://meta.discourse.org/u/watchmanmonitor)
#### Post date: [Octobre 19, 2016, 4:33 UTC](https://meta.discourse.org/t/office-365-login/51579/8 "2016-10-19T04:33:51Z")

</div>

> I think I have this working.

Bravo! 👏

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [Octobre 19, 2016, 10:28 UTC](https://meta.discourse.org/t/office-365-login/51579/9 "2016-10-19T10:28:24Z")

</div>

Instructions posted at

> [@Microsoft Authentication](https://meta.discourse.org/t/office365-oauth2-plugin/51731):
>
> discourse Hosted by us? This plugin is available on our Business and Enterprise plans. [Amazon & Microsoft Logins | Discourse - Civilized Discussion](https://www.discourse.org/plugins/amazon-microsoft-login.html)discourse2Summary Enable users to log in using their Microsoft accounts (aka Office 365 or Microsoft 365 accounts)open_bookInstall Guide This plugin is bundled with Discourse core. There is no need to install the plugin separately. Summary Microsoft Authentication enables users to log in to your Discourse forum using t…

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [Octobre 19, 2016, 1:25 UTC](https://meta.discourse.org/t/office-365-login/51579/10 "2016-10-19T13:25:21Z")

</div>


