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

esendex.sdk.java.service.auth.BasicAuthenticator Maven / Gradle / Ivy

Go to download

The Esendex Java SDK is an easy to use client for our REST API that you can use to integrate SMS and Voice messaging into your Java application.

The newest version!

package esendex.sdk.java.service.auth;

/**
 * A (RFC2617) Basic authenticator that writes out the Http header to 
 * authenticate a request with the UserPassword credentials provided.
 * Each request will contain the user and password credentials 
 * encoded in Base64 
 * @author Mike Whittaker
 */
public class BasicAuthenticator extends AbstractAuthenticator {

	
	/**
	 * Create an authenticator for basic authentication with the supplied
	 * credentials.
	 * @param userPassword the credentials
	 */
	public BasicAuthenticator(UserPassword userPassword) {
		super(userPassword);
	}

	/**
	 * Gets the credentials.
	 * @return the credentials {@inheritDoc}
	 */
	@Override
	public String getCredentials() {
		UserPassword userPassword = getUserPassword();
		return userPassword.getUser() + ":" + userPassword.getPassword();
	}
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy