Class: OmniAuth::Strategies::Ebay

Inherits:
Object
  • Object
show all
Includes:
EbayAPI, OmniAuth::Strategy
Defined in:
lib/omniauth/strategies/ebay.rb

Defined Under Namespace

Modules: AuthType

Constant Summary

Constants included from EbayAPI

EbayAPI::EBAY_PRODUCTION_LOGIN_URL, EbayAPI::EBAY_PRODUCTION_XML_API_URL, EbayAPI::EBAY_SANDBOX_LOGIN_URL, EbayAPI::EBAY_SANDBOX_XML_API_URL, EbayAPI::X_EBAY_API_COMPATIBILITY_LEVEL, EbayAPI::X_EBAY_API_FETCHAUTHTOKEN_CALL_NAME, EbayAPI::X_EBAY_API_GETSESSIONID_CALL_NAME, EbayAPI::X_EBAY_API_GETUSER_CALL_NAME, EbayAPI::X_EBAY_API_REQUEST_CONTENT_TYPE

Instance Method Summary collapse

Methods included from EbayAPI

#api_url, #ebay_login_url, #generate_session_id, #get_auth_token, #get_user_info, #login_url, #sandbox?

Instance Method Details

#callback_phaseObject

4: We’ll get to the callback phase by setting our accept/reject URL in the ebay application settings(/auth/ebay/callback) 5: Request an eBay Auth Token with the returned username&secret_id parameters. 6: Request the user info from eBay



57
58
59
60
61
62
63
# File 'lib/omniauth/strategies/ebay.rb', line 57

def callback_phase
  @auth_token = get_auth_token(request.params["username"], request.params["sid"])
  @user_info = (request.params["username"], @auth_token)
  super
rescue => ex
  fail!("Failed to retrieve user info from ebay", ex)
end

#raw_infoObject



65
66
67
# File 'lib/omniauth/strategies/ebay.rb', line 65

def raw_info
  @user_info
end

#request_phaseObject

1: We’ll get to the request_phase by accessing /auth/ebay 2: Request from eBay a SessionID 3: Redirect to eBay Login URL with the RUName and SessionID



47
48
49
50
51
52
# File 'lib/omniauth/strategies/ebay.rb', line 47

def request_phase
  session_id = generate_session_id
  redirect (session_id)
rescue => ex
  fail!("Failed to retrieve session id from ebay", ex)
end