} else {
OpenidActivation activation = getBusinessObjectService().findBySinglePrimaryKey(OpenidActivation.class, token);
if (activation == null) {
session.setAttribute(MartinlawConstants.OPENID_ACTIVATION_MESSAGE, INVALID_TOKEN);
} else if (activation.getActivated() == null) {
EntityExternalIdentifierBo idBo = new EntityExternalIdentifierBo();
idBo.setEntityId(activation.getEntityId());
idBo.setExternalIdentifierTypeCode(MartinlawConstants.OPENID_TYPE_CODE);
idBo.setExternalId(activation.getOpenid());
getIdentityService().addExternalIdentifierToEntity(EntityExternalIdentifierBo.to(idBo));
session.setAttribute(MartinlawConstants.OPENID_ACTIVATION_MESSAGE, ACTIVATION_SUCCESS);
activation.setActivated(new Timestamp(System.currentTimeMillis()));
getBusinessObjectService().save(activation);