Class Authenticator


  • public class Authenticator
    extends java.lang.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:
    Session
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Session getMobileSession​(java.lang.String username, java.lang.String password, java.lang.String apiKey, java.lang.String secret)
      Create a web service session for a user.
      static Session getSession​(java.lang.String token, java.lang.String apiKey, java.lang.String secret)
      Fetch a session key for a user.
      static java.lang.String getToken​(java.lang.String apiKey)
      Fetch an unathorized request token for an API account.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getMobileSession

        public static Session getMobileSession​(java.lang.String username,
                                               java.lang.String password,
                                               java.lang.String apiKey,
                                               java.lang.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:
        Session
      • getToken

        public static java.lang.String getToken​(java.lang.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​(java.lang.String token,
                                         java.lang.String apiKey,
                                         java.lang.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:
        Session