Skip to content

omniauth v2 support#5

Open
ssaveleva-workato wants to merge 1 commit intowrike-api-v4-support-v2from
feature/omniauth-v2-support
Open

omniauth v2 support#5
ssaveleva-workato wants to merge 1 commit intowrike-api-v4-support-v2from
feature/omniauth-v2-support

Conversation

@ssaveleva-workato
Copy link
Copy Markdown

@ssaveleva-workato ssaveleva-workato commented Apr 27, 2023

TL;DR

added some options to support omniauth v2.
changes are compatible with omniauth v1.9.

Changes detail

there were 2 problems:

  1. Wrike requires client_id and client_secret to be passed as parameters when receiving a token https://developers.wrike.com/oauth-20-authorization/
POST https://login.wrike.com/oauth2/token
//Parameters:
client_id=<client_id>
client_secret=<client_secret>
grant_type=authorization_code
code=<authorization_code>

but in oauth2 v2 the headers are used by default.
auth_scheme: :request_body fixes this.

  1. redirect_uri is passed with parameters and it doesn't work. Here's a similar issue: When calling /auth/:identity/callback.json , request.env["omniauth.auth"] is nil omniauth/omniauth#618

the fix is to redefine callback_url not to add query_string by default. as it was made in omniauth-google-oauth2: https://github.com/zquestz/omniauth-google-oauth2/blob/v1.1.1/lib/omniauth/strategies/google_oauth2.rb#L116

@ssaveleva-workato ssaveleva-workato force-pushed the feature/omniauth-v2-support branch from 19bc3fd to dea0058 Compare April 27, 2023 13:00
@ssaveleva-workato ssaveleva-workato marked this pull request as ready for review April 27, 2023 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants