# OmniAuth/Devise for RoR app -- 404 Bad Request/The requested feature is not enabled in this environment

**URL:** <https://devforum.okta.com/t/omniauth-devise-for-ror-app-404-bad-request-the-requested-feature-is-not-enabled-in-this-environment/5458>\
**Category:** Questions\
**Created:** [June 20, 2019, 4:38pm UTC](https://devforum.okta.com/t/omniauth-devise-for-ror-app-404-bad-request-the-requested-feature-is-not-enabled-in-this-environment/5458 "2019-06-20T16:38:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![llamapajama](https://avatars.discourse-cdn.com/v4/letter/l/5daacb/32.png) [@llamapajama](https://devforum.okta.com/u/llamapajama)\
**Post date:** [June 20, 2019, 4:38pm UTC](https://devforum.okta.com/t/omniauth-devise-for-ror-app-404-bad-request-the-requested-feature-is-not-enabled-in-this-environment/5458/1 "2019-06-20T16:38:13Z")

</div>

Trying to follow the [tutorial in the blog](https://developer.okta.com/blog/2018/09/18/simple-authentication-with-rails-and-omniauth) for Devise and Omniauth, stuck trying to “Sign In With Oktaoauth”. Need a nudge, please.

We’re using a trial account. Configured an application that looks like this:

 ![image](https://global.discourse-cdn.com/oktadev/original/2X/e/e3cdd31781874e663d9fee6e8d6de76abe363e03.png)

Set up the RoR controllers to match how the source for the tutorial looks. The config params are:

 ![image](https://global.discourse-cdn.com/oktadev/original/2X/c/c55dae5521bd696e783333f1e6930b042bd3e6aa.png)

The app appears to be functional, and the default Devise login looks like this:

![image](https://global.discourse-cdn.com/oktadev/original/2X/6/6ac966d1a424ca375c8b2ba819e71954f2010163.png)

When the link at the bottom is clicked ( **Sign in with oktaoath** ), things go poorly:

![image](https://global.discourse-cdn.com/oktadev/original/2X/9/958a8135abe911373d48377e06ee103a01bb74e0.png)

The url being accessed is:

[https://vitacvps.okta.com/oauth2/default/v1/authorize?client\_id=0oaqz35k9uiFEQmB6356&redirect\_uri=http%3A%2F%2Fme%3A5000%2Fuser%2Fauth%2Foktaoauth%2Fcallback&response\_type=code&scope=openid+profile+email&state=c707a0177be1d2b6aa9deed02ff949adb51e38a3a1817401](https://vitacvps.okta.com/oauth2/default/v1/authorize?client_id=0oaqz35k9uiFEQmB6356&redirect_uri=http%3A%2F%2Fme%3A5000%2Fuser%2Fauth%2Foktaoauth%2Fcallback&response_type=code&scope=openid+profile+email&state=c707a0177be1d2b6aa9deed02ff949adb51e38a3a1817401)

In reading other posts, it appears that whitelisting may be an issue. So I tried to follow the suggestions there:

![image](https://global.discourse-cdn.com/oktadev/original/2X/f/fb7cba84b6def55917cd5f38eef17cc3144205ac.png)

Also, it appeared that removing “oauth2/default” from the ISSUER url helped some people, but it didn’t work for us.

Any insights would be appreciated.

---

<div class="post-metadata">

**Author:** ![dragos](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/dragos/32/1313_2.png) [@dragos](https://devforum.okta.com/u/dragos)\
**Post date:** [June 21, 2019, 8:27am UTC](https://devforum.okta.com/t/omniauth-devise-for-ror-app-404-bad-request-the-requested-feature-is-not-enabled-in-this-environment/5458/2 "2019-06-21T08:27:18Z")

</div>

Hi @llamapajama

The issue here is that [API Access Management](https://developer.okta.com/docs/concepts/api-access-management/) is not enabled on your Okta org. This paid feature gives you the possibility to create custom authorization servers, as mentioned [here](https://support.okta.com/help/s/article/Difference-Between-Okta-as-An-Authorization-Server-vs-Custom-Authorization-Server).

If you would like to use the free alternative, the best option would be to use the Okta authorization server, which has the issuer `http://vitacvps.okta.com` and the configuration file available at `https://vitacvps.okta.com/.well-known/openid-configuration`.

Saying this, the URL for authorization would look like

[https://vitacvps.okta.com/oauth2/v1/authorize?client\_id=0oaqz35k9uiFEQmB6356&redirect\_uri=http%3A%2F%2Fme%3A5000%2Fuser%2Fauth%2Foktaoauth%2Fcallback&response\_type=code&scope=openid+profile+email&state=c707a0177be1d2b6aa9deed02ff949adb51e38a3a1817401](https://vitacvps.okta.com/oauth2/v1/authorize?client_id=0oaqz35k9uiFEQmB6356&redirect_uri=http%3A%2F%2Fme%3A5000%2Fuser%2Fauth%2Foktaoauth%2Fcallback&response_type=code&scope=openid+profile+email&state=c707a0177be1d2b6aa9deed02ff949adb51e38a3a1817401)

From what I can see, an error occurs on this link, mentioning that the redirect\_uri is not whitelisted. In the URL, you have redirect\_uri set to

`http://me:5000/user/auth/oktaoauth/callback`

while in the openid application you have it set to

`http://me:5000/users/auth/oktaoauth/callback/`

Would it be possible to match the URLs and try again?

---

<div class="post-metadata">

**Author:** ![llamapajama](https://avatars.discourse-cdn.com/v4/letter/l/5daacb/32.png) [@llamapajama](https://devforum.okta.com/u/llamapajama)\
**Post date:** [June 21, 2019, 6:34pm UTC](https://devforum.okta.com/t/omniauth-devise-for-ror-app-404-bad-request-the-requested-feature-is-not-enabled-in-this-environment/5458/3 "2019-06-21T18:34:41Z")

</div>

Thank you very much for the response. It’s very clear and straight forward.

I just hung up with your support team. Just in case anybody follows this same path, the problem was _exactly_ the one you mention above: I had the wrong type of evaluation account. I had a workforce automation trial, and wanted a developer trial. The developer trial can be had [here](https://developer.okta.com/).

Also, thanks for pointing out my “s” in the url. I did so many tests and re-tests that I’m sure I got sloppy someplace along the line. Thanks again.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/oktadev/original/1X/589c4c5f80de422d01f47cee7185a7fb8227835c.png) [@system](https://devforum.okta.com/u/system)\
**Post date:** [January 17, 2024, 11:42pm UTC](https://devforum.okta.com/t/omniauth-devise-for-ror-app-404-bad-request-the-requested-feature-is-not-enabled-in-this-environment/5458/4 "2024-01-17T23:42:41Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
