Skip to content

Google Oauth assertion failing? #38

@waclock

Description

@waclock

Hello,

I'm having trouble setting up grants_assertion with google. I've setup doorkeeper and currently have a react-native app that is getting an idToken, accessToken and code. This is doing so, by using a specific iOS Client ID.

I'm then sending the idToken as the assertion to be checked by doorkeeper, like so:

Doorkeeper.configure do
  resource_owner_from_assertion do
    if server.client && params[:provider] && params[:assertion]
      auth = Doorkeeper::GrantsAssertion::Devise::OmniAuth.auth_hash(
        provider: params.fetch(:provider),
        assertion: params.fetch(:assertion)
      )
      User.where(email: auth.info.email).first if auth
    end
  end
  # add your supported grant types and other extensions
  grant_flows %w(assertion authorization_code implicit password client_credentials)
end

I've setup as my env variables in rails a specific Client ID and client secret for my rails server. However, every time I try validating the passed assertion, I get the following error:

{
  "error_description": "Invalid Value"
}

I've tried passing the idToken, accessToken and also directly calling Doorkeeper::GrantsAssertion::OmniAuth.oauth2_wrapper with different combinations of client_id and client_secret, but unfortunately nothing has worked so far.
I'm using rails 7 and ruby 3. Is this library still working with Google Oauth? Any help would be appreciated, thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions