Sha256: e472be84bd00208846162076c31a5d2205da69730b16aed1a210faa0ce4e994c
Contents?: true
Size: 986 Bytes
Versions: 70
Compression:
Stored size: 986 Bytes
Contents
module SparkApi module Configuration module OAuth2Configurable def convert_to_oauth2? (self.authentication_mode == SparkApi::Authentication::OAuth2 || self.authentication_mode == SparkApi::Authentication::OpenId || self.authentication_mode == SparkApi::Authentication::OpenIdOAuth2Hybrid) && self.oauth2_provider.nil? end def oauth2_enabled? self.authentication_mode == SparkApi::Authentication::OAuth2 end def oauthify! self.oauth2_provider = SparkApi::Authentication::SimpleProvider.new( :access_uri => grant_uri, :client_id => self.api_key, :client_secret => self.api_secret, :authorization_uri => self.auth_endpoint, :redirect_uri => self.callback ) end def grant_uri e = self.endpoint.gsub(/\/+$/,"") v = self.version.gsub(/\/+/,"/") "#{e}/#{v}/oauth2/grant" end end end end
Version data entries
70 entries across 70 versions & 1 rubygems