# Support for specifying a custom scope

**URL:** https://meta.discourse.org/t/support-for-specifying-a-custom-scope/90603
**Category:** SSO
**Tags:** oauth2
**Created:** [25.Май.2018 21:47:15 UTC](https://meta.discourse.org/t/support-for-specifying-a-custom-scope/90603 "2018-05-25T21:47:15Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [25.Май.2018 21:47:15 UTC](https://meta.discourse.org/t/support-for-specifying-a-custom-scope/90603/1 "2018-05-25T21:47:15Z")

</div>

Since several people have had issues with OAuth2 providers requring a specific ‘scope’ value:

> [@Discourse OAuth2 Basic](https://meta.discourse.org/t/discourse-oauth2-basic/33879/132):
>
> I ran into a lot of issues as it required the `scope` to be set to `profile` .

> [@Discourse OAuth2 Basic](https://meta.discourse.org/t/discourse-oauth2-basic/33879/115):
>
> In fact, no scope has been requested by them at all, they need to make sure they ask for at least the “basic” scope."

[https://twitter.com/jmccartie/status/997557366416592896](https://twitter.com/jmccartie/status/997557366416592896)

I went ahead and added support for specifying a custom scope:

[https://github.com/discourse/discourse-oauth2-basic/commit/04ef6494de4f1e0d7f34680c1ddf9bfe4cef8f0a](https://github.com/discourse/discourse-oauth2-basic/commit/04ef6494de4f1e0d7f34680c1ddf9bfe4cef8f0a)

All you need to do now is specify the scope you want to use in the “oauth2 scope” site setting field.

Enjoy!

---

<div class="post-metadata">

### Author: ![kueda](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kueda/32/130762_2.png) [@kueda](https://meta.discourse.org/u/kueda)
#### Post date: [15.Февраль.2019 19:26:07 UTC](https://meta.discourse.org/t/support-for-specifying-a-custom-scope/90603/2 "2019-02-15T19:26:07Z")

</div>

How is this scope being sent? I was expecting it to be a GET param, e.g. [https://www.myserver.org/path/to/authorize?client\_id=CLIENT\_ID&redirect\_uri=REDIRECT\_URI&response\_type=code&state=STATE\_ID&scope=login](https://www.myserver.org/path/to/authorize?client_id=CLIENT_ID&redirect_uri=REDIRECT_URI&response_type=code&state=STATE_ID&scope=login), but after setting what seems like the right configs…

 ![31%20AM](https://global.discourse-cdn.com/meta/original/3X/b/c/bca8cf01d7200067c090fdd8fefa94830519c913.png)

… I don’t see the scope param getting included in the `oauth2 authorize url` when users click the OAuth login button.

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [19.Февраль.2019 17:48:58 UTC](https://meta.discourse.org/t/support-for-specifying-a-custom-scope/90603/3 "2019-02-19T17:48:58Z")

</div>

Try resetting `oauth2 authorize options` to the default (“scope”), and then set `oauth2 scope` to `login`.

---

<div class="post-metadata">

### Author: ![kueda](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kueda/32/130762_2.png) [@kueda](https://meta.discourse.org/u/kueda)
#### Post date: [20.Февраль.2019 22:15:22 UTC](https://meta.discourse.org/t/support-for-specifying-a-custom-scope/90603/4 "2019-02-20T22:15:22Z")

</div>

Thanks, that did it! Figured I was confused about something.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [18.Март.2022 20:37:58 UTC](https://meta.discourse.org/t/support-for-specifying-a-custom-scope/90603/5 "2022-03-18T20:37:58Z")

</div>


