Skip to content

Commit

Permalink
feat(jans-auth-server): code clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriyz committed Dec 28, 2021
1 parent 630605d commit b701988
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
*/
public class EndSessionUtils {

private final static Logger log = LoggerFactory.getLogger(EndSessionUtils.class);
private static final Logger log = LoggerFactory.getLogger(EndSessionUtils.class);

private EndSessionUtils() {
}
Expand All @@ -41,9 +41,9 @@ public static void callRpWithBackchannelUri(final String backchannelLogoutUri, S
javax.ws.rs.client.Client client = ((ResteasyClientBuilder) ClientBuilder.newBuilder()).httpEngine(ClientFactory.instance().createEngine(true)).build();
WebTarget target = client.target(backchannelLogoutUri);

log.debug("Calling RP with backchannel, backchannel_logout_uri: " + backchannelLogoutUri);
log.debug("Calling RP with backchannel, backchannel_logout_uri: {}", backchannelLogoutUri);
try (Response response = target.request().post(Entity.form(new Form("logout_token", logoutToken)))) {
log.debug("Backchannel RP response, status: " + response.getStatus() + ", backchannel_logout_uri" + backchannelLogoutUri);
log.debug("Backchannel RP response, status: {}, backchannel_logout_uri: {}", response.getStatus(), backchannelLogoutUri);
} catch (Exception e) {
log.error("Failed to call backchannel_logout_uri" + backchannelLogoutUri + ", message: " + e.getMessage(), e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import io.jans.as.server.model.token.JwrService;
import io.jans.as.server.service.SectorIdentifierService;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.BooleanUtils;
import org.json.JSONObject;
import org.msgpack.core.Preconditions;
import org.slf4j.Logger;
Expand Down Expand Up @@ -58,7 +59,7 @@ public JsonWebResponse createLogoutToken(Client rpClient, String outsideSid, Use
jwrService.encode(jwr, rpClient);
return jwr;
} catch (Exception e) {
log.error("Failed to create logout_token for client:" + rpClient.getClientId());
log.error("Failed to create logout_token for client: {}", rpClient.getClientId());
return null;
}
}
Expand All @@ -77,7 +78,7 @@ private void fillClaims(JsonWebResponse jwr, Client client, String outsideSid, U
jwr.getClaims().setClaim("events", getLogoutTokenEvents());
Audience.setAudience(jwr.getClaims(), client);

if (StringUtils.isNotBlank(outsideSid) && client.getAttributes().getBackchannelLogoutSessionRequired()) {
if (StringUtils.isNotBlank(outsideSid) && BooleanUtils.isTrue(client.getAttributes().getBackchannelLogoutSessionRequired())) {
jwr.getClaims().setClaim("sid", outsideSid);
}

Expand Down

0 comments on commit b701988

Please sign in to comment.