-- | Auth API module {-# OPTIONS_HADDOCK prune #-} module Network.Lastfm.API.Auth ( getMobileSession, getSession, getToken , getAuthorizeTokenLink ) where import Network.Lastfm -- | 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. -- -- More: getMobileSession :: Username -> APIKey -> AuthToken -> Lastfm Response getMobileSession username apiKey token = callAPI [ (#) (Method "auth.getMobileSession") , (#) username , (#) token , (#) apiKey ] -- | Fetch a session key for a user. -- -- More: getSession :: APIKey -> Token -> Secret -> Lastfm Response getSession apiKey token secret = callAPIsigned secret [ (#) (Method "auth.getSession") , (#) apiKey , (#) token ] -- | Fetch an unathorized request token for an API account. -- -- More: getToken :: APIKey -> Lastfm Response getToken apiKey = callAPI [ (#) (Method "auth.getToken") , (#) apiKey ] -- | Construct the link to authorize token. getAuthorizeTokenLink :: APIKey -> Token -> String getAuthorizeTokenLink apiKey token = "http://www.last.fm/api/auth/?api_key=" ++ value apiKey ++ "&token=" ++ value token