
com.distelli.gcr.auth.GcrOath2TokenCredentials Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gcr-sdk-java Show documentation
Show all versions of gcr-sdk-java Show documentation
Provides GCR API access for various Distelli software components.
/*
$Id: $
@file GcrOath2TokenCredentials.java
@brief Contains the GcrOath2TokenCredentials.java class
@author Rahul Singh [rsingh]
Copyright (c) 2013, Distelli Inc., All Rights Reserved.
*/
package com.distelli.gcr.auth;
import lombok.*;
import java.util.Base64;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class GcrOath2TokenCredentials implements GcrCredentials
{
private String oauth2AccessToken;
@Override
public String getHttpBasicAuthHeader()
{
String encoded = Base64.getEncoder().encodeToString(String.format("_token:%s", this.oauth2AccessToken).getBytes());
return String.format("Basic %s", encoded);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy