Skip to content

Commit f892fd3

Browse files
author
Frank Kotsianas
committed
Add skip_ssl_validation property when instanciating cf-uaa-lib
- Allow gem to function in envs with self-signed SSL certs - Defaults to false [#105326528] Signed-off-by: Lyle Franklin <[email protected]>
1 parent f30e8cb commit f892fd3

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

lib/omniauth/strategies/cloudfoundry.rb

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class Cloudfoundry
4747
option :token_server_url, nil
4848
option :scope, nil
4949
option :async_calls, false
50+
option :skip_ssl_validation, false
5051

5152
attr_accessor :access_token
5253
attr_reader :token_issuer
@@ -72,10 +73,14 @@ def client
7273
end
7374
end
7475

75-
@token_issuer ||= CF::UAA::TokenIssuer.new(@auth_server_url,
76-
options.client_id,
77-
options.client_secret,
78-
{:token_target => @token_server_url})
76+
@token_issuer ||= CF::UAA::TokenIssuer.new(
77+
@auth_server_url,
78+
options.client_id,
79+
options.client_secret,
80+
{
81+
:token_target => @token_server_url,
82+
:skip_ssl_validation => options.skip_ssl_validation
83+
})
7984
log :info, "Client: #{options.client_id} auth_server: #{@auth_server_url} token_server: #{@token_server_url}"
8085
@token_issuer.logger = OmniAuth.logger
8186
end
@@ -84,7 +89,10 @@ def client
8489
end
8590

8691
def uaa_info
87-
@uaa_info ||= CF::UAA::Info.new(@token_server_url)
92+
@uaa_info ||= CF::UAA::Info.new(
93+
@token_server_url,
94+
:skip_ssl_validation => options.skip_ssl_validation
95+
)
8896
end
8997

9098
def callback_url

lib/omniauth/uaa_oauth2/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313

1414
module OmniAuth
1515
module Cloudfoundry
16-
VERSION = "0.0.5"
16+
VERSION = "0.0.6"
1717
end
1818
end

0 commit comments

Comments
 (0)