powered by Jive Software

Openfire Custom AuthProvider Issue

Hi all,

I am trying to create a custom AuthProvider, and in the custom class I connect to a Web Api for user authentication.

It works, except for one thing: It always return fail if I add credential information for httpPost

I couldn’t figure out the reason, please help!!!

More informaton:

  1. I use org.apache httpclient to handle the http request

  2. When I remove the auth requirement for the Web Api, everything works

  3. When I add the auth requirement for the Web Api, it’s not working

It is the code I send with the request:

Credentials credentials = new UsernamePasswordCredentials(“123”, “123”);

  •              ((DefaultHttpClient) httpClient).getCredentialsProvider()*
    
  •                                          .setCredentials(AuthScope.ANY, credentials);*