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 1 year ago

cc-nishizawa commented 1 year 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 1 year 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