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

com.microsoft.bingads.PasswordAuthentication Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 13.0.22.1
Show newest version
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;
    }   
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy