auth: Access Token Management

auth_client_auth_requestR Documentation

Access Token Management

Description

lastfmr implements the desktop application authentication method specified in the API documentation.

Usage

auth_client_auth_request(req, auth_client = lastfm_auth_client(), .sign = TRUE)

lastfm_auth(.skip_auth = FALSE, .auth = "default")

fetch_request_token(auth_client)

request_user_auth(request_token, auth_client)

fetch_auth_token(request_token, auth_client)

Arguments

.skip_auth

Whether to skip the user authorization request, FALSE by default.

.auth

Name of authentication identity as a string, defaults to default

request_token

String containing the request token obtained with fetch_request_token()

Value

  • fetch_request_token() and fetch_auth_token() return strings

Authentication Workflow

The authentication workflow is execute by a call to lastfm_auth() which invokes the full workflow:

  1. fetch_request_token() creates a request token for the specific API request, this authenticates a particular API request and lasts for 60 minutes.

  2. request_user_auth() launches a browser to request end-user authorization for access to user account data through the browser. The token created in the first step is provided as part of the user authorization request to associate the Application API Key with the user account providing authorization.

  3. fetch_auth_token() fetches a session token to be used with all end-user requests. This is done by providing the application API key and the request token. The endpoint returns an encrypted session token that can be attached to all user requests.


bkkkk/lastfmr documentation built on Sept. 4, 2022, 7:03 a.m.