Open hhorikawa opened 2 years ago
I have investigated this problem.
The omniauth/omniauth_openid_connect
repository version accepts only code
and id_token
as response_type
.
In the Implicit flow, the id_token
makes the IdP return only the id_token as the authentication response. It works correctly only with some IdPs that return it extended from the specification.
For example, Azure AD adds additional fields that identify the user, such as an email address.
However, Yahoo JAPAN, which strictly meets the specifications, does return only minimal fields as the authentication response, and the client must request the user information using the access token.
For such IdPs, you must specify ['id_token', 'token']
as the response_type
. So, omniauth/omniauth_openid_connect
should be able to accept it as the response_type
.
I'd probably argue that you shouldn't support implicit flow, as it's largely considered insecure and outdated: https://www.ietf.org/archive/id/draft-ietf-oauth-security-topics-24.html#name-implicit-grant
Test sample application: https://gitlab.com/netsphere/rails-omniauth-oidc-rp-sample/ Ruby 3.0, Rails 6.1, OmniAuth 2.0 The Code Flow is OK. But the Implicit Flow does not seem to work. I'll investigate the cause.