Sha256: 611dddba4cb2bcbeb3c577ad80b928f6697d13d327ab0907c38e7329d20331fd

Contents?: true

Size: 1003 Bytes

Versions: 4

Compression:

Stored size: 1003 Bytes

Contents

require_relative 'bamboo_url.rb'
require_relative 'base_auth_url.rb'

# URL for getting initial authorization from Bamboo.
#
# If user authorizes access to their Bamboo account, we get back
# an authorization code code which is then fed to OauthTokenUrl for getting
# the OAuth access token.
#
module BambooId
  module Urls
    class AuthUrl
      include BambooUrl
      include BaseAuthUrl

      def initialize(subdomain)
        self.subdomain = subdomain
      end

      private

      attr_accessor :subdomain

      def additional_params
        {
          request: 'authorize'
        }
      end

      def base_url
        "https://#{subdomain}.bamboohr.com/authorize.php"
      end

      def param_strings
        params.map { |key, value| "#{key}=#{value}" }
      end

      def scope
        'openid email'
      end

      def redirect_uri
        CGI.escape(Configuration.redirect_url)
      end

      def state_code
        StateCode.new(subdomain).to_s
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
bamboo-id-0.1.3 lib/bamboo_id/urls/auth_url.rb
bamboo-id-0.1.2 lib/bamboo_id/urls/auth_url.rb
bamboo-id-0.1.1 lib/bamboo_id/urls/auth_url.rb
bamboo-id-0.1.0 lib/bamboo_id/urls/auth_url.rb