Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kc change #1062

Merged
merged 18 commits into from
Jun 30, 2021
Prev Previous commit
Next Next commit
Refactor and remove sysout
  • Loading branch information
Nolan Tellis committed Jun 29, 2021
commit a4b5102fb0858902bd08f48e5ae5a4d90f45eac8
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ public class UserMenuController extends SelectorComposer<Menubar> {

private static final Logger LOGGER = PortalLoggerFactory.getLogger(UserMenuController.class);


private static final String JWTS_MAP_BY_USER_KEY = TokenHandoffController.JWTS_MAP_BY_USER_KEY;

private Menuitem aboutMenuitem;
Expand Down Expand Up @@ -205,7 +204,6 @@ public void onEvent(Event event) throws Exception {
// If this desktop is part of a signed-out session, close the browser tab or switch to login
EventQueues.lookup("signOutQueue", EventQueues.APPLICATION, true)
.subscribe(new EventListener() {

public void onEvent(Event event) {
Session session = Sessions.getCurrent();

Expand All @@ -217,6 +215,7 @@ public void onEvent(Event event) {
}
}
});

// Force logout a user that has been deleted by admin
EventQueues.lookup("forceSignOutQueue", EventQueues.APPLICATION, true)
.subscribe(new EventListener() {
Expand All @@ -229,7 +228,6 @@ public void onEvent(Event event) {
}
}
});

}
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
import org.apromore.portal.model.UserType;
import org.keycloak.adapters.RefreshableKeycloakSecurityContext;
import org.keycloak.representations.AccessToken;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
Expand All @@ -45,6 +47,8 @@
@Component("authDetailsFilter")
public class AuthDetailsFilter implements Filter {

Logger logger = LoggerFactory.getLogger(getClass());

@Autowired
ManagerService managerService;

Expand Down Expand Up @@ -90,7 +94,7 @@ public void doFilter(ServletRequest request, ServletResponse response, FilterCha
try {
userType = userType == null ? managerService.readUserByEmail(email) : userType;
} catch (Exception e1) {
// ignoreing for now.
logger.warn("User not in system ", ExceptionUtils.getStackTrace(e1));
}

if (Objects.isNull(userType)) {
Expand All @@ -105,7 +109,6 @@ public void doFilter(ServletRequest request, ServletResponse response, FilterCha

httpRequest.getSession().setAttribute("USER", userType);


chain.doFilter(httpRequest, response);

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
boolean isExistingSession = existingSession == null ? false
: existingSession.getAttribute("USER") == null ? false : true;

System.out.println("Auth-path=" + requestPath);

if (isExistingSession && requestPath.equals("/j_spring_security_logout")) {
OIDCServletHttpFacade facade = new OIDCServletHttpFacade(request, response);
KeycloakDeployment deployment = deploymentContext.resolveDeployment(facade);
Expand Down
8 changes: 4 additions & 4 deletions site.properties
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ site.strictTransportSecurity = max-age=63072000; includeSubdomains;
site.fullProtocolHostPortUrl=http://localhost:8181/
# site.useKeycloakSso = true
# To not use keycloak, comment out previous line and uncomment below line
site.useKeycloakSso = true
site.useKeycloakSso = false

# If there's user activity and the user's JWT token is within this many minutes of timing out, get a new token with a later expiry
# e.g. if JWTs expire 30m after being issued and are refreshed 20m before expiry, refresh will occur no more than every 10m
Expand Down Expand Up @@ -148,7 +148,7 @@ portal.menuitemorder.File = Upload,Download,Create data pipeline,Export log as C
contact.email = support@apromore.atlassian.net

# Calendar
calendar.enable = false
calendar.enable = true
raboczi marked this conversation as resolved.
Show resolved Hide resolved

# Security
security.publish.enable = false
Expand Down Expand Up @@ -190,7 +190,7 @@ jdbc.url = jdbc:mysql://localhost:3306/apromore?createDatabaseIfNotExist=tr
# N.B. For keycloak (in Apromore mysql docker), use below instead of above
# jdbc.url = jdbc:mysql://apromore-mysql.apromoresso.net:3306/apromore?createDatabaseIfNotExist=true&autoReconnect=true&allowMultiQueries=true&rewriteBatchedStatements=true&characterEncoding=utf-8&serverTimezone=GMT%2B10
jdbc.username = apromore
jdbc.password = Apromore#!dev
jdbc.password = MAcri
#
jpa.database = MYSQL
jpa.databasePlatform = org.eclipse.persistence.platform.database.MySQLPlatform
Expand All @@ -203,7 +203,7 @@ jpa.generateDDL = false

## Liquibase User Mysql
liquibase.jdbc.username = liquibase_user
liquibase.jdbc.password = Apromore#!dev
liquibase.jdbc.password = MAcri

# Cache threshold (Set to 0 to disable)

Expand Down