Class: LastFM::Auth

Inherits:
Object
  • Object
show all
Defined in:
lib/lastfm/auth.rb

Class Method Summary collapse

Class Method Details

.get_mobile_session(params) ⇒ Object

Create a web service session for a user. Used for authenticating a user when the password can be inputted by the user. Only suitable for standalone mobile devices.

Parameters:

  • params (Hash)

    a customizable set of options

Options Hash (params):

  • :username (String, required)

    last.fm username

  • :auth_token (String, required)

    md5 hash of the username + the password hash

See Also:


11
12
13
# File 'lib/lastfm/auth.rb', line 11

def get_mobile_session( params )
  LastFM.get( "auth.getMobileSession", params, :secure )
end

.get_session(params) ⇒ Object

Fetch a session key for a user. The third step in the authentication process.

Parameters:

  • params (Hash)

    a customizable set of options

Options Hash (params):

  • :token (String, required)

    md5 hash returned by step 1 of the authentication process

See Also:


19
20
21
# File 'lib/lastfm/auth.rb', line 19

def get_session( params )
  LastFM.get( "auth.getSession", params, :secure )
end

.get_tokenObject

Fetch an unathorized request token for an API account. This is step 2 of the authentication process for desktop applications.


27
28
29
# File 'lib/lastfm/auth.rb', line 27

def get_token
  LastFM.get( "auth.getToken", {}, :secure )
end