Class: Bosh::Director::Api::UAAIdentityProvider
- Defined in:
- lib/bosh/director/api/uaa_identity_provider.rb
Instance Method Summary collapse
- #client_info ⇒ Object
- #corroborate_user(request_env) ⇒ Object
-
#initialize(options) ⇒ UAAIdentityProvider
constructor
A new instance of UAAIdentityProvider.
Constructor Details
#initialize(options) ⇒ UAAIdentityProvider
Returns a new instance of UAAIdentityProvider.
7 8 9 10 11 |
# File 'lib/bosh/director/api/uaa_identity_provider.rb', line 7 def initialize() @url = .fetch('url') Config.logger.debug "Initializing UAA Identity provider with url #{@url}" @token_coder = CF::UAA::TokenCoder.new(skey: .fetch('key'), audience_ids: ['bosh_cli']) end |
Instance Method Details
#client_info ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/bosh/director/api/uaa_identity_provider.rb', line 13 def client_info { 'type' => 'uaa', 'options' => { 'url' => @url } } end |
#corroborate_user(request_env) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/bosh/director/api/uaa_identity_provider.rb', line 22 def corroborate_user(request_env) auth_header = request_env['HTTP_AUTHORIZATION'] token = @token_coder.decode(auth_header) token['user_name'] rescue CF::UAA::DecodeError, CF::UAA::AuthError => e raise AuthenticationError, e. end |