Sage / omniauth-cognito-idp

OmniAuth Strategy for AWS Cognito in Ruby
Apache License 2.0
35 stars 13 forks source link

Unable to get id_token when OAuth2 v2.0.6 #10

Open cc-nishizawa opened 2 years ago

cc-nishizawa commented 2 years ago

A nil is returned at the following location. https://github.com/Sage/omniauth-cognito-idp/blob/v0.1.1/lib/omniauth/strategies/cognito_idp.rb#L76

When I did this, it worked correctly.

      def id_token
        access_token.response.parsed['id_token']
      end
lucasluitjes commented 2 years ago

Can confirm. Using the following monkeypatch for now, based on your comment:

module OmniAuth
  module Strategies
    class CognitoIdP < OmniAuth::Strategies::OAuth2
      def id_token
        access_token.response.parsed['id_token']
      end
    end
  end
end