* Compare to the {@link AuthenticatorAbstract#authenticate(AuthenticationRequest, String) default implementation}
* which calls {@link #isValid(AuthenticationRequest)} and then returns a {@link SimpleSession}.
*/
@Override
public AuthenticationSession authenticate(final AuthenticationRequest authRequest, final String code) {
final AuthenticationRequestPassword passwordRequest = (AuthenticationRequestPassword) authRequest;
final String username = passwordRequest.getName();
if (StringUtils.isNullOrEmpty(username)) {
return null;
}
final String password = passwordRequest.getPassword();
final OpenSessionRequest request = new OpenSessionRequest(username, password);
final OpenSessionResponse response = serverFacade.openSession(request);
return response.getSession();
}