use of org.gluu.oxtrust.model.GluuConfiguration in project oxTrust by GluuFederation.
the class PasswordReminderAction method enabled.
public boolean enabled() {
GluuConfiguration configuration = configurationService.getConfiguration();
SmtpConfiguration smtpConfiguration = configuration.getSmtpConfiguration();
boolean valid = smtpConfiguration != null && smtpConfiguration.isValid() && configurationService.getConfiguration().isPasswordResetAllowed();
if (valid) {
passwordResetIsEnable = true;
if (recaptchaService.isEnabled() && getAuthenticationRecaptchaEnabled()) {
valid = recaptchaService.verifyRecaptchaResponse();
if (!valid) {
facesMessages.add(FacesMessage.SEVERITY_ERROR, facesMessages.evalResourceAsString("#{msgs['person.passwordreset.catch.checkInputAndCaptcha']}"));
}
}
} else {
facesMessages.add(FacesMessage.SEVERITY_ERROR, facesMessages.evalResourceAsString("#{msgs['person.passwordreset.notActivate']}"));
}
return valid;
}
use of org.gluu.oxtrust.model.GluuConfiguration in project oxTrust by GluuFederation.
the class Authenticator method oAuthLogin.
/**
* Main entry point for oAuth authentication.
*
* @throws IOException
*
* @throws Exception
*/
public boolean oAuthLogin() throws IOException, Exception {
Client client = ClientBuilder.newClient();
WebTarget target = client.target(getAuthorizationUrl());
String clientId = appConfiguration.getOxAuthClientId();
String scope = appConfiguration.getOxAuthClientScope();
String responseType = "code";
String nonce = UUID.randomUUID().toString();
String state = UUID.randomUUID().toString();
target = target.queryParam(OxTrustConstants.OXAUTH_CLIENT_ID, clientId);
target = target.queryParam(OxTrustConstants.OXAUTH_REDIRECT_URI, appConfiguration.getLoginRedirectUrl());
target = target.queryParam(OxTrustConstants.OXAUTH_RESPONSE_TYPE, responseType);
target = target.queryParam(OxTrustConstants.OXAUTH_SCOPE, scope);
target = target.queryParam(OxTrustConstants.OXAUTH_NONCE, nonce);
target = target.queryParam(OxTrustConstants.OXAUTH_STATE, state);
// Store state and nonce
identity.getSessionMap().put(OxTrustConstants.OXAUTH_NONCE, nonce);
identity.getSessionMap().put(OxTrustConstants.OXAUTH_STATE, state);
GluuConfiguration configuration = configurationService.getConfiguration(new String[] { "oxTrustAuthenticationMode" });
String acrValues = configuration.getOxTrustAuthenticationMode();
if (StringHelper.isNotEmpty(acrValues)) {
target = target.queryParam(OxTrustConstants.OXAUTH_ACR_VALUES, acrValues);
// Store authentication method
identity.getSessionMap().put(OxTrustConstants.OXAUTH_ACR_VALUES, acrValues);
}
facesService.redirectToExternalURL(target.getUri().toString().replaceAll("%2B", "+"));
return true;
}
Aggregations