TokenRequestDetails constructor

TokenRequestDetails(Config config, String code)

Implementation

TokenRequestDetails(Config config, String code) {
  this.url = config.tokenUrl;
  this.params = {
    "client_id": config.clientId,
    "code": code,
    "redirect_uri": config.redirectUri,
    "grant_type": "authorization_code"
  };
  if ( config.clientSecret != null )
    params.putIfAbsent("client_secret", () => config.clientSecret);

  this.headers = {
    "Accept": "application/json",
    "Content-Type": config.contentType
  };
}