retrieveAccessToken method

Future<void> retrieveAccessToken(
  1. String verifierToken
)

The second step in the OAuth authentication process. A permanent access token is retrieved and saved. Requires a verifierToken, which has been generated using the URL, retrieved in getAuthorizationUrl. This process is async. After completion, Stud.IP's RestAPI can be fully accessed.

Implementation

Future<void> retrieveAccessToken(String verifierToken) async {
  final res =
      await _auth.requestTokenCredentials(_credentials, verifierToken);
  _credentials = res.credentials;
  _client = oauth1.Client(
    _platform.signatureMethod,
    _clientCredentials,
    res.credentials,
  );
}