com.microsoft.bingads.PasswordAuthentication Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of microsoft.bingads Show documentation
Show all versions of microsoft.bingads Show documentation
The Bing Ads Java SDK is a library improving developer experience when working with the Bing Ads services by providing high-level access to features such as Bulk API, OAuth Authorization and SOAP API.
package com.microsoft.bingads;
import com.microsoft.bingads.internal.HttpHeaders;
/**
* Represents a legacy Bing Ads authentication method using user name and password.
*/
public class PasswordAuthentication extends Authentication {
private final String userName;
private final String password;
/**
* Initializes a new instance of the PasswordAuthentication class using the specified user name and password.
*
* @param userName The Bing Ads user's sign-in user name. You may not set
* this element to a Microsoft account.
* @param password The Bing Ads user's sign-in password.
*/
public PasswordAuthentication(String userName, String password) {
super();
this.userName = userName;
this.password = password;
}
@Override
public void addHeaders(HeadersImpl headersImplementation) {
headersImplementation.addHeader(HttpHeaders.USER_NAME, this.userName);
headersImplementation.addHeader(HttpHeaders.PASSWORD, this.password);
}
/**
* Gets the user name.
*/
public String getUserName() {
return userName;
}
/**
* Gets the password.
*/
public String getPassword() {
return password;
}
}