Class Authenticator

java.lang.Object
de.umass.lastfm.Authenticator

public class Authenticator extends Object
Provides bindings for the authentication methods of the last.fm API. See http://www.last.fm/api/authentication for authentication methods.
Author:
Janni Kovacs
See Also:
  • Method Details

    • getMobileSession

      public static Session getMobileSession(String username, String password, String apiKey, String secret)
      Create a web service session for a user. Used for authenticating a user when the password can be inputted by the user.
      Parameters:
      username - last.fm username
      password - last.fm password in cleartext or 32-char md5 string
      apiKey - The API key
      secret - Your last.fm API secret
      Returns:
      a Session instance
      See Also:
    • getToken

      public static String getToken(String apiKey)
      Fetch an unathorized request token for an API account.
      Parameters:
      apiKey - A last.fm API key.
      Returns:
      a token
    • getSession

      public static Session getSession(String token, String apiKey, String secret)
      Fetch a session key for a user.
      Parameters:
      token - A token returned by getToken(String)
      apiKey - A last.fm API key
      secret - Your last.fm API secret
      Returns:
      a Session instance
      See Also: