Skip to content

Commit

Permalink
The request is missing a required parameter error obtained in flow 3 #…
Browse files Browse the repository at this point in the history
  • Loading branch information
syntrydy committed Dec 15, 2020
1 parent 9ce6fa4 commit 78dc438
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 41 deletions.
3 changes: 2 additions & 1 deletion configuration/oxtrust-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,6 @@
"shibboleth3SpConfDir":"",
"organizationName":"",
"idp3SigningCert":"/etc/certs/idp-signing.crt",
"idp3EncryptionCert":"/etc/certs/idp-encryption.crt"
"idp3EncryptionCert":"/etc/certs/idp-encryption.crt",
"passIdTokenHintToLogoutRedirectUri": false
}
80 changes: 40 additions & 40 deletions server/src/main/java/org/gluu/oxtrust/action/LogoutAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,53 +31,53 @@
@RequestScoped
public class LogoutAction implements Serializable {

private static final long serialVersionUID = -1887682170119210113L;
private static final long serialVersionUID = -1887682170119210113L;

@Inject
private Identity identity;
@Inject
private Identity identity;

@Inject
private FacesService facesService;
@Inject
private FacesService facesService;

@Inject
private OpenIdService openIdService;
@Inject
private OpenIdService openIdService;

@Inject
private AppConfiguration appConfiguration;
@Inject
private AppConfiguration appConfiguration;

public void processLogout() throws Exception {
opLogout();
identity.logout();
}
public void processLogout() throws Exception {
opLogout();
identity.logout();
}

public void processSsoLogout() throws Exception {
identity.logout();
identity.setWorkingParameter(OxTrustConstants.OXAUTH_SSO_SESSION_STATE, Boolean.TRUE);
}
public void processSsoLogout() throws Exception {
identity.logout();
identity.setWorkingParameter(OxTrustConstants.OXAUTH_SSO_SESSION_STATE, Boolean.TRUE);
}

public String postLogout() {
identity.logout();
return OxTrustConstants.RESULT_SUCCESS;
}
public String postLogout() {
identity.logout();
return OxTrustConstants.RESULT_SUCCESS;
}

protected void opLogout() throws Exception {
Object ssoSessionState = identity.getWorkingParameter(OxTrustConstants.OXAUTH_SSO_SESSION_STATE);
if (Boolean.TRUE.equals(ssoSessionState)) {
facesService.redirectToExternalURL(appConfiguration.getLogoutRedirectUrl());
return;
}
OauthData oauthData = identity.getOauthData();
Client client = ClientBuilder.newClient();
WebTarget target = client.target(openIdService.getOpenIdConfiguration().getEndSessionEndpoint());
if (oauthData.getSessionState() != null) {
target = target.queryParam(OxTrustConstants.OXAUTH_SESSION_STATE, oauthData.getSessionState());
}
if (oauthData.getIdToken() != null) {
target = target.queryParam(OxTrustConstants.OXAUTH_ID_TOKEN_HINT, oauthData.getIdToken());
}
target = target.queryParam(OxTrustConstants.OXAUTH_POST_LOGOUT_REDIRECT_URI,
appConfiguration.getLogoutRedirectUrl());
facesService.redirectToExternalURL(target.getUri().toString());
}
protected void opLogout() throws Exception {
Object ssoSessionState = identity.getWorkingParameter(OxTrustConstants.OXAUTH_SSO_SESSION_STATE);
if (Boolean.TRUE.equals(ssoSessionState)) {
facesService.redirectToExternalURL(appConfiguration.getLogoutRedirectUrl());
return;
}
OauthData oauthData = identity.getOauthData();
Client client = ClientBuilder.newClient();
WebTarget target = client.target(openIdService.getOpenIdConfiguration().getEndSessionEndpoint());
if (oauthData.getSessionState() != null) {
target = target.queryParam(OxTrustConstants.OXAUTH_SESSION_STATE, oauthData.getSessionState());
}
if (appConfiguration.isPassIdTokenHintToLogoutRedirectUri() && oauthData.getIdToken() != null) {
target = target.queryParam(OxTrustConstants.OXAUTH_ID_TOKEN_HINT, oauthData.getIdToken());
}
target = target.queryParam(OxTrustConstants.OXAUTH_POST_LOGOUT_REDIRECT_URI,
appConfiguration.getLogoutRedirectUrl());
facesService.redirectToExternalURL(target.getUri().toString());
}

}

0 comments on commit 78dc438

Please sign in to comment.