Author: anil.saldhana(a)jboss.com
Date: 2012-02-15 10:31:41 -0500 (Wed, 15 Feb 2012)
New Revision: 1393
Modified:
federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/IDPWebBrowserSSOValve.java
Log:
proper use of boolean
Modified:
federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/IDPWebBrowserSSOValve.java
===================================================================
---
federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/IDPWebBrowserSSOValve.java 2012-02-15
12:39:15 UTC (rev 1392)
+++
federation/trunk/picketlink-bindings/src/main/java/org/picketlink/identity/federation/bindings/tomcat/idp/IDPWebBrowserSSOValve.java 2012-02-15
15:31:41 UTC (rev 1393)
@@ -156,7 +156,7 @@
private Boolean ignoreIncomingSignatures = false;
private Boolean signOutgoingMessages = true;
-
+
/**
* Defines how the token's signature will be validated. If true is used the
token's issuer, otherwise the request.getRemoteAddr. Default false.
*/
@@ -234,10 +234,10 @@
{
this.validatingAliasToTokenIssuer = validatingAliasToTokenIssuer;
}
-
- public Boolean getValidatingAliasToTokenIssuer()
+
+ public Boolean getValidatingAliasToTokenIssuer()
{
- return validatingAliasToTokenIssuer;
+ return validatingAliasToTokenIssuer;
}
/**
@@ -530,8 +530,9 @@
{
samlDocumentHolder = webRequestUtil.getSAMLDocumentHolder(samlRequestMessage);
samlObject = samlDocumentHolder.getSamlObject();
-
- if (!(samlObject instanceof RequestAbstractType)) {
+
+ if (!(samlObject instanceof RequestAbstractType))
+ {
throw new RuntimeException(ErrorCodes.WRONG_TYPE +
samlObject.getClass().getName());
}
@@ -577,7 +578,7 @@
log.trace("Remote Host=" + request.getRemoteAddr());
log.trace("Validating Alias=" + tokenSignatureValidatingAlias);
}
-
+
PublicKey validatingKey = CoreConfigUtil.getValidatingKey(keyManager,
tokenSignatureValidatingAlias);
requestOptions.put(GeneralConstants.SENDER_PUBLIC_KEY, validatingKey);
requestOptions.put(GeneralConstants.DECRYPTING_KEY,
keyManager.getSigningKey());
@@ -686,20 +687,22 @@
private String getTokenSignatureValidatingAlias(Request request, String issuer)
{
String issuerHost = request.getRemoteAddr();
-
- if (this.validatingAliasToTokenIssuer) {
+
+ if (this.validatingAliasToTokenIssuer)
+ {
try
{
issuerHost = new URL(issuer).getHost();
}
catch (MalformedURLException e)
{
- if (trace) {
+ if (trace)
+ {
log.trace("Token issuer is not a valid URL: " + issuer + ".
Using the requester address instead.", e);
}
}
}
-
+
return issuerHost;
}
@@ -713,7 +716,7 @@
Document samlResponse = null;
String destination = null;
- Boolean requestedPostProfile = null;
+ boolean requestedPostProfile = false;
//Get the SAML Response Message
String samlResponseMessage = (String)
session.getNote(GeneralConstants.SAML_RESPONSE_KEY);
@@ -731,18 +734,18 @@
{
samlDocumentHolder = webRequestUtil.getSAMLDocumentHolder(samlResponseMessage);
samlObject = samlDocumentHolder.getSamlObject();
-
+
if (!(samlObject instanceof StatusResponseType))
{
throw new RuntimeException(ErrorCodes.WRONG_TYPE +
samlObject.getClass().getName());
}
-
+
boolean isPost = webRequestUtil.hasSAMLRequestInPostProfile();
boolean isValid = false;
StatusResponseType statusResponseType = (StatusResponseType) samlObject;
String issuer = statusResponseType.getIssuer().getValue();
String tokenValidatingAlias = getTokenSignatureValidatingAlias(request,
issuer);
-
+
if (isPost)
{
//Validate
@@ -827,7 +830,7 @@
.setAreWeSendingRequest(willSendRequest).setPrivateKey(null).setSupportSignature(false)
.setServletResponse(response).setPostBindingRequested(requestedPostProfile);
- if (requestedPostProfile != null)
+ if (requestedPostProfile)
holder.setPostBindingRequested(requestedPostProfile);
else
holder.setPostBindingRequested(postProfile);
@@ -1123,9 +1126,9 @@
log.info("Did not find picketlink-sts.xml. We will install default
configuration");
sts.installDefaultConfiguration();
}
- else
+ else
sts.installDefaultConfiguration(stsTokenConfigFile.toURI().toString());
-
+
if (this.signOutgoingMessages)
{
KeyProviderType keyProvider = this.idpConfiguration.getKeyProvider();
Show replies by date