# OAuth2 integration with Drupal

**URL:** https://meta.discourse.org/t/oauth2-integration-with-drupal/43652
**Category:** SSO
**Tags:** oauth2
**Created:** [May 4, 2016, 4:08am UTC](https://meta.discourse.org/t/oauth2-integration-with-drupal/43652 "2016-05-04T04:08:47Z")
**Posts on this page:** 11
**Page:** 2

<div class="post-metadata">

### Author: ![dashohoxha](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dashohoxha/32/116008_2.png) [@dashohoxha](https://meta.discourse.org/u/dashohoxha)
#### Post date: [May 6, 2016, 6:07am UTC](https://meta.discourse.org/t/oauth2-integration-with-drupal/43652/21 "2016-05-06T06:07:29Z")

</div>

> [@tarek](#):
>
> I tried this and could not get it to work, neither in my own REST client, nor in your b-translator, as dataType will always default to json (I tried ‘xml’, for example).

Maybe you did not clear the cache in Drupal, and maybe the javascript client is smarter than we think (it handles the data type conversions behind the scenes). Anyway this doesn’t matter.

---

<div class="post-metadata">

### Author: ![tarek](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tarek/32/124831_2.png) [@tarek](https://meta.discourse.org/u/tarek)
#### Post date: [May 6, 2016, 6:08am UTC](https://meta.discourse.org/t/oauth2-integration-with-drupal/43652/22 "2016-05-06T06:08:43Z")

</div>

Indeed. Thank you again so much for all your help! You made this possible!!!

tarek : )

---

<div class="post-metadata">

### Author: ![Markus\_Heckmann](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markus_heckmann/32/68007_2.png) [@Markus\_Heckmann](https://meta.discourse.org/u/Markus_Heckmann)
#### Post date: [March 18, 2017, 6:20am UTC](https://meta.discourse.org/t/oauth2-integration-with-drupal/43652/23 "2017-03-18T06:20:47Z")

</div>

Hello,

when hitting the with OAuth2 button in discourse, my drupal comes back with a 404 not found on [https://mysite/oauth2/authorize](https://mysite/oauth2/authorize)

This is after I added the client in Drupal.

Is there any hint where or what I should check to resolve this?

Thanks so much  
Markus

---

<div class="post-metadata">

### Author: ![Markus\_Heckmann](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markus_heckmann/32/68007_2.png) [@Markus\_Heckmann](https://meta.discourse.org/u/Markus_Heckmann)
#### Post date: [March 25, 2017, 11:08pm UTC](https://meta.discourse.org/t/oauth2-integration-with-drupal/43652/24 "2017-03-25T23:08:54Z")

</div>

Figured it out: Clean URLs was not enabled on the Drupal side.

Cheers  
Markus

---

<div class="post-metadata">

### Author: ![Gilberto\_Mangones](https://avatars.discourse-cdn.com/v4/letter/g/ccd318/32.png) [@Gilberto\_Mangones](https://meta.discourse.org/u/Gilberto_Mangones)
#### Post date: [June 28, 2017, 4:30am UTC](https://meta.discourse.org/t/oauth2-integration-with-drupal/43652/25 "2017-06-28T04:30:57Z")

</div>

Hi there, I installed everything but how can I do a testing in Drupal 7? Do you have a step by step? using postman, webservice, login drupal.

thanks.

---

<div class="post-metadata">

### Author: ![coognation.net](https://avatars.discourse-cdn.com/v4/letter/c/ccd318/32.png) [@coognation.net](https://meta.discourse.org/u/coognation.net)
#### Post date: [August 3, 2017, 11:58pm UTC](https://meta.discourse.org/t/oauth2-integration-with-drupal/43652/26 "2017-08-03T23:58:25Z")

</div>

> [@tarek](#):
>
> KNOWN ISSUES:
> 
> Must be authorized with each login.  
> Does not honour ‘groups’ / ‘roles’

I don’t understand this part. So when they are logged into Drupal roles get ignored? I don’t see how that is possible.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [August 4, 2017, 12:18pm UTC](https://meta.discourse.org/t/oauth2-integration-with-drupal/43652/27 "2017-08-04T12:18:36Z")

</div>

It takes extra steps to have roles and groups passed via SSO. By default SSO just handles authentication. You can then assign roles and groups by hand in Discourse.

---

<div class="post-metadata">

### Author: ![coognation.net](https://avatars.discourse-cdn.com/v4/letter/c/ccd318/32.png) [@coognation.net](https://meta.discourse.org/u/coognation.net)
#### Post date: [August 23, 2017, 4:46am UTC](https://meta.discourse.org/t/oauth2-integration-with-drupal/43652/28 "2017-08-23T04:46:31Z")

</div>

> [@pfaffman](#):
>
> It takes extra steps to have roles and groups passed via SSO. By default SSO just handles authentication. You can then assign roles and groups by hand in Discourse.

I want it to go the other way. I have a Drupal tool coming online that I want all Discourse members to be able to access without having to create another login. I don’t need roles in Discourse, but do in Drupal. Make sense?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [August 23, 2017, 11:43am UTC](https://meta.discourse.org/t/oauth2-integration-with-drupal/43652/29 "2017-08-23T11:43:36Z")

</div>

If Drupal is the SSO master and you don’t care about groups in discourse, you should have no problem.

---

<div class="post-metadata">

### Author: ![coognation.net](https://avatars.discourse-cdn.com/v4/letter/c/ccd318/32.png) [@coognation.net](https://meta.discourse.org/u/coognation.net)
#### Post date: [August 23, 2017, 11:08pm UTC](https://meta.discourse.org/t/oauth2-integration-with-drupal/43652/30 "2017-08-23T23:08:53Z")

</div>

> [@pfaffman](#):
>
> If Drupal is the SSO master and you don’t care about groups in discourse, you should have no problem.

Thanks Jay for the info!

---

<div class="post-metadata">

### Author: ![volanar](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/volanar/32/318163_2.png) [@volanar](https://meta.discourse.org/u/volanar)
#### Post date: [December 18, 2023, 8:41pm UTC](https://meta.discourse.org/t/oauth2-integration-with-drupal/43652/31 "2023-12-18T20:41:05Z")

</div>

[https://github.com/thinkshout/discourse](https://github.com/thinkshout/discourse)

[Previous page](https://meta.discourse.org/t/oauth2-integration-with-drupal/43652.md?page=1)
