Skip to content

Commit

Permalink
Merge branch 'version_4.3.1' of https://github.com/GluuFederation/oxAuth
Browse files Browse the repository at this point in the history
 into version_4.3.1
  • Loading branch information
yurem committed Jan 4, 2022
2 parents 1397f6c + 96329ad commit 9523eb2
Show file tree
Hide file tree
Showing 17 changed files with 59 additions and 79 deletions.
2 changes: 1 addition & 1 deletion Client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>org.gluu</groupId>
<artifactId>oxauth</artifactId>
<version>4.3.1-SNAPSHOT</version>
<version>4.3.1.Final</version>
</parent>

<prerequisites>
Expand Down
2 changes: 1 addition & 1 deletion Model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>org.gluu</groupId>
<artifactId>oxauth</artifactId>
<version>4.3.1-SNAPSHOT</version>
<version>4.3.1.Final</version>
</parent>

<prerequisites>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ public class AppConfiguration implements Configuration {

private int sessionIdUnusedLifetime;
private int sessionIdUnauthenticatedUnusedLifetime = 120; // 120 seconds
private Boolean sessionIdEnabled;
private Boolean sessionIdPersistOnPromptNone;
private Boolean sessionIdRequestParameterEnabled = false; // #1195
private Boolean changeSessionIdOnAuthentication = true;
Expand Down Expand Up @@ -1430,14 +1429,6 @@ public void setSessionIdRequestParameterEnabled(Boolean sessionIdRequestParamete
this.sessionIdRequestParameterEnabled = sessionIdRequestParameterEnabled;
}

public Boolean getSessionIdEnabled() {
return sessionIdEnabled;
}

public void setSessionIdEnabled(Boolean p_sessionIdEnabled) {
sessionIdEnabled = p_sessionIdEnabled;
}

public int getConfigurationUpdateInterval() {
return configurationUpdateInterval;
}
Expand Down
6 changes: 3 additions & 3 deletions Server/integrations.deprecatred/toopher/sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@
<repository>
<id>repository.jboss.org</id>
<name>JBoss Repository</name>
<url>http://repository.jboss.org/nexus/content/groups/public-jboss/</url>
<url>https://repository.jboss.org/nexus/content/groups/public-jboss/</url>
</repository>
<repository>
<id>bouncycastle</id>
<name>Bouncy Castle</name>
<url>http://repo2.maven.org/maven2/org/bouncycastle</url>
<url>https://repo2.maven.org/maven2/org/bouncycastle</url>
</repository>
<repository>
<id>gluu</id>
<name>Gluu repository</name>
<url>http://ox.gluu.org/maven</url>
<url>https://maven.gluu.org/maven</url>
</repository>
</repositories>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,11 @@ def createLdapExtendedEntryManagers(self, authConfiguration):
else:
value_string = str(value)

ldapProperties.setProperty(persistenceType + "." + key, value_string)
ldapProperties.setProperty(persistenceType + "#" + key, value_string)

if StringHelper.isNotEmptyString(ldapConfiguration.getBindPassword()):
ldapProperties.setProperty(persistenceType + ".bindPassword", ldapConfiguration.getBindPassword())
ldapProperties.setProperty(persistenceType + "#bindPassword", ldapConfiguration.getBindPassword())

ldapEntryManager = ldapEntryManagerFactory.createEntryManager(ldapProperties)

ldapExtendedEntryManagers.append({ "ldapConfiguration" : ldapConfiguration, "ldapProperties" : ldapProperties, "loginAttributes" : ldapExtendedConfiguration["loginAttributes"], "localLoginAttributes" : ldapExtendedConfiguration["localLoginAttributes"], "ldapEntryManager" : ldapEntryManager })
Expand Down
17 changes: 4 additions & 13 deletions Server/integrations/fido2/Fido2ExternalAuthenticator.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
# Author: Yuriy Movchan
#

from javax.ws.rs.core import Response
from org.jboss.resteasy.client import ClientResponseFailure
from org.jboss.resteasy.client.exception import ResteasyClientException
from javax.ws.rs import ClientErrorException
from javax.ws.rs.core import Response
from org.gluu.model.custom.script.type.auth import PersonAuthenticationType
from org.gluu.fido2.client import Fido2ClientFactory
Expand Down Expand Up @@ -178,7 +176,7 @@ def prepareForStep(self, configurationAttributes, requestParameters, step):
identity.setWorkingParameter("platformAuthenticatorAvailable", "true")
else:
identity.setWorkingParameter("platformAuthenticatorAvailable", "false")
except ClientResponseFailure, ex:
except ClientErrorException, ex:
print "Fido2. Prepare for step 2. Failed to start assertion flow. Exception:", sys.exc_info()[1]
return False
else:
Expand All @@ -202,7 +200,7 @@ def prepareForStep(self, configurationAttributes, requestParameters, step):
#, separators=(',', ':'))

attestationResponse = attestationService.register(attestationRequest).readEntity(java.lang.String)
except ClientResponseFailure, ex:
except ClientErrorException, ex:
print "Fido2. Prepare for step 2. Failed to start attestation flow. Exception:", sys.exc_info()[1]
return False

Expand Down Expand Up @@ -270,18 +268,11 @@ def getMetaDataConfiguration(self):
try:
self.metaDataConfiguration = metaDataConfigurationService.getMetadataConfiguration().readEntity(java.lang.String)
return self.metaDataConfiguration
except ClientResponseFailure, ex:
except ClientErrorException, ex:
# Detect if last try or we still get Service Unavailable HTTP error
if (attempt == max_attempts) or (ex.getResponse().getResponseStatus() != Response.Status.SERVICE_UNAVAILABLE):
raise ex

java.lang.Thread.sleep(3000)
print "Attempting to load metadata: %d" % attempt
except ResteasyClientException, ex:
# Detect if last try or we still get Service Unavailable HTTP error
if attempt == max_attempts:
raise ex

java.lang.Thread.sleep(3000)
print "Attempting to load metadata: %d" % attempt
finally:
Expand Down
4 changes: 2 additions & 2 deletions Server/integrations/pingid/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<log4j.version>2.13.3</log4j.version>
<log4j.version>2.17.1</log4j.version>
</properties>
<dependencies>
<dependency>
Expand Down Expand Up @@ -73,7 +73,7 @@
<repository>
<id>gluu</id>
<name>Gluu repository</name>
<url>https://ox.gluu.org/maven</url>
<url>https://maven.gluu.org/maven</url>
</repository>
</repositories>
</project>
4 changes: 2 additions & 2 deletions Server/integrations/u2f/U2fExternalAuthenticator.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import sys
from javax.ws.rs.core import Response
from javax.ws.rs import WebApplicationException
from org.jboss.resteasy.client.exception import ResteasyClientException
from javax.ws.rs import ClientErrorException
from org.gluu.model.custom.script.type.auth import PersonAuthenticationType
from org.gluu.oxauth.client.fido.u2f import FidoU2fClientFactory
from org.gluu.oxauth.model.config import Constants
Expand Down Expand Up @@ -171,7 +171,7 @@ def prepareForStep(self, configurationAttributes, requestParameters, step):
try:
authenticationRequestService = FidoU2fClientFactory.instance().createAuthenticationRequestService(self.metaDataConfiguration)
authenticationRequest = authenticationRequestService.startAuthentication(user.getUserId(), None, u2f_application_id, session.getId())
except ClientResponseFailure, ex:
except ClientErrorException, ex:
if (ex.getResponse().getResponseStatus() != Response.Status.NOT_FOUND):
print "U2F. Prepare for step 2. Failed to start authentication workflow. Exception:", sys.exc_info()[1]
return False
Expand Down
2 changes: 1 addition & 1 deletion Server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>org.gluu</groupId>
<artifactId>oxauth</artifactId>
<version>4.3.1-SNAPSHOT</version>
<version>4.3.1.Final</version>
</parent>

<prerequisites>
Expand Down
6 changes: 3 additions & 3 deletions Server/src/main/java/org/gluu/oxauth/auth/Authenticator.java
Original file line number Diff line number Diff line change
Expand Up @@ -692,10 +692,10 @@ public String prepareAuthenticationForStep(SessionId sessionId) {
}
}

