Class Auth

Description

Authentication methods.

Located in /src/Auth.php (line 9)


	
			
Method Summary
static string getApiSignature ( $params, string $apiSecret)
static Session getMobileSession (string $username, string $password)
static Session getSession (string $token)
static string getToken ()
Methods
static method getApiSignature (line 19)

Returns a last.fm API signature for the given request parameters.

  • return: Last.fm API signature.
  • access: public
static string getApiSignature ( $params, string $apiSecret)
  • array $params: Request parameters.
  • string $apiSecret: Last.fm API secret.
static method getMobileSession (line 43)

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. See the authentication how-to for more.

  • return: A Session object.
  • throws: Error
  • access: public
static Session getMobileSession (string $username, string $password)
  • string $username: The last.fm username. (Required)
  • string $password: The last.fm password. (Required)
static method getSession (line 61)

Returns a session using an authorized token.

  • return: A Session object.
  • throws: Error
  • access: public
static Session getSession (string $token)
  • string $token: A 32-character ASCII hexadecimal MD5 hash returned by step 1 of the authentication process (following the granting of permissions to the application by the user). (Required)
static method getToken (line 77)

Fetch an unauthorized request token for an API account. This is step 2 of the authentication process for desktop applications. Web applications do not need to use this service.

  • return: A 32-character ASCII hexadecimal MD5 hash.
  • throws: Error
  • access: public
static string getToken ()
static method getWebSession (line 91)

Used by our flash embeds (on trusted domains) to use a site session cookie to seed a ws session without requiring a password. Uses the site cookie so must be accessed over a *.last.fm domain.

  • return: A Session object.
  • throws: Error
  • access: public
static Session getWebSession ()

Documentation generated on Mon, 22 Dec 2008 16:57:31 +0100 by phpDocumentor 1.4.1