Skip to content

Commit

Permalink
Fixes #28196 - handle empty params for codegrant flow (#456)
Browse files Browse the repository at this point in the history
(cherry picked from commit 8953595)
  • Loading branch information
rabajaj0509 authored and shiramax committed Nov 25, 2019
1 parent c5bc0ee commit beef521
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/hammer_cli_foreman/api/oauth/authentication_code_grant.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ def set_token(input_oidc_token_endpoint, input_oidc_authorization_endpoint, inpu
@oidc_client_id = input_oidc_client_id if input_oidc_client_id
@oidc_redirect_uri = input_oidc_redirect_uri if input_oidc_redirect_uri

if @oidc_client_id && @oidc_authorization_endpoint && @oidc_redirect_uri && @oidc_token_endpoint
if @oidc_client_id.to_s.empty? || @oidc_authorization_endpoint.to_s.empty? || @oidc_redirect_uri.to_s.empty? || @oidc_token_endpoint.to_s.empty?
@token = nil
else
get_code
@token = HammerCLIForeman::OpenidConnect.new(
@oidc_token_endpoint, @oidc_client_id).get_token_via_2fa(@code, @oidc_redirect_uri)
else
@token = nil
end
end

Expand Down

0 comments on commit beef521

Please sign in to comment.