CORS issues with google's OAuth | Devise conflict issue? #17
-
As a bit of context, I'm hooking up a React CSR frontend to an already existing Rails app. Right now Devise is installed and I'm afraid it could be conflicting with rodauth, specially with the omniauth integration.
It only works properly when setting I've pretty much tried a lot of what has been discussed on this omniauth issue, might this be a conflict issue with Devise? Right now it is not configured to use omniauth. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
It doesn't seem like a Devise issue, but Devise does add Warden into the middleware stack, possibly in front of the Rodauth middleware, and maybe that's messing with the OmniAuth integration. The easiest way is to try temporarily removing Devise and seeing if the OmniAuth flow works. I suspect there is something that's resetting the session in between request and callback OmniAuth phases. The request phase for OAuth2-based strategies sets "state" in the session and authorize params, which will then get included in the callback URL the strategy redirects to, and the callback phase checks whether the session value corresponds to the value in query string. If they mismatch, this error is raised. |
Beta Was this translation helpful? Give feedback.
-
Issues were related to default csrf checks in place as default for my Rails app. I believe this issues aren't present on Rails in API mode. Setting |
Beta Was this translation helpful? Give feedback.
Issues were related to default csrf checks in place as default for my Rails app. I believe this issues aren't present on Rails in API mode. Setting
check_csrf? false
solved my issues, hoping a proper CORS config with rack-cors should properly limit access to resources.