# OAuth2 and Microsoft ADFS

**URL:** <https://meta.discourse.org/t/oauth2-and-microsoft-adfs/103357>\
**Category:** Product Support\
**Created:** [3 בדצמבר,‏ 2018,‏ 2:49pm UTC](https://meta.discourse.org/t/oauth2-and-microsoft-adfs/103357 "2018-12-03T14:49:42Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![andyjanes](https://avatars.discourse-cdn.com/v4/letter/a/dc4da7/32.png) [@andyjanes](https://meta.discourse.org/u/andyjanes)\
**Post date:** [3 בדצמבר,‏ 2018,‏ 4:25pm UTC](https://meta.discourse.org/t/oauth2-and-microsoft-adfs/103357/4 "2018-12-03T16:25:58Z")

</div>

Hi David,

Firstly, thanks for the quick response!

I have removed the Oauth-basic plugin and installed the OpenID as suggested and it certainly got a lot further than the OAuth one did in a single step! I am getting an error when trying to login which you may be able to advise on? I’m using my own domain account so I know that the creds are correct.

From shared/standalone/log/rails/production.log

```plaintext
(oidc) Setup endpoint detected, running now.
(oidc) Request phase initiated.
Started GET "/auth/oidc/callback?code=t43rNvqNsk2lyQV91F0QOg.YqkNMDtZ1ghkACQIgPZC7OK5dB4.QFwAW_4H9PkcvkZF2Oe6AU9fb7R_JnbFxia5ozlYs6qr6AJfHvLkkgOV9ConwoffwHeRf53AqXvBz5yfIb4TNBW0TWOPZJamS7yXti13hj-f0u_UQgCAMXHOYzCp4kQBH_PwUI9uvxYNU5Igc3pLiF2VaVHVtvAbrBUzPydPZ9eMbr3g-sbZPbPXb4BSnB9wgWHwpZBn3qjwBppBC7BsluC2snqQDiwNtG6t19PgcK51dpePEfAkSiKNISyxJTOj3X27H8wdAXe81sDeyrmSbcm2RROuc4vCKMgUQSY6AcK6wC_hUhZOnP-loHRGVYo0CmhX8FqS4GsQtCtxsRP89g&state=65c967333cc12c178a89d613adb02195013eabe86a047603" for 127.0.0.1 at 2018-12-03 16:20:06 +0000
(oidc) Setup endpoint detected, running now.
(oidc) Callback phase initiated.
(oidc) Authentication failure! invalid_credentials: OAuth2::Error, 
Started GET "/auth/failure?message=invalid_credentials&origin=https%3A%2F%2F<ADFS_FQDN>%2Flogin&strategy=oidc" for 127.0.0.1 at 2018-12-03 16:20:06 +0000
Processing by Users::OmniauthCallbacksController#failure as HTML
  Parameters: {"message"=>"invalid_credentials", "origin"=>"https://<Discourse_FQDN>/login", "strategy"=>"oidc"}
  Rendering users/omniauth_callbacks/failure.html.erb within layouts/no_ember
  Rendered users/omniauth_callbacks/failure.html.erb within layouts/no_ember (0.6ms)
  Rendered layouts/_head.html.erb (6.0ms)
  Rendered common/_discourse_stylesheet.html.erb (41.1ms)
  Rendered application/_header.html.erb (0.7ms)
Completed 200 OK in 65ms (Views: 44.1ms | ActiveRecord: 12.0ms)

```

If this thread should be posted elsewhere please let me know ;o)

Many thanks

Andy

---

_[View the full topic](https://meta.discourse.org/t/oauth2-and-microsoft-adfs/103357)._
