Skip to content

Commit

Permalink
Merge branch 'master' of
Browse files Browse the repository at this point in the history
https://github.com/OpenIdentityPlatform/OpenAM.git

Conflicts:
	.gitignore
	forgerock-parent
  • Loading branch information
vharseko committed Nov 17, 2017
2 parents 71ac9fc + 3fd1e3f commit 93a0758
Show file tree
Hide file tree
Showing 8 changed files with 310 additions and 221 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public class InternalSession implements Serializable, AMSession, SessionPersiste
private SessionState sessionState = SessionState.INVALID;
private String clientID;
private String clientDomain;
private Properties sessionProperties; // e.g. LoginURL, Timeout, Host, etc
public Properties sessionProperties; // e.g. LoginURL, Timeout, Host, etc
private boolean willExpireFlag;
private boolean isSessionUpgrade = false;
private Boolean cookieMode = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ public void logout() throws AuthLoginException {

authContext.getLoginState().logLogout();
auditor.auditLogout(getSSOToken());
authContext.getLoginState().postProcess(indexType, indexName, LoginState.PostProcessEvent.LOGOUT);
authContext.getLoginState().postProcess(this, indexType, indexName, LoginState.PostProcessEvent.LOGOUT);
destroySession();
loginStatus.setStatus(LoginStatus.AUTH_COMPLETED);
} catch (AuthLoginException le) {
Expand Down Expand Up @@ -1877,7 +1877,7 @@ private void postProcessOnFail() {
debug.message("postProcessOnFail ");
}
//setErrorMsgAndTemplate();
authContext.getLoginState().postProcess(indexType, indexName, LoginState.PostProcessEvent.FAILURE);
authContext.getLoginState().postProcess(this, indexType, indexName, LoginState.PostProcessEvent.FAILURE);
authContext.getLoginState().setFailureLoginURL(indexType, indexName);
processDone = true;
}
Expand All @@ -1893,7 +1893,7 @@ private void postProcessOnSuccess() {
if (debug.messageEnabled()) {
debug.message("postProcessOnSuccess ");
}
authContext.getLoginState().postProcess(indexType, indexName, LoginState.PostProcessEvent.SUCCESS);
authContext.getLoginState().postProcess(this, indexType, indexName, LoginState.PostProcessEvent.SUCCESS);
processDone = true;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
import com.sun.identity.authentication.config.AMConfigurationException;
import com.sun.identity.authentication.server.AuthContextLocal;
import com.sun.identity.authentication.spi.AMLoginModule;
import com.sun.identity.authentication.spi.AMPostAuthProcess;
import com.sun.identity.authentication.spi.AMPostAuthProcessInterface;
import com.sun.identity.authentication.spi.AuthenticationException;
import com.sun.identity.authentication.util.AMAuthUtils;
Expand Down Expand Up @@ -4816,12 +4817,15 @@ void setCookieSupported(boolean flag) {
* @param indexName Index name for post process
* @param type indicates success, failure or logout
*/
void postProcess(AuthContext.IndexType indexType, String indexName, PostProcessEvent type) {
void postProcess(AMLoginContext amlc, AuthContext.IndexType indexType, String indexName, PostProcessEvent type) {
Set<AMPostAuthProcessInterface> postLoginInstanceSet = getPostLoginInstances(getPostLoginClassSet(indexType, indexName));
if ((postLoginInstanceSet != null) &&
(!postLoginInstanceSet.isEmpty())) {
for (AMPostAuthProcessInterface postLoginInstance : postLoginInstanceSet) {
executePostProcessSPI(postLoginInstance, type);
for (AMPostAuthProcessInterface postLoginInstance : postLoginInstanceSet) {
if(postLoginInstance instanceof AMPostAuthProcess) {
((AMPostAuthProcess)postLoginInstance).amlc = amlc;
}
executePostProcessSPI(postLoginInstance, type);
}
}
}
Expand Down Expand Up @@ -4971,7 +4975,8 @@ private Set<AMPostAuthProcessInterface> getPostLoginInstances(Set<String> postLo
}
}
InternalSession session = getReferencedSession();
session.putProperty(ISAuthConstants.POST_AUTH_PROCESS_INSTANCE, sb.toString());
if(session != null)
session.putProperty(ISAuthConstants.POST_AUTH_PROCESS_INSTANCE, sb.toString());
}
return postLoginInstanceSet;
}
Expand Down Expand Up @@ -5091,7 +5096,7 @@ long getPageTimeOut() {
*
* @param pageTimeOut Page timeout.
*/
synchronized void setPageTimeOut(long pageTimeOut) {
public synchronized void setPageTimeOut(long pageTimeOut) {
if (DEBUG.messageEnabled()) {
DEBUG.message("Setting page timeout :" + pageTimeOut);
}
Expand Down Expand Up @@ -5280,7 +5285,7 @@ Callback[] getCallbacksPerState(String pageState) {
/**
* Sets Callbacks per Page state.
*/
void setCallbacksPerState(String pageState, Callback[] callbacks) {
public void setCallbacksPerState(String pageState, Callback[] callbacks) {
this.callbacksPerState.put(pageState, callbacks);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.sun.identity.authentication.spi;

import com.sun.identity.authentication.service.AMLoginContext;

public abstract class AMPostAuthProcess implements AMPostAuthProcessInterface {
public AMLoginContext amlc;
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public static String DNtoName(String dn) {
public static String DNtoName(String dn, boolean noTypes) {
// String dn is guaranteed type of DN
String id = dn;
if (StringUtils.isNotEmpty(dn) && LDAPUtils.isDN(dn, 1)) {
if (StringUtils.isNotEmpty(dn) && LDAPUtils.isDN(dn)) {
try {
DN name = DN.valueOf(dn);
id = LDAPUtils.unescapeValue(noTypes ? rdnValueFromDn(name) : name.rdn().toString());
Expand Down
Loading

0 comments on commit 93a0758

Please sign in to comment.