callback method

Future<Credential> callback(
  1. Map<String, String> response
)

Implementation

Future<Credential> callback(Map<String, String> response) async {
  if (response['state'] != state) {
    throw ArgumentError('State does not match');
  }
  if (type == FlowType.jwtBearer) {
    var code = response['jwt'];
    return Credential._(client, await _getToken(code), null);
  } else if (response.containsKey('code') &&
      (type == FlowType.proofKeyForCodeExchange ||
          client.clientSecret != null)) {
    var code = response['code'];
    return Credential._(client, await _getToken(code), null);
  } else if (response.containsKey('access_token') ||
      response.containsKey('id_token')) {
    return Credential._(client, TokenResponse.fromJson(response), _nonce);
  } else {
    return Credential._(client, TokenResponse.fromJson(response), _nonce);
  }
}