The Community is hosting an End of Summer sweepstakes! Participants must complete tasks to earn tickets that will enter them with a chance to win a free year of Constant Contact and other great prizes!*
*No Purchase Necessary. For Official Rules, visit here. Constant Contact’s End of Summer 2020 Sweepstakes ends on October, 20, 2020 at 11:50 PM EST.

No credentials available for BASIC ''

Occasional Participant

No credentials available for BASIC ''


I'm trying to update our application to use Basic authentication over https.

Two changes have been made:

 1.     URI looks like this now: ""

 2.     HttpClient API call has been change to use 'AuthPolicy.BASIC'.

Also, according to this resource:, with HttpClient, we don't need to do anything extra in order  to use SSL communications.

My problem is that, I'm getting 401 error with the following message:

Jun 20, 2009 12:12:10 AM org.apache.commons.httpclient.HttpMethodDirector processWWWAuthChallenge

INFO: No credentials available for BASIC ''

Could, please, anybody help me to resolve this issue.


Thanks in advance,



This response indicates that

This response indicates that the Basic Authentication is not being set corretly in your HttpClient class.  I would refer to the documentation on that class on how to implement Basic Authentication over a secury connection (https).  Have you tried running the test case they suggested for ensuring your Apache server is set up correctly?

Dave Berard
Senior Product Manager, Constant Contact
Occasional Participant

No, I have not ran that

No, I have not ran that test.

Could you please point me where I can find it?

Occasional Participant

still having problems


I can't find any other settings for HttpClient in order to set it for basic authentication.

Would it be helpfull if I paste my code for your review?

Occasional Participant

No credentials available for BASIC ''@ap

Dave, I'm not getting anywhere and time is running out.

I'm posting trimmed down version of my code. Could you please take a look and see what is wrong.

public class ConstantContactActivityUpload {

    public void upload(List<ConstantContactUploadInfo> infoList, int listKey) throws IOException {   

    UsernamePasswordCredentials credentials = setCredentials();

    HttpClient httpClient = initialSetUp(credentials);

    AuthDetails authDetails = extractAuthDetails();

        RequestEntity requestEntity ...

    String url = "";

    this.postToServer(httpClient, requestEntity, url, uploadedValues.toString());


    private HttpClient initialSetUp(UsernamePasswordCredentials credentials) {

        HostConfiguration hostConfiguration = new HostConfiguration();


        AuthScope authScope = new AuthScope("", 80, "");

        AuthPolicy.registerAuthScheme("Basic", BasicScheme.class);

        HttpClient httpClient = new HttpClient();

        List<String> list = new ArrayList<String>();


        httpClient.getParams().setParameter(AuthPolicy.AUTH_SCHEME_PRIORITY, list);

        httpClient.getState().setCredentials(authScope, credentials);

        return httpClient;


    private void postToServer(HttpClient client,  RequestEntity requestEntity, String url, String uploadedValues) throws HttpException, IOException {

        PostMethod httpPost = new PostMethod(url);




    private UsernamePasswordCredentials setCredentials() {...} 

    protected AuthDetails extractAuthDetails() {...}


New Member

You need to update your port in your AuthScope

Change the port fom 80 to 443 or to a negative number or to AuthScope.ANY_PORT.

Developer Portal

View API documentation, code samples, get your API key.

Visit Page

Constant Contact 2020 End of Summer Community Sweepstakes!

The Constant Contact User Community is hosting a sweepstakes. The more you participate, the more chances you have to win! Read on to learn more...

Read More