# File lib/fog/brightbox/compute/shared.rb, line 25
        def initialize(config)
          if config.respond_to?(:config_service?) && config.config_service?
            @config = config
          else
            @config = Fog::Brightbox::Config.new(config)
          end
          @config = Fog::Brightbox::Compute::Config.new(@config)

          # Currently authentication and api endpoints are the same but may change
          @auth_url            = @config.auth_url.to_s
          @auth_connection     = Fog::Core::Connection.new(@auth_url)

          @api_url             = @config.compute_url.to_s
          @connection_options  = @config.connection_options
          @persistent          = @config.connection_persistent?
          @connection          = Fog::Core::Connection.new(@api_url, @persistent, @connection_options)

          # Authentication options
          client_id            = @config.client_id
          client_secret        = @config.client_secret

          username             = @config.username
          password             = @config.password
          @configured_account  = @config.account
          # Request account can be changed at anytime and changes behaviour of future requests
          @scoped_account      = @configured_account

          credential_options   = { :username => username, :password => password }
          @credentials         = CredentialSet.new(client_id, client_secret, credential_options)

          # If existing tokens have been cached, allow continued use of them in the service
          @credentials.update_tokens(@config.cached_access_token, @config.cached_refresh_token)

          @token_management    = @config.managed_tokens?
        end