Package de.umass.lastfm
Class Authenticator
java.lang.Object
de.umass.lastfm.Authenticator
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 Summary
Modifier and TypeMethodDescriptionstatic SessiongetMobileSession(String username, String password, String apiKey, String secret) Create a web service session for a user.static SessiongetSession(String token, String apiKey, String secret) Fetch a session key for a user.static StringFetch an unathorized request token for an API account.
-
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 usernamepassword- last.fm password in cleartext or 32-char md5 stringapiKey- The API keysecret- Your last.fm API secret- Returns:
- a Session instance
- See Also:
-
getToken
Fetch an unathorized request token for an API account.- Parameters:
apiKey- A last.fm API key.- Returns:
- a token
-
getSession
Fetch a session key for a user.- Parameters:
token- A token returned bygetToken(String)apiKey- A last.fm API keysecret- Your last.fm API secret- Returns:
- a Session instance
- See Also:
-