-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for response_type id_token #32
Add support for response_type id_token #32
Conversation
bc14543
to
9baa88f
Compare
9baa88f
to
abd39bb
Compare
I didn't have a chance and I won't test the |
This looks like a minor version update, new feature, backwards compatible. |
Hmm we need to return from the client.authorization_code = authorization_code
access_token
super Maybe with: return something unless options.response_type.to_s == 'code' And for Implicit Grant, def callback_phase
env['omniauth.auth'] = auth_hash
call_app!
end
# =>
def auth_hash
hash = AuthHash.new(:provider => name, :uid => uid)
hash.info = info unless skip_info?
hash.credentials = credentials if credentials
hash.extra = extra if extra
hash
end so we need to deal with quite a few things, like def user_info
@user_info ||= access_token.userinfo!
end (define |
a820949
to
240c512
Compare
240c512
to
9664f59
Compare
b9ff815
to
6016671
Compare
6016671
to
ad7f075
Compare
21612b3
to
caea409
Compare
caea409
to
8e94418
Compare
It doesn't work when undefined method `[]' for nil:NilClass
NoMethodError (undefined method `[]' for nil:NilClass):
gems/ruby-2.3.8/bundler/gems/omniauth_openid_connect-3f52ccda27ba/lib/omniauth/strategies/openid_connect.rb:319:in `valid_response_type?'
gems/ruby-2.3.8/bundler/gems/omniauth_openid_connect-3f52ccda27ba/lib/omniauth/strategies/openid_connect.rb:117:in `callback_phase'
omniauth (1.9.0) lib/omniauth/strategy.rb:238:in `callback_call' |
That's weird that this change was needed. |
it didn't work with |
Before this change, only
Not really, we were ignoring unknown types.
Will check, thanks! |
Changes requested in the code review did not include handling both symbol and string version of the exception key for invalid response_type param, here:
|
@krzysiek1507 @Eric-Guo try this: #35 , support for both symbol and string was lost during the code review phase for this PR. |
But it worked well! I need it so let me try to implement it. |
make sure you're on latest |
Now another error:
|
To fix |
Current implementation will always trigger the
failure
action in the client for the Implicit grant. It's because we callOmniauth::Strategy
.fail!
method if parametercode
is missing.Resolves: #31
For the Implicit grant, the
id_token
or bothid_token
andaccess_token
may be returned.NOTICE: when
response_type
is set totoken
, thenaccess_token
parameter is used (Bearer token).A much simpler implementation to handle just the 2 cases,
code
orid_token
could look like:Let me know which option would you prefer to start with