Class BasicAuthHeaderEncoder

java.lang.Object
com.sap.cloud.sdk.cloudplatform.security.BasicAuthHeaderEncoder

public class BasicAuthHeaderEncoder extends Object
Encoder to used to encode user credentials in Base64.
  • Constructor Details

    • BasicAuthHeaderEncoder

      public BasicAuthHeaderEncoder()
  • Method Details

    • encodeUserPasswordBase64

      @Nonnull public static String encodeUserPasswordBase64(@Nonnull String username, @Nonnull String password)
      Encodes the given username and password in Base64
      Parameters:
      username - The username to encode.
      password - The password to encode.
      Returns:
      The Base64 encoded credentials.
    • encodeUserPasswordBase64

      @Nonnull public static String encodeUserPasswordBase64(@Nonnull BasicCredentials credentials)
      Encodes the given user credentials in Base64.
      Parameters:
      credentials - The credentials to encode.
      Returns:
      The Base64 encoded credentials.
    • encodeClientCredentialsBase64

      @Nonnull public static String encodeClientCredentialsBase64(@Nonnull ClientCredentials credentials)
      Encodes the given client credentials in Base64.
      Parameters:
      credentials - The credentials to encode.
      Returns:
      The Base64 encoded credentials.