br.com.moip.authentication.OAuth Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-sdk Show documentation
Show all versions of java-sdk Show documentation
Java SDK for Moip v2 APIs
package br.com.moip.authentication;
import java.net.HttpURLConnection;
public class OAuth implements Authentication {
private final String accessToken;
public OAuth(String accessToken) {
this.accessToken = accessToken;
}
public String getAccessToken() {
return accessToken;
}
public void authenticate(HttpURLConnection connection) {
connection.addRequestProperty("Authorization", "OAuth " + accessToken);
}
}