public boolean authenticateBySessionId(String p_sessionId) {
if (StringUtils.isNotBlank(p_sessionId) && appConfiguration.getSessionIdEnabled()) {
public boolean authenticateBySessionId(String sessionIdString) {
if (StringUtils.isNotBlank(sessionIdString)) {
try {
SessionId sessionId = sessionIdService.getSessionId(p_sessionId);
SessionId sessionId = sessionIdService.getSessionId(sessionIdString);
return authenticateBySessionId(sessionId);
} catch (Exception e) {
logger.trace(e.getMessage(), e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public SessionId getConsentSession(HttpServletRequest httpRequest, HttpServletRe

public void setAuthenticatedSessionState(HttpServletRequest httpRequest, HttpServletResponse httpResponse, SessionId sessionId) {
SessionId connectSession = getConnectSession(httpRequest);
sessionIdService.setSessionIdStateAuthenticated(httpRequest, httpResponse, sessionId, connectSession.getDn());
sessionIdService.setSessionIdStateAuthenticated(httpRequest, httpResponse, sessionId, connectSession.getUserDn());
}

public boolean isSessionStateAuthenticated(HttpServletRequest httpRequest) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import javax.inject.Inject;

import org.apache.commons.lang.StringUtils;
import org.gluu.fido2.model.entry.Fido2RegistrationEntry;
import org.gluu.oxauth.model.config.StaticConfiguration;
import org.gluu.oxauth.model.configuration.AppConfiguration;
import org.gluu.oxauth.model.fido.u2f.DeviceRegistration;
Expand Down Expand Up @@ -69,7 +70,7 @@ public long countFido2RegisteredDevices(String username) {
Filter registeredFilter = Filter.createEqualityFilter("oxStatus", "registered");
Filter filter = Filter.createANDFilter(userInumFilter, registeredFilter);

long countEntries = persistenceEntryManager.countEntries(baseDn, CustomEntry.class, filter);
long countEntries = persistenceEntryManager.countEntries(baseDn, Fido2RegistrationEntry.class, filter);

return countEntries;
}
Expand Down
45 changes: 21 additions & 24 deletions Server/src/main/webapp/login.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
template="/WEB-INF/incl/layout/login-template.xhtml">
<f:metadata>
<f:viewAction action="#{authenticator.prepareAuthenticationForStep}" />
<f:viewParam name="login_hint" value="#{loginAction.loginHint}" />
<f:viewParam name="login_hint" value="#{authorizeAction.loginHint}" />
</f:metadata>
<ui:define name="head">
<meta name="description" content="Gluu, Inc." />
Expand Down Expand Up @@ -110,29 +110,6 @@
</h:panelGroup>
</div>
<script type="text/javascript">

window.onload = function () {
var userNameField = document.getElementById("loginForm:username");
var passwordField = document.getElementById("loginForm:password");

passwordField.value = "";
var userName = '#{!empty loginAction.loginHint ? loginAction.loginHint : ""}';
if (userName) {
userNameField.value = userName;
passwordField.focus();
} else {
userNameField.focus();
}

var displayRegister = #{display_register_action or identity.sessionId.sessionAttributes['display_register_action']};
if (displayRegister) {
var registerButton = document.getElementById("loginForm:registerId");
if (registerButton != null) {
registerButton.style.display = 'inline';
}
}
};

$(document).ready(function () {
$('.other').click(function(){
$('#social_new').toggle();
Expand All @@ -150,6 +127,26 @@
});

fillPlatformField();

var userNameField = document.getElementById("loginForm:username");
var passwordField = document.getElementById("loginForm:password");

passwordField.value = "";
var userName = '#{!empty authorizeAction.loginHint ? authorizeAction.loginHint : ""}';
if (userName) {
userNameField.value = userName;
passwordField.focus();
} else {
userNameField.focus();
}

var displayRegister = #{display_register_action or identity.sessionId.sessionAttributes['display_register_action']};
if (displayRegister) {
var registerButton = document.getElementById("loginForm:registerId");
if (registerButton != null) {
registerButton.style.display = 'inline';
}
}
});

function checkRemembeMe() {
Expand Down
2 changes: 1 addition & 1 deletion common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>org.gluu</groupId>
<artifactId>oxauth</artifactId>
<version>4.3.1-SNAPSHOT</version>
<version>4.3.1.Final</version>
</parent>

<prerequisites>
Expand Down
4 changes: 2 additions & 2 deletions oxAuthStatic/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

<groupId>org.gluu</groupId>
<artifactId>oxauth-static</artifactId>
<version>4.3.1-SNAPSHOT</version>
<version>4.3.1.Final</version>
<packaging>jar</packaging>

<name>oxauth-static</name>
<url>http://ox.gluu.org</url>
<url>https://www.gluu.org</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
4 changes: 2 additions & 2 deletions persistence-model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<parent>
<groupId>org.gluu</groupId>
<artifactId>oxauth</artifactId>
<version>4.3.1-SNAPSHOT</version>
<version>4.3.1.Final</version>
</parent>
<artifactId>oxauth-persistence-model</artifactId>
<name>Persistence model</name>
<url>http://maven.apache.org</url>
<url>https://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
Expand Down
20 changes: 10 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
<groupId>org.gluu</groupId>
<artifactId>oxauth</artifactId>
<packaging>pom</packaging>
<version>4.3.1-SNAPSHOT</version>
<version>4.3.1.Final</version>
<name>oxAuth</name>
<url>http://www.gluu.org</url>
<url>https://www.gluu.org</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.min-version>3.3.9</maven.min-version>

<oxcore.version>4.3.1-SNAPSHOT</oxcore.version>
<oxeleven.version>4.3.1-SNAPSHOT</oxeleven.version>
<oxnotify.version>4.3.1-SNAPSHOT</oxnotify.version>
<oxlicense.version>4.3.1-SNAPSHOT</oxlicense.version>
<fido2.version>4.3.1-SNAPSHOT</fido2.version>
<oxcore.version>4.3.1.Final</oxcore.version>
<oxeleven.version>4.3.1.Final</oxeleven.version>
<oxnotify.version>4.3.1.Final</oxnotify.version>
<oxlicense.version>4.3.1.Final</oxlicense.version>
<fido2.version>4.3.1.Final</fido2.version>

<json.version>20180813</json.version>
<jackson.version>2.10.1</jackson.version>
Expand All @@ -28,7 +28,7 @@

<httpcore.version>4.4.6</httpcore.version>

<log4j.version>2.13.3</log4j.version>
<log4j.version>2.17.1</log4j.version>
<slf4j.version>1.7.25</slf4j.version>

<jsf-api.version>2.2.16</jsf-api.version>
Expand Down Expand Up @@ -67,7 +67,7 @@
</snapshots>
<id>gluu</id>
<name>Gluu repository</name>
<url>https://ox.gluu.org/maven</url>
<url>https://maven.gluu.org/maven</url>
</repository>
<repository>
<id>bouncycastle</id>
Expand Down Expand Up @@ -101,7 +101,7 @@
<dependency>
<groupId>org.gluu</groupId>
<artifactId>gluu-core-bom</artifactId>
<version>4.3.1-SNAPSHOT</version>
<version>4.3.1.Final</version>
<scope>import</scope>
<type>pom</type>
</dependency>
Expand Down

0 comments on commit 9523eb2

Please sign in to comment.