Class: Shortwave::Authentication::Desktop
- Defined in:
- lib/shortwave/authentication.rb
Overview
Authentication for destop applications. Send your user to the page given by uri
and then call authenticate
.
Instance Attribute Summary
Attributes inherited from Session
Instance Method Summary collapse
-
#authenticate ⇒ Object
Gets an authenticated session key.
-
#uri ⇒ Object
A uri the user should log in at.
Methods inherited from Session
#initialize, #merge!, #signature, #signed_in?
Constructor Details
This class inherits a constructor from Shortwave::Authentication::Session
Instance Method Details
#authenticate ⇒ Object
Gets an authenticated session key. Call after the user has logged in at uri
.
102 103 104 |
# File 'lib/shortwave/authentication.rb', line 102 def authenticate parse_session_response(@facade.session(token)) end |
#uri ⇒ Object
A uri the user should log in at.
95 96 97 98 99 |
# File 'lib/shortwave/authentication.rb', line 95 def uri response = @facade.token @token = Nokogiri::XML(response).css("token").text.strip "http://www.last.fm/api/auth/?api_key=#{@api_key}&token=#{@token}" end |