Class BearerCredentials

java.lang.Object
com.sap.cloud.sdk.cloudplatform.security.BearerCredentials
All Implemented Interfaces:
Credentials

public class BearerCredentials extends Object implements Credentials
Simple credential implementation based on a single token.
  • Constructor Details

    • BearerCredentials

      public BearerCredentials(@Nonnull String token)
      Creates a new instance based on the given token.

      If the given token starts with the prefix "Bearer " (ignoring casing), the prefix will be removed from the token. The getHttpHeaderValue(), on the other hand, will always contain the prefix.

      Parameters:
      token - The token to use for authentication.
  • Method Details

    • toString

      @Nonnull public String toString()
      Overrides:
      toString in class Object
    • getToken

      @Nonnull public String getToken()
    • getHttpHeaderValue

      @Nonnull public String getHttpHeaderValue()
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(@Nullable Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object