Retrieve the credentials on the connection failure.
public class ApplicationClass implements IODPHTTPAuthChallengeListener{ ODPHTTPAuthChallengeCredentials getCredentials(String host, String username, String realm){ // some application related processing return odphttpauthchallengecredentialsobj; }
This method throws HTTP response code HTTP_AUTH_FAILURE - 401. The application is expected to return a structure from the method containing the credentials to be used. The argument contains the credentials last used, which will be empty strings on the first callback for the current run of the application (credentials are not persisted). Once credentials are received, they are used in subsequent connections until challenged again.