improved password handling

cusax-fix
Emil Ivov 19 years ago
parent 8f458ef1b9
commit 04434e6515

@ -779,6 +779,13 @@ else if (response.getStatusCode() == Response.UNAUTHORIZED
, response
, sourceProvider);
}
//403 FORBIDDEN
else if (response.getStatusCode() == Response.FORBIDDEN)
{
processForbidden(clientTransaction
, response
, sourceProvider);
}
//errors
else if ( response.getStatusCode() / 100 == 4 )
{
@ -834,6 +841,37 @@ private void processAuthenticationChallenge(
}
}
/**
* Makes sure that the last password used is removed from the cache, and
* notifies the user of the authentication failure..
*
* @param clientTransaction the corresponding transaction
* @param response the challenge
* @param jainSipProvider the provider that received the challende
*/
private void processForbidden(
ClientTransaction clientTransaction,
Response response,
SipProvider jainSipProvider)
{
logger.debug("Authenticating a Register request.");
sipProvider.getSipSecurityManager().handleForbiddenResponse(
response
, clientTransaction
, jainSipProvider);
//tell the others we couldn't register
this.setRegistrationState(
RegistrationState.AUTHENTICATION_FAILED
, RegistrationStateChangeEvent.REASON_AUTHENTICATION_FAILED
, "Received a "+Response.FORBIDDEN+" FORBIDDEN response while "
+"authenticating. Server returned error:"
+ response.getReasonPhrase());
}
/**
* Process an asynchronously reported DialogTerminatedEvent.
* When a dialog transitions to the Terminated state, the stack

Loading…
Cancel
Save