All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.entur.gbfs.authentication.BearerTokenRequestAuthenticator Maven / Gradle / Ivy

There is a newer version: 4.0.19
Show newest version
package org.entur.gbfs.authentication;

import java.util.Map;

public class BearerTokenRequestAuthenticator implements RequestAuthenticator {

  private final String accessToken;

  public BearerTokenRequestAuthenticator(String accessToken) {
    this.accessToken = accessToken;
  }

  @Override
  public void authenticateRequest(Map httpHeaders)
    throws RequestAuthenticationException {
    httpHeaders.put("Authorization", String.format("Bearer %s", accessToken));
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy