You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2017/02/13 11:36:21 UTC
[05/18] cxf-fediz git commit: Whitespace cleanup
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/console/UserConsoleService.java
----------------------------------------------------------------------
diff --git a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/console/UserConsoleService.java b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/console/UserConsoleService.java
index ef29295..3d3abb5 100644
--- a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/console/UserConsoleService.java
+++ b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/console/UserConsoleService.java
@@ -34,18 +34,18 @@ public class UserConsoleService {
private SecurityContext sc;
private ClientRegistrationService clientRegService;
-
+
@Context
public void setSecurityContext(SecurityContext securityContext) {
this.sc = securityContext;
clientRegService.setSecurityContext(securityContext);
}
-
-
+
+
@GET
@Produces(MediaType.TEXT_HTML)
public UserConsole getConsole() {
- return new UserConsole(getUserName());
+ return new UserConsole(getUserName());
}
private String getUserName() {
return sc.getUserPrincipal().getName();
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/handler/hrd/ApplicationContextProvider.java
----------------------------------------------------------------------
diff --git a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/handler/hrd/ApplicationContextProvider.java b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/handler/hrd/ApplicationContextProvider.java
index e18ebff..82d5503 100644
--- a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/handler/hrd/ApplicationContextProvider.java
+++ b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/handler/hrd/ApplicationContextProvider.java
@@ -23,11 +23,11 @@ import org.springframework.context.ApplicationContextAware;
public class ApplicationContextProvider implements ApplicationContextAware {
private static ApplicationContext context;
-
+
public static ApplicationContext getApplicationContext() {
return context;
}
-
+
@Override
public void setApplicationContext(ApplicationContext ctx) {
context = ctx;
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/handler/hrd/ClientIdHomeRealmDiscovery.java
----------------------------------------------------------------------
diff --git a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/handler/hrd/ClientIdHomeRealmDiscovery.java b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/handler/hrd/ClientIdHomeRealmDiscovery.java
index 34753a5..c902085 100644
--- a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/handler/hrd/ClientIdHomeRealmDiscovery.java
+++ b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/handler/hrd/ClientIdHomeRealmDiscovery.java
@@ -34,27 +34,27 @@ import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
public class ClientIdHomeRealmDiscovery implements CallbackHandler {
-
+
private static final Logger LOG = LoggerFactory.getLogger(ClientIdHomeRealmDiscovery.class);
public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
for (int i = 0; i < callbacks.length; i++) {
if (callbacks[i] instanceof HomeRealmCallback) {
HomeRealmCallback callback = (HomeRealmCallback) callbacks[i];
-
+
HttpServletRequest request = callback.getRequest();
String clientId = request.getParameter("client_id");
-
+
if (clientId != null) {
ApplicationContext ctx = ApplicationContextProvider.getApplicationContext();
OAuthDataProvider dataManager = (OAuthDataProvider)ctx.getBean("oauthProvider");
-
+
Client client = dataManager.getClient(clientId);
callback.setHomeRealm(client.getHomeRealm());
LOG.debug("Retrieved home realm {}", callback.getHomeRealm());
-
+
}
-
+
} else {
LOG.warn("Callback is not an instance of HomeRealmCallback: {}", callbacks[i]);
}
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/handler/hrd/LoginHintHomeRealmDiscovery.java
----------------------------------------------------------------------
diff --git a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/handler/hrd/LoginHintHomeRealmDiscovery.java b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/handler/hrd/LoginHintHomeRealmDiscovery.java
index edb045e..52363f4 100644
--- a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/handler/hrd/LoginHintHomeRealmDiscovery.java
+++ b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/handler/hrd/LoginHintHomeRealmDiscovery.java
@@ -30,8 +30,8 @@ import org.slf4j.LoggerFactory;
/**
* This callback handler uses the login_hint parameter defined in OpenID Connect to discover the users home realm.
- *
- * It is expected that the login_hint will contain the users email address and that the domain name from the mail
+ *
+ * It is expected that the login_hint will contain the users email address and that the domain name from the mail
* address will be equal to the home realm identifier.
*/
public class LoginHintHomeRealmDiscovery implements CallbackHandler {
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/logout/LogoutService.java
----------------------------------------------------------------------
diff --git a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/logout/LogoutService.java b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/logout/LogoutService.java
index 431c020..d424ded 100644
--- a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/logout/LogoutService.java
+++ b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/logout/LogoutService.java
@@ -41,65 +41,65 @@ import org.apache.cxf.rs.security.oauth2.utils.OAuthConstants;
@Path("/logout")
public class LogoutService {
private static final String CLIENT_LOGOUT_URI = "client_logout_uri";
- @Context
+ @Context
private MessageContext mc;
private String relativeIdpLogoutUri;
private OAuthDataProvider dataProvider;
private FedizSubjectCreator subjectCreator = new FedizSubjectCreator();
-
+
private List<LogoutHandler> logoutHandlers;
-
+
@POST
public Response initiateLogoutPost(MultivaluedMap<String, String> params) {
- return doInitiateLogout(params);
+ return doInitiateLogout(params);
}
@GET
public Response initiateLogoutGet() {
- return doInitiateLogout(mc.getUriInfo().getQueryParameters());
+ return doInitiateLogout(mc.getUriInfo().getQueryParameters());
}
-
+
protected Response doInitiateLogout(MultivaluedMap<String, String> params) {
Client client = getClient(params);
UserSubject subject = subjectCreator.createUserSubject(mc, params);
-
+
if (logoutHandlers != null) {
-
+
for (LogoutHandler handler : logoutHandlers) {
handler.handleLogout(client, subject);
}
}
// Clear OIDC session now if core IDP will itself redirect to the client logout URI
-
+
// Redirect to the core IDP
URI idpLogoutUri = getAbsoluteIdpLogoutUri(client);
- return Response.seeOther(idpLogoutUri).build();
+ return Response.seeOther(idpLogoutUri).build();
}
-
+
@GET
@Path("/finalize")
public Response finalizeLogoutGet() {
// This method won't be needed if IDP will itself redirect to the client logout URI
- return doFinalizeLogout(mc.getUriInfo().getQueryParameters());
+ return doFinalizeLogout(mc.getUriInfo().getQueryParameters());
}
@POST
@Path("/finalize")
public Response finalizeLogoutPost(MultivaluedMap<String, String> params) {
// This method won't be needed if IDP will itself redirect to the client logout URI
- return doFinalizeLogout(params);
+ return doFinalizeLogout(params);
}
protected Response doFinalizeLogout(MultivaluedMap<String, String> params) {
-
+
// This method won't be needed if IDP will itself redirect to the client logout URI
-
-
+
+
// Ensure this method is not called by skipping the initiate logout which is
// why it may be simpler let IDP redirect directly to the client logout uri ?
-
+
// Clear the OIDC session
-
+
Client client = getClient(params);
URI clientLogoutUri = getClientLogoutUri(client);
- return Response.seeOther(clientLogoutUri).build();
+ return Response.seeOther(clientLogoutUri).build();
}
private URI getClientLogoutUri(Client client) {
@@ -123,15 +123,15 @@ public class LogoutService {
private URI getAbsoluteIdpLogoutUri(Client client) {
UriBuilder ub = mc.getUriInfo().getAbsolutePathBuilder();
ub.path(relativeIdpLogoutUri);
- //TODO: include a logout uri as a uri parameter, either
+ //TODO: include a logout uri as a uri parameter, either
// 1. "/finalize" URI for the IDP to redirect to this service again
- // or
- // 2. may be let IDP redirect straight to getClientLogoutUri(client) ?
-
+ // or
+ // 2. may be let IDP redirect straight to getClientLogoutUri(client) ?
+
UriBuilder ub2 = mc.getUriInfo().getAbsolutePathBuilder();
ub2.path("finalize");
ub.queryParam("wreply", ub2.build());
-
+
return ub.build();
}
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/logout/SignoutQueryHandler.java
----------------------------------------------------------------------
diff --git a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/logout/SignoutQueryHandler.java b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/logout/SignoutQueryHandler.java
index 89c7ffd..97dd188 100644
--- a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/logout/SignoutQueryHandler.java
+++ b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/logout/SignoutQueryHandler.java
@@ -32,7 +32,7 @@ import org.apache.cxf.fediz.core.spi.SignOutQueryCallback;
import org.apache.cxf.rs.security.oauth2.utils.OAuthConstants;
/**
- * Set the client_id on the signout request to the IdP. This is needed after we redirect to the "finalize" method of
+ * Set the client_id on the signout request to the IdP. This is needed after we redirect to the "finalize" method of
* the LogoutService.
*/
public class SignoutQueryHandler implements CallbackHandler {
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/logout/TokenCleanupHandler.java
----------------------------------------------------------------------
diff --git a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/logout/TokenCleanupHandler.java b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/logout/TokenCleanupHandler.java
index 3a3c356..ab38cea 100644
--- a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/logout/TokenCleanupHandler.java
+++ b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/logout/TokenCleanupHandler.java
@@ -29,7 +29,7 @@ import org.apache.cxf.rs.security.oauth2.utils.OAuthConstants;
public class TokenCleanupHandler implements LogoutHandler {
private OAuthDataProvider dataProvider;
private boolean removeTokensForAllClients;
-
+
@Override
public void handleLogout(Client client, UserSubject subject) {
if (removeTokensForAllClients) {
@@ -41,7 +41,7 @@ public class TokenCleanupHandler implements LogoutHandler {
// Removing the access token should remove the refresh token which links to it
// If necessary, refresh tokens can also be explicitly revoked
}
-
+
}
public void setDataProvider(OAuthDataProvider dataProvider) {
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/FedizSAMLDelegationHandler.java
----------------------------------------------------------------------
diff --git a/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/FedizSAMLDelegationHandler.java b/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/FedizSAMLDelegationHandler.java
index 2579088..f5ad8ac 100644
--- a/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/FedizSAMLDelegationHandler.java
+++ b/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/FedizSAMLDelegationHandler.java
@@ -29,23 +29,23 @@ import org.apache.wss4j.common.saml.SamlAssertionWrapper;
/**
* The SAML TokenDelegationHandler implementation. It disallows ActAs or OnBehalfOf for
* all cases apart from the case of a Bearer SAML Token. It differs from the SAMLDelegationHandler
- * in the STS core, in that it doesn't require that the AppliesTo address match an
+ * in the STS core, in that it doesn't require that the AppliesTo address match an
* AudienceRestriction address in the token.
*/
-public class FedizSAMLDelegationHandler
+public class FedizSAMLDelegationHandler
extends org.apache.cxf.sts.token.delegation.SAMLDelegationHandler {
-
+
@Override
public boolean canHandleToken(ReceivedToken delegateTarget) {
return super.canHandleToken(delegateTarget);
}
@Override
- public TokenDelegationResponse isDelegationAllowed(TokenDelegationParameters tokenParameters) {
+ public TokenDelegationResponse isDelegationAllowed(TokenDelegationParameters tokenParameters) {
return super.isDelegationAllowed(tokenParameters);
}
@Override
protected List<String> getAudienceRestrictions(SamlAssertionWrapper assertion) {
return Collections.emptyList();
}
-
+
}
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/FedizX509DelegationHandler.java
----------------------------------------------------------------------
diff --git a/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/FedizX509DelegationHandler.java b/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/FedizX509DelegationHandler.java
index 4c3107d..f85a337 100644
--- a/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/FedizX509DelegationHandler.java
+++ b/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/FedizX509DelegationHandler.java
@@ -33,9 +33,9 @@ import org.slf4j.LoggerFactory;
* A delegation handler to allow X.509 Certificates.
*/
public class FedizX509DelegationHandler implements TokenDelegationHandler {
-
+
private static final Logger LOG = LoggerFactory.getLogger(FedizX509DelegationHandler.class);
-
+
public boolean canHandleToken(ReceivedToken delegateTarget) {
Object token = delegateTarget.getToken();
if (token instanceof Element) {
@@ -48,24 +48,24 @@ public class FedizX509DelegationHandler implements TokenDelegationHandler {
}
return false;
}
-
+
public TokenDelegationResponse isDelegationAllowed(TokenDelegationParameters tokenParameters) {
TokenDelegationResponse response = new TokenDelegationResponse();
ReceivedToken delegateTarget = tokenParameters.getToken();
response.setToken(delegateTarget);
-
+
if (!delegateTarget.isDOMElement()) {
return response;
}
-
+
if (delegateTarget.getState() == STATE.VALID && delegateTarget.getPrincipal() != null) {
response.setDelegationAllowed(true);
LOG.debug("Delegation is allowed for: " + delegateTarget.getPrincipal());
} else {
LOG.debug("Delegation is not allowed, as the token is invalid or the principal is null");
}
-
+
return response;
}
-
+
}
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/FileClaimsHandler.java
----------------------------------------------------------------------
diff --git a/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/FileClaimsHandler.java b/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/FileClaimsHandler.java
index bfe0b97..dcdb072 100644
--- a/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/FileClaimsHandler.java
+++ b/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/FileClaimsHandler.java
@@ -35,7 +35,7 @@ import org.apache.cxf.sts.claims.ProcessedClaimCollection;
*/
public class FileClaimsHandler implements ClaimsHandler {
- public static final URI ROLE =
+ public static final URI ROLE =
URI.create("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/role");
private Map<String, Map<String, String>> userClaims;
@@ -48,16 +48,16 @@ public class FileClaimsHandler implements ClaimsHandler {
public Map<String, Map<String, String>> getUserClaims() {
return userClaims;
}
-
+
public void setSupportedClaims(List<URI> supportedClaims) {
this.supportedClaims = supportedClaims;
}
-
+
@Override
public List<URI> getSupportedClaimTypes() {
return Collections.unmodifiableList(this.supportedClaims);
}
-
+
@Override
public ProcessedClaimCollection retrieveClaimValues(ClaimCollection claims,
@@ -78,7 +78,7 @@ public class FileClaimsHandler implements ClaimsHandler {
if (claims.size() > 0) {
ProcessedClaimCollection claimCollection = new ProcessedClaimCollection();
- for (Claim requestClaim : claims) {
+ for (Claim requestClaim : claims) {
String claimValue = claimMap.get(requestClaim.getClaimType().toString());
if (claimValue != null) {
ProcessedClaim claim = new ProcessedClaim();
@@ -87,7 +87,7 @@ public class FileClaimsHandler implements ClaimsHandler {
claim.setOriginalIssuer("Original Issuer");
claim.addValue(claimValue);
claimCollection.add(claim);
- }
+ }
}
return claimCollection;
}
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/IdentityMapperImpl.java
----------------------------------------------------------------------
diff --git a/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/IdentityMapperImpl.java b/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/IdentityMapperImpl.java
index 4640391..cd80630 100644
--- a/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/IdentityMapperImpl.java
+++ b/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/IdentityMapperImpl.java
@@ -32,7 +32,7 @@ import org.apache.wss4j.common.principal.CustomTokenPrincipal;
public class IdentityMapperImpl implements IdentityMapper {
private static final Logger LOG = LogUtils.getL7dLogger(IdentityMapperImpl.class);
-
+
/**
* Map a principal in the source realm to the target realm
* @param sourceRealm the source realm of the Principal
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/RealmExtensionIdentityMapper.java
----------------------------------------------------------------------
diff --git a/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/RealmExtensionIdentityMapper.java b/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/RealmExtensionIdentityMapper.java
index f30caca..3a03cab 100644
--- a/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/RealmExtensionIdentityMapper.java
+++ b/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/RealmExtensionIdentityMapper.java
@@ -39,7 +39,7 @@ public class RealmExtensionIdentityMapper implements IdentityMapper {
/**
* Map a principal in the source realm to the target realm
- *
+ *
* @param sourceRealm the source realm of the Principal
* @param sourcePrincipal the principal in the source realm
* @param targetRealm the target realm of the Principal
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/RealmFileClaimsHandler.java
----------------------------------------------------------------------
diff --git a/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/RealmFileClaimsHandler.java b/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/RealmFileClaimsHandler.java
index f0930b5..accaa0d 100644
--- a/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/RealmFileClaimsHandler.java
+++ b/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/RealmFileClaimsHandler.java
@@ -38,7 +38,7 @@ import org.apache.cxf.sts.claims.ProcessedClaimCollection;
public class RealmFileClaimsHandler implements ClaimsHandler {
private static final Logger LOG = LogUtils.getL7dLogger(RealmFileClaimsHandler.class);
-
+
private Map<String, Map<String, String>> userClaims;
private List<URI> supportedClaims;
private String realm;
@@ -50,11 +50,11 @@ public class RealmFileClaimsHandler implements ClaimsHandler {
public Map<String, Map<String, String>> getUserClaims() {
return userClaims;
}
-
+
public void setSupportedClaims(List<URI> supportedClaims) {
this.supportedClaims = supportedClaims;
}
-
+
public void setRealm(String realm) {
this.realm = realm;
}
@@ -62,17 +62,17 @@ public class RealmFileClaimsHandler implements ClaimsHandler {
public String getRealm() {
return realm;
}
-
+
@Override
public List<URI> getSupportedClaimTypes() {
return Collections.unmodifiableList(this.supportedClaims);
}
-
+
@Override
public ProcessedClaimCollection retrieveClaimValues(ClaimCollection claims,
ClaimsParameters parameters) {
-
+
if (parameters.getRealm() == null || !parameters.getRealm().equalsIgnoreCase(getRealm())) {
LOG.fine("Realm '" + parameters.getRealm() + "' doesn't match with configured realm '" + getRealm() + "'");
return new ProcessedClaimCollection();
@@ -96,7 +96,7 @@ public class RealmFileClaimsHandler implements ClaimsHandler {
if (claims.size() > 0) {
ProcessedClaimCollection claimCollection = new ProcessedClaimCollection();
- for (Claim requestClaim : claims) {
+ for (Claim requestClaim : claims) {
String claimValue = claimMap.get(requestClaim.getClaimType().toString());
if (claimValue != null) {
ProcessedClaim claim = new ProcessedClaim();
@@ -105,7 +105,7 @@ public class RealmFileClaimsHandler implements ClaimsHandler {
claim.setOriginalIssuer("Original Issuer");
claim.addValue(claimValue);
claimCollection.add(claim);
- }
+ }
}
return claimCollection;
}
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/SamlRealmCodec.java
----------------------------------------------------------------------
diff --git a/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/SamlRealmCodec.java b/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/SamlRealmCodec.java
index 46d9689..f045c01 100644
--- a/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/SamlRealmCodec.java
+++ b/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/SamlRealmCodec.java
@@ -32,7 +32,7 @@ public class SamlRealmCodec implements SAMLRealmCodec {
private static final Logger LOG = LoggerFactory.getLogger(SamlRealmCodec.class);
private boolean uppercase = true;
-
+
@Override
public String getRealmFromToken(SamlAssertionWrapper assertion) {
SAMLKeyInfo ki = assertion.getSignatureKeyInfo();
@@ -45,7 +45,7 @@ public class SamlRealmCodec implements SAMLRealmCodec {
protected String parseCNValue(String name) {
int len = name.indexOf(",") > 0 ? name.indexOf(",") : name.length();
String realm = name.substring(name.indexOf("CN=") + 3, len);
-
+
if (uppercase) {
realm = realm.toUpperCase();
}
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/UriRealmParser.java
----------------------------------------------------------------------
diff --git a/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/UriRealmParser.java b/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/UriRealmParser.java
index 2fca3a3..b9a8e77 100644
--- a/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/UriRealmParser.java
+++ b/services/sts/src/main/java/org/apache/cxf/fediz/service/sts/realms/UriRealmParser.java
@@ -55,7 +55,7 @@ public class UriRealmParser implements RealmParser {
LOG.warn("Unknown realm: " + realm);
throw new STSException("Unknown realm: " + realm);
}
-
+
LOG.debug("URI realm parsed: " + realm);
return realm;
}
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/sts/src/test/java/org/apache/cxf/fediz/sts/AbstractSTSTest.java
----------------------------------------------------------------------
diff --git a/services/sts/src/test/java/org/apache/cxf/fediz/sts/AbstractSTSTest.java b/services/sts/src/test/java/org/apache/cxf/fediz/sts/AbstractSTSTest.java
index 0c33431..0e6b104 100644
--- a/services/sts/src/test/java/org/apache/cxf/fediz/sts/AbstractSTSTest.java
+++ b/services/sts/src/test/java/org/apache/cxf/fediz/sts/AbstractSTSTest.java
@@ -115,11 +115,11 @@ public abstract class AbstractSTSTest {
return tokenType;
}
-
+
//CHECKSTYLE:OFF
protected SecurityToken requestSecurityTokenUsernamePassword(String username, String password,
- String tokenType, String keyType, String realm,
- Bus bus, TLSClientParameters tlsClientParameters,
+ String tokenType, String keyType, String realm,
+ Bus bus, TLSClientParameters tlsClientParameters,
String baseEndpointUrl)
throws Exception {
STSClient stsClient = new STSClient(bus);
@@ -149,10 +149,10 @@ public abstract class AbstractSTSTest {
protected SecurityToken requestSecurityTokenOnbehalfOf(String tokenType, String keyType, String realm,
String appliesTo, List<String> claims, Element supportingToken,
- Bus bus, TLSClientParameters tlsClientParameters,
+ Bus bus, TLSClientParameters tlsClientParameters,
String baseEndpointUrl)
throws Exception {
-
+
STSClient stsClient = new STSClient(bus);
String endpointUrl = baseEndpointUrl + realm + "/STSServiceTransport";
@@ -290,7 +290,7 @@ public abstract class AbstractSTSTest {
SamlAssertionWrapper assertion) {
String expectedSamlUser = testProps.getProperty("samluser");
String samlUser = assertion.getSaml2().getSubject().getNameID().getValue();
- Assert.assertEquals("Expected SAML subject '" + expectedSamlUser + "' [" + samlUser + "]",
+ Assert.assertEquals("Expected SAML subject '" + expectedSamlUser + "' [" + samlUser + "]",
expectedSamlUser.toUpperCase(), samlUser.toUpperCase());
}
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/sts/src/test/java/org/apache/cxf/fediz/sts/Utils.java
----------------------------------------------------------------------
diff --git a/services/sts/src/test/java/org/apache/cxf/fediz/sts/Utils.java b/services/sts/src/test/java/org/apache/cxf/fediz/sts/Utils.java
index 9bee17f..99fee00 100644
--- a/services/sts/src/test/java/org/apache/cxf/fediz/sts/Utils.java
+++ b/services/sts/src/test/java/org/apache/cxf/fediz/sts/Utils.java
@@ -35,9 +35,9 @@ import org.apache.cxf.configuration.security.FiltersType;
public final class Utils {
- private Utils() {
+ private Utils() {
}
-
+
public static void initTLSClientParameters(TLSClientParameters tlsClientParameters, String keystoreFile,
String keystorePassword, String keyPassword,
String truststoreFile, String trustPassword)
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/sts/src/test/java/org/apache/cxf/fediz/sts/realms/ITCrossRealmTest.java
----------------------------------------------------------------------
diff --git a/services/sts/src/test/java/org/apache/cxf/fediz/sts/realms/ITCrossRealmTest.java b/services/sts/src/test/java/org/apache/cxf/fediz/sts/realms/ITCrossRealmTest.java
index 6187a2c..076ddb6 100644
--- a/services/sts/src/test/java/org/apache/cxf/fediz/sts/realms/ITCrossRealmTest.java
+++ b/services/sts/src/test/java/org/apache/cxf/fediz/sts/realms/ITCrossRealmTest.java
@@ -93,11 +93,11 @@ public class ITCrossRealmTest extends AbstractSTSTest {
Assert.assertTrue(SAML2_TOKEN_TYPE.equals(idpToken.getTokenType()));
Assert.assertTrue(idpToken.getToken() != null);
-
+
SamlAssertionWrapper assertion = new SamlAssertionWrapper(idpToken.getToken());
validateIssuer(assertion, "STS Realm A");
-
+
List<String> claimsList = null;
String claims = testProps.getProperty(PROPERTY_CLAIMS);
if (claims != null && claims.length() > 0) {
@@ -107,10 +107,10 @@ public class ITCrossRealmTest extends AbstractSTSTest {
claimsList.add(st.nextToken());
}
}
-
+
// Need client auth for the second call
tlsClientParameters = initTLSClientParameters(testProps, true);
-
+
SecurityToken rpToken = requestSecurityTokenOnbehalfOf(
SAML2_TOKEN_TYPE,
BEARER_KEYTYPE,
@@ -124,7 +124,7 @@ public class ITCrossRealmTest extends AbstractSTSTest {
Assert.assertTrue(SAML2_TOKEN_TYPE.equals(rpToken.getTokenType()));
Assert.assertTrue(rpToken.getToken() != null);
-
+
assertion = new SamlAssertionWrapper(rpToken.getToken());
this.validateSubject(testProps, assertion);
validateIssuer(assertion, "STS Realm B");
@@ -138,7 +138,7 @@ public class ITCrossRealmTest extends AbstractSTSTest {
bus.shutdown(true);
}
-
+
/**
* Test issuing a token from REALM A and re-issue a token from REALM B
*/
@@ -179,11 +179,11 @@ public class ITCrossRealmTest extends AbstractSTSTest {
Assert.assertTrue(SAML2_TOKEN_TYPE.equals(idpToken.getTokenType()));
Assert.assertTrue(idpToken.getToken() != null);
-
+
SamlAssertionWrapper assertion = new SamlAssertionWrapper(idpToken.getToken());
validateIssuer(assertion, "STS Realm A");
-
+
List<String> claimsList = null;
String claims = testProps.getProperty(PROPERTY_CLAIMS);
if (claims != null && claims.length() > 0) {
@@ -193,10 +193,10 @@ public class ITCrossRealmTest extends AbstractSTSTest {
claimsList.add(st.nextToken());
}
}
-
+
// Need client auth for the second call
tlsClientParameters = initTLSClientParameters(testProps, true);
-
+
SecurityToken rpToken = requestSecurityTokenOnbehalfOf(
SAML2_TOKEN_TYPE,
BEARER_KEYTYPE,
@@ -210,11 +210,11 @@ public class ITCrossRealmTest extends AbstractSTSTest {
Assert.assertTrue(SAML2_TOKEN_TYPE.equals(rpToken.getTokenType()));
Assert.assertTrue(rpToken.getToken() != null);
-
+
assertion = new SamlAssertionWrapper(rpToken.getToken());
this.validateSubject(testProps, assertion);
validateIssuer(assertion, "STS Realm B");
-
+
List<Attribute> attributes = assertion.getSaml2().getAttributeStatements().get(0).getAttributes();
validateIssuedClaims(attributes, testProps);
@@ -227,5 +227,5 @@ public class ITCrossRealmTest extends AbstractSTSTest {
bus.shutdown(true);
}
-
+
}
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/services/sts/src/test/java/org/apache/cxf/fediz/sts/realms/RealmExtensionIdentityMapperTest.java
----------------------------------------------------------------------
diff --git a/services/sts/src/test/java/org/apache/cxf/fediz/sts/realms/RealmExtensionIdentityMapperTest.java b/services/sts/src/test/java/org/apache/cxf/fediz/sts/realms/RealmExtensionIdentityMapperTest.java
index 1cbac3e..4eb98e1 100644
--- a/services/sts/src/test/java/org/apache/cxf/fediz/sts/realms/RealmExtensionIdentityMapperTest.java
+++ b/services/sts/src/test/java/org/apache/cxf/fediz/sts/realms/RealmExtensionIdentityMapperTest.java
@@ -39,7 +39,7 @@ public class RealmExtensionIdentityMapperTest {
RealmExtensionIdentityMapper im = new RealmExtensionIdentityMapper();
assertEquals(RealmExtensionIdentityMapper.DEFAULT_DELIMITER, im.getDelimiter());
}
-
+
@Test
public void testRealmMappingSimpleUser() {
RealmExtensionIdentityMapper im = new RealmExtensionIdentityMapper();
@@ -47,7 +47,7 @@ public class RealmExtensionIdentityMapperTest {
assertNotNull(result);
assertEquals("user@realm-b", result.getName());
}
-
+
@Test
public void testRealmMappingComplexUser() {
RealmExtensionIdentityMapper im = new RealmExtensionIdentityMapper();
@@ -63,14 +63,14 @@ public class RealmExtensionIdentityMapperTest {
assertNotNull(result);
assertEquals("user-name@realm-b", result.getName());
}
-
+
@Test
public void testRealmMappingNullUser() {
RealmExtensionIdentityMapper im = new RealmExtensionIdentityMapper();
Principal result = im.mapPrincipal("realm-a", null, "realm-b");
assertNull(result);
}
-
+
@Test
public void testRealmMappingEmptyUserName() {
RealmExtensionIdentityMapper im = new RealmExtensionIdentityMapper();
@@ -78,7 +78,7 @@ public class RealmExtensionIdentityMapperTest {
assertNotNull(result);
assertEquals("@realm-b", result.getName());
}
-
+
@Test
public void testRealmMappingCustomDelimiter() {
RealmExtensionIdentityMapper im = new RealmExtensionIdentityMapper();
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/systests/custom/src/test/java/custom/CustomClaimsHandler.java
----------------------------------------------------------------------
diff --git a/systests/custom/src/test/java/custom/CustomClaimsHandler.java b/systests/custom/src/test/java/custom/CustomClaimsHandler.java
index fa4ddee..9ae77b8 100644
--- a/systests/custom/src/test/java/custom/CustomClaimsHandler.java
+++ b/systests/custom/src/test/java/custom/CustomClaimsHandler.java
@@ -41,7 +41,7 @@ import org.apache.wss4j.common.util.XMLUtils;
public class CustomClaimsHandler implements ClaimsHandler {
private static final Logger LOG = LogUtils.getL7dLogger(CustomClaimsHandler.class);
-
+
private Map<String, Map<String, String>> userClaims;
private List<URI> supportedClaims;
private String realm;
@@ -53,11 +53,11 @@ public class CustomClaimsHandler implements ClaimsHandler {
public Map<String, Map<String, String>> getUserClaims() {
return userClaims;
}
-
+
public void setSupportedClaims(List<URI> supportedClaims) {
this.supportedClaims = supportedClaims;
}
-
+
public void setRealm(String realm) {
this.realm = realm;
}
@@ -65,17 +65,17 @@ public class CustomClaimsHandler implements ClaimsHandler {
public String getRealm() {
return realm;
}
-
+
@Override
public List<URI> getSupportedClaimTypes() {
return Collections.unmodifiableList(this.supportedClaims);
}
-
+
@Override
public ProcessedClaimCollection retrieveClaimValues(ClaimCollection claims,
ClaimsParameters parameters) {
-
+
// Insist that a "realm" Custom Content is available in the RST with a value equal to "custom-realm"
List<Element> customContent = parameters.getTokenRequirements().getCustomContent();
boolean foundRealm = false;
@@ -89,7 +89,7 @@ public class CustomClaimsHandler implements ClaimsHandler {
}
}
}
-
+
if (!foundRealm || parameters.getRealm() == null || !parameters.getRealm().equalsIgnoreCase(getRealm())) {
LOG.fine("Realm '" + parameters.getRealm() + "' doesn't match with configured realm '" + getRealm() + "'");
return new ProcessedClaimCollection();
@@ -113,7 +113,7 @@ public class CustomClaimsHandler implements ClaimsHandler {
if (claims.size() > 0) {
ProcessedClaimCollection claimCollection = new ProcessedClaimCollection();
- for (Claim requestClaim : claims) {
+ for (Claim requestClaim : claims) {
String claimValue = claimMap.get(requestClaim.getClaimType().toString());
if (claimValue != null) {
ProcessedClaim claim = new ProcessedClaim();
@@ -122,7 +122,7 @@ public class CustomClaimsHandler implements ClaimsHandler {
claim.setOriginalIssuer("Original Issuer");
claim.addValue(claimValue);
claimCollection.add(claim);
- }
+ }
}
return claimCollection;
}
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/systests/custom/src/test/java/custom/CustomUTValidator.java
----------------------------------------------------------------------
diff --git a/systests/custom/src/test/java/custom/CustomUTValidator.java b/systests/custom/src/test/java/custom/CustomUTValidator.java
index a623411..f86910f 100644
--- a/systests/custom/src/test/java/custom/CustomUTValidator.java
+++ b/systests/custom/src/test/java/custom/CustomUTValidator.java
@@ -35,7 +35,7 @@ import org.apache.wss4j.dom.validate.UsernameTokenValidator;
import org.apache.wss4j.dom.validate.Validator;
/**
- * A Validator that checks for a custom "realm" parameter in the RST request and only allows
+ * A Validator that checks for a custom "realm" parameter in the RST request and only allows
* authentication if the value is equal to "custom-realm".
*/
public class CustomUTValidator implements Validator {
@@ -44,19 +44,19 @@ public class CustomUTValidator implements Validator {
if (credential == null || credential.getUsernametoken() == null) {
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "noCredential");
}
-
+
// Need to use SAAJ to get the SOAP Body as we are just using the UsernameTokenInterceptor
SOAPMessage soapMessage = getSOAPMessage((SoapMessage)data.getMsgContext());
try {
Element soapBody = SAAJUtils.getBody(soapMessage);
-
+
if (soapBody != null) {
// Find custom Element in the SOAP Body
Element realm = XMLUtils.findElement(soapBody, "realm", "http://cxf.apache.org/custom");
if (realm != null) {
String realmStr = realm.getTextContent();
if ("custom-realm".equals(realmStr)) {
-
+
UsernameTokenValidator validator = new UsernameTokenValidator();
return validator.validate(credential, data);
}
@@ -65,7 +65,7 @@ public class CustomUTValidator implements Validator {
} catch (SOAPException ex) {
// ignore
}
-
+
throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "noCredential");
}
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/systests/custom/src/test/java/org/apache/cxf/fediz/systests/custom/CustomParametersTest.java
----------------------------------------------------------------------
diff --git a/systests/custom/src/test/java/org/apache/cxf/fediz/systests/custom/CustomParametersTest.java b/systests/custom/src/test/java/org/apache/cxf/fediz/systests/custom/CustomParametersTest.java
index 4e22c65..af18315 100644
--- a/systests/custom/src/test/java/org/apache/cxf/fediz/systests/custom/CustomParametersTest.java
+++ b/systests/custom/src/test/java/org/apache/cxf/fediz/systests/custom/CustomParametersTest.java
@@ -82,7 +82,7 @@ public class CustomParametersTest {
WSSConfig.init();
}
- private static Tomcat startServer(boolean idp, String port)
+ private static Tomcat startServer(boolean idp, String port)
throws ServletException, LifecycleException, IOException {
Tomcat server = new Tomcat();
server.setPort(0);
@@ -113,17 +113,17 @@ public class CustomParametersTest {
httpsConnector.setAttribute("SSLEnabled", true);
server.getService().addConnector(httpsConnector);
-
+
if (idp) {
File stsWebapp = new File(baseDir + File.separator + server.getHost().getAppBase(), "fediz-idp-sts");
server.addWebapp("/fediz-idp-sts", stsWebapp.getAbsolutePath());
-
+
File idpWebapp = new File(baseDir + File.separator + server.getHost().getAppBase(), "fediz-idp");
server.addWebapp("/fediz-idp", idpWebapp.getAbsolutePath());
} else {
File rpWebapp = new File(baseDir + File.separator + server.getHost().getAppBase(), "simpleWebapp");
Context cxt = server.addWebapp("/fedizhelloworld", rpWebapp.getAbsolutePath());
-
+
// Substitute the IDP port. Necessary if running the test in eclipse where port filtering doesn't seem
// to work
File f = new File(currentDir + "/src/test/resources/fediz_config.xml");
@@ -132,13 +132,13 @@ public class CustomParametersTest {
inputStream.close();
if (content.contains("idp.https.port")) {
content = content.replaceAll("\\$\\{idp.https.port\\}", "" + idpHttpsPort);
-
+
File f2 = new File(baseDir + "/test-classes/fediz_config.xml");
try (FileOutputStream outputStream = new FileOutputStream(f2)) {
IOUtils.write(content, outputStream, "UTF-8");
}
}
-
+
FederationAuthenticator fa = new FederationAuthenticator();
fa.setConfigFile(currentDir + File.separator + "target" + File.separator
+ "test-classes" + File.separator + "fediz_config.xml");
@@ -155,7 +155,7 @@ public class CustomParametersTest {
shutdownServer(idpServer);
shutdownServer(rpServer);
}
-
+
private static void shutdownServer(Tomcat server) {
try {
if (server != null && server.getServer() != null
@@ -203,8 +203,8 @@ public class CustomParametersTest {
new UsernamePasswordCredentials(user, password));
webClient.getOptions().setJavaScriptEnabled(false);
-
- String authUrl = url + "&auth_realm="
+
+ String authUrl = url + "&auth_realm="
+ URLEncoder.encode("<realm xmlns=\"http://cxf.apache.org/custom\">custom-realm</realm>", "UTF-8");
HtmlPage idpPage = webClient.getPage(authUrl);
webClient.getOptions().setJavaScriptEnabled(true);
@@ -222,9 +222,9 @@ public class CustomParametersTest {
}
Assert.assertNotNull(wresult);
-
+
webClient.close();
-
+
// Unsuccessful test
webClient = new WebClient();
webClient.getOptions().setUseInsecureSSL(true);
@@ -233,7 +233,7 @@ public class CustomParametersTest {
new UsernamePasswordCredentials(user, password));
webClient.getOptions().setJavaScriptEnabled(false);
- authUrl = url + "&auth_realm="
+ authUrl = url + "&auth_realm="
+ URLEncoder.encode("<realm xmlns=\"http://cxf.apache.org/custom\">unknown-realm</realm>", "UTF-8");
try {
webClient.getPage(authUrl);
@@ -244,15 +244,15 @@ public class CustomParametersTest {
webClient.close();
}
-
+
@org.junit.Test
public void testCustomParameterViaRP() throws Exception {
String url = "https://localhost:" + getRpHttpsPort() + "/fedizhelloworld/secure/fedservlet";
String user = "alice";
String password = "ecila";
-
+
final String bodyTextContent = HTTPTestUtils.login(url, user, password, getIdpHttpsPort());
-
+
Assert.assertTrue("Principal not " + user,
bodyTextContent.contains("userPrincipal=" + user));
Assert.assertTrue("User " + user + " does not have role Admin",
@@ -273,5 +273,5 @@ public class CustomParametersTest {
bodyTextContent.contains(claim + "=alice@realma.org"));
}
-
+
}
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/systests/cxf/src/test/java/org/apache/cxf/fediz/integrationtests/federation/FederationTest.java
----------------------------------------------------------------------
diff --git a/systests/cxf/src/test/java/org/apache/cxf/fediz/integrationtests/federation/FederationTest.java b/systests/cxf/src/test/java/org/apache/cxf/fediz/integrationtests/federation/FederationTest.java
index 937d5af..3ab3875 100644
--- a/systests/cxf/src/test/java/org/apache/cxf/fediz/integrationtests/federation/FederationTest.java
+++ b/systests/cxf/src/test/java/org/apache/cxf/fediz/integrationtests/federation/FederationTest.java
@@ -36,10 +36,10 @@ public class FederationTest extends AbstractTests {
static String idpHttpsPort;
static String rpHttpsPort;
-
+
private static Tomcat idpServer;
private static Tomcat rpServer;
-
+
@BeforeClass
public static void init() {
System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.SimpleLog");
@@ -49,8 +49,8 @@ public class FederationTest extends AbstractTests {
System.setProperty("org.apache.commons.logging.simplelog.log.org.springframework.webflow", "info");
System.setProperty("org.apache.commons.logging.simplelog.log.org.springframework.security.web", "info");
System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.cxf.fediz", "info");
- System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.cxf", "info");
-
+ System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.cxf", "info");
+
idpHttpsPort = System.getProperty("idp.https.port");
// idpHttpsPort = "12345";
Assert.assertNotNull("Property 'idp.https.port' null", idpHttpsPort);
@@ -60,18 +60,18 @@ public class FederationTest extends AbstractTests {
initIdp();
initRp();
}
-
+
private static void initIdp() {
try {
idpServer = new Tomcat();
idpServer.setPort(0);
String currentDir = new File(".").getCanonicalPath();
idpServer.setBaseDir(currentDir + File.separator + "target");
-
+
idpServer.getHost().setAppBase("tomcat/idp/webapps");
idpServer.getHost().setAutoDeploy(true);
idpServer.getHost().setDeployOnStartup(true);
-
+
Connector httpsConnector = new Connector();
httpsConnector.setPort(Integer.parseInt(idpHttpsPort));
httpsConnector.setSecure(true);
@@ -87,27 +87,27 @@ public class FederationTest extends AbstractTests {
httpsConnector.setAttribute("SSLEnabled", true);
idpServer.getService().addConnector(httpsConnector);
-
+
idpServer.addWebapp("/fediz-idp-sts", "fediz-idp-sts");
idpServer.addWebapp("/fediz-idp", "fediz-idp");
-
+
idpServer.start();
} catch (Exception e) {
e.printStackTrace();
}
}
-
+
private static void initRp() {
try {
rpServer = new Tomcat();
rpServer.setPort(0);
String currentDir = new File(".").getCanonicalPath();
rpServer.setBaseDir(currentDir + File.separator + "target");
-
+
rpServer.getHost().setAppBase("tomcat/rp/webapps");
rpServer.getHost().setAutoDeploy(true);
rpServer.getHost().setDeployOnStartup(true);
-
+
Connector httpsConnector = new Connector();
httpsConnector.setPort(Integer.parseInt(rpHttpsPort));
httpsConnector.setSecure(true);
@@ -123,21 +123,21 @@ public class FederationTest extends AbstractTests {
httpsConnector.setAttribute("SSLEnabled", true);
rpServer.getService().addConnector(httpsConnector);
-
+
rpServer.addWebapp("/fedizhelloworld", "cxfWebapp");
-
+
rpServer.start();
} catch (Exception e) {
e.printStackTrace();
}
}
-
+
@AfterClass
public static void cleanup() {
shutdownServer(idpServer);
shutdownServer(rpServer);
}
-
+
private static void shutdownServer(Tomcat server) {
try {
if (server != null && server.getServer() != null
@@ -151,15 +151,15 @@ public class FederationTest extends AbstractTests {
e.printStackTrace();
}
}
-
+
public String getIdpHttpsPort() {
return idpHttpsPort;
}
-
+
public String getRpHttpsPort() {
return rpHttpsPort;
}
-
+
public String getServletContextName() {
return "fedizhelloworld";
}
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/systests/federation/oidcIdpWebapp/src/main/java/org/apache/cxf/fediz/oidc/idp/example/BasicAuthFilter.java
----------------------------------------------------------------------
diff --git a/systests/federation/oidcIdpWebapp/src/main/java/org/apache/cxf/fediz/oidc/idp/example/BasicAuthFilter.java b/systests/federation/oidcIdpWebapp/src/main/java/org/apache/cxf/fediz/oidc/idp/example/BasicAuthFilter.java
index 7a4e48e..f67ec0f 100644
--- a/systests/federation/oidcIdpWebapp/src/main/java/org/apache/cxf/fediz/oidc/idp/example/BasicAuthFilter.java
+++ b/systests/federation/oidcIdpWebapp/src/main/java/org/apache/cxf/fediz/oidc/idp/example/BasicAuthFilter.java
@@ -38,7 +38,7 @@ public class BasicAuthFilter extends WSS4JBasicAuthValidator implements Containe
public void filter(ContainerRequestContext requestContext) throws IOException {
Message message = JAXRSUtils.getCurrentMessage();
AuthorizationPolicy policy = message.get(AuthorizationPolicy.class);
-
+
if (policy == null || policy.getUserName() == null || policy.getPassword() == null) {
requestContext.abortWith(
Response.status(401).header("WWW-Authenticate", "Basic realm=\"IdP\"").build());
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/systests/federation/oidcIdpWebapp/src/main/java/org/apache/cxf/fediz/oidc/idp/example/CommonCallbackHandler.java
----------------------------------------------------------------------
diff --git a/systests/federation/oidcIdpWebapp/src/main/java/org/apache/cxf/fediz/oidc/idp/example/CommonCallbackHandler.java b/systests/federation/oidcIdpWebapp/src/main/java/org/apache/cxf/fediz/oidc/idp/example/CommonCallbackHandler.java
index b1d9527..5bc8c69 100644
--- a/systests/federation/oidcIdpWebapp/src/main/java/org/apache/cxf/fediz/oidc/idp/example/CommonCallbackHandler.java
+++ b/systests/federation/oidcIdpWebapp/src/main/java/org/apache/cxf/fediz/oidc/idp/example/CommonCallbackHandler.java
@@ -43,7 +43,7 @@ public class CommonCallbackHandler implements CallbackHandler {
&& pc.getIdentifier().startsWith("consumer-id")) {
pc.setPassword("this-is-a-secret");
break;
- }
+ }
}
}
}
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/systests/federation/oidcIdpWebapp/src/main/java/org/apache/cxf/fediz/oidc/idp/example/EHCacheOIDCTokenProvider.java
----------------------------------------------------------------------
diff --git a/systests/federation/oidcIdpWebapp/src/main/java/org/apache/cxf/fediz/oidc/idp/example/EHCacheOIDCTokenProvider.java b/systests/federation/oidcIdpWebapp/src/main/java/org/apache/cxf/fediz/oidc/idp/example/EHCacheOIDCTokenProvider.java
index 2dfb7de..bb05f21 100644
--- a/systests/federation/oidcIdpWebapp/src/main/java/org/apache/cxf/fediz/oidc/idp/example/EHCacheOIDCTokenProvider.java
+++ b/systests/federation/oidcIdpWebapp/src/main/java/org/apache/cxf/fediz/oidc/idp/example/EHCacheOIDCTokenProvider.java
@@ -31,13 +31,13 @@ import org.apache.cxf.rs.security.oauth2.provider.OAuthServiceException;
* Extend the DefaultEHCacheCodeDataProvider to allow OpenId
*/
public class EHCacheOIDCTokenProvider extends DefaultEHCacheCodeDataProvider {
-
+
@Override
public List<OAuthPermission> convertScopeToPermissions(Client client, List<String> requestedScopes) {
if (requestedScopes.isEmpty()) {
return Collections.emptyList();
}
-
+
List<OAuthPermission> permissions = new ArrayList<>();
for (String requestedScope : requestedScopes) {
if ("openid".equals(requestedScope)) {
@@ -47,7 +47,7 @@ public class EHCacheOIDCTokenProvider extends DefaultEHCacheCodeDataProvider {
throw new OAuthServiceException("invalid_scope");
}
}
-
+
return permissions;
}
}
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/systests/federation/oidcIdpWebapp/src/main/java/org/apache/cxf/fediz/oidc/idp/example/IdTokenProviderImpl.java
----------------------------------------------------------------------
diff --git a/systests/federation/oidcIdpWebapp/src/main/java/org/apache/cxf/fediz/oidc/idp/example/IdTokenProviderImpl.java b/systests/federation/oidcIdpWebapp/src/main/java/org/apache/cxf/fediz/oidc/idp/example/IdTokenProviderImpl.java
index a6d1684..5785350 100644
--- a/systests/federation/oidcIdpWebapp/src/main/java/org/apache/cxf/fediz/oidc/idp/example/IdTokenProviderImpl.java
+++ b/systests/federation/oidcIdpWebapp/src/main/java/org/apache/cxf/fediz/oidc/idp/example/IdTokenProviderImpl.java
@@ -36,7 +36,7 @@ public class IdTokenProviderImpl implements IdTokenProvider {
@Override
public IdToken getIdToken(String clientId, UserSubject authenticatedUser, List<String> scopes) {
IdToken token = new IdToken();
-
+
Calendar cal = Calendar.getInstance();
cal.add(Calendar.SECOND, 60);
token.setExpiryTime(cal.getTimeInMillis() / 1000L);
@@ -46,7 +46,7 @@ public class IdTokenProviderImpl implements IdTokenProvider {
token.setSubject(authenticatedUser.getLogin().toLowerCase());
token.setClaim("preferred_username", authenticatedUser.getLogin().toLowerCase());
token.setIssuer("OIDC IdP");
-
+
return token;
}
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/systests/federation/samlIdpWebapp/src/main/java/org/apache/cxf/fediz/samlsso/example/BasicAuthFilter.java
----------------------------------------------------------------------
diff --git a/systests/federation/samlIdpWebapp/src/main/java/org/apache/cxf/fediz/samlsso/example/BasicAuthFilter.java b/systests/federation/samlIdpWebapp/src/main/java/org/apache/cxf/fediz/samlsso/example/BasicAuthFilter.java
index 9007ab6..32957b6 100644
--- a/systests/federation/samlIdpWebapp/src/main/java/org/apache/cxf/fediz/samlsso/example/BasicAuthFilter.java
+++ b/systests/federation/samlIdpWebapp/src/main/java/org/apache/cxf/fediz/samlsso/example/BasicAuthFilter.java
@@ -44,17 +44,17 @@ import org.apache.wss4j.dom.validate.UsernameTokenValidator;
* A simple filter to validate a Basic Auth username/password via a CallbackHandler
*/
public class BasicAuthFilter implements ContainerRequestFilter {
-
+
static {
WSSConfig.init();
}
private CallbackHandler callbackHandler;
-
+
public void filter(ContainerRequestContext requestContext) throws IOException {
Message message = JAXRSUtils.getCurrentMessage();
AuthorizationPolicy policy = message.get(AuthorizationPolicy.class);
-
+
if (policy == null || policy.getUserName() == null || policy.getPassword() == null) {
requestContext.abortWith(
Response.status(401).header("WWW-Authenticate", "Basic realm=\"IdP\"").build());
@@ -65,13 +65,13 @@ public class BasicAuthFilter implements ContainerRequestFilter {
UsernameToken token = convertPolicyToToken(policy);
Credential credential = new Credential();
credential.setUsernametoken(token);
-
+
RequestData data = new RequestData();
data.setMsgContext(message);
data.setCallbackHandler(callbackHandler);
UsernameTokenValidator validator = new UsernameTokenValidator();
credential = validator.validate(credential, data);
-
+
// Create a Principal/SecurityContext
Principal p = null;
if (credential != null && credential.getPrincipal() != null) {
@@ -87,17 +87,17 @@ public class BasicAuthFilter implements ContainerRequestFilter {
}
}
- protected UsernameToken convertPolicyToToken(AuthorizationPolicy policy)
+ protected UsernameToken convertPolicyToToken(AuthorizationPolicy policy)
throws Exception {
Document doc = DOMUtils.createDocument();
- UsernameToken token = new UsernameToken(false, doc,
+ UsernameToken token = new UsernameToken(false, doc,
WSConstants.PASSWORD_TEXT);
token.setName(policy.getUserName());
token.setPassword(policy.getPassword());
return token;
}
-
+
protected SecurityContext createSecurityContext(final Principal p) {
return new SecurityContext() {
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/systests/federation/samlIdpWebapp/src/main/java/org/apache/cxf/fediz/samlsso/example/SAML2CallbackHandler.java
----------------------------------------------------------------------
diff --git a/systests/federation/samlIdpWebapp/src/main/java/org/apache/cxf/fediz/samlsso/example/SAML2CallbackHandler.java b/systests/federation/samlIdpWebapp/src/main/java/org/apache/cxf/fediz/samlsso/example/SAML2CallbackHandler.java
index b4c3db4..b29379d 100644
--- a/systests/federation/samlIdpWebapp/src/main/java/org/apache/cxf/fediz/samlsso/example/SAML2CallbackHandler.java
+++ b/systests/federation/samlIdpWebapp/src/main/java/org/apache/cxf/fediz/samlsso/example/SAML2CallbackHandler.java
@@ -40,11 +40,11 @@ import org.apache.wss4j.common.saml.builder.SAML2Constants;
/**
* A Callback Handler implementation for a SAML 2 assertion for use by the SAML SSO IdP. By
- * default it creates a SAML 2.0 Assertion with an AuthenticationStatement. If a list of roles
+ * default it creates a SAML 2.0 Assertion with an AuthenticationStatement. If a list of roles
* are also supplied, it will insert them as part of an AttributeStatement.
*/
public class SAML2CallbackHandler implements CallbackHandler {
-
+
private String subjectName;
private String subjectQualifier;
private String confirmationMethod = SAML2Constants.CONF_BEARER;
@@ -52,7 +52,7 @@ public class SAML2CallbackHandler implements CallbackHandler {
private String subjectNameIDFormat;
private ConditionsBean conditions;
private SubjectConfirmationDataBean subjectConfirmationData;
-
+
private void createAndSetStatement(SAMLCallback callback) {
AuthenticationStatementBean authBean = new AuthenticationStatementBean();
authBean.setAuthenticationMethod("Password");
@@ -67,19 +67,19 @@ public class SAML2CallbackHandler implements CallbackHandler {
} else if ("bob".equals(subjectName)) {
roles.add("employee");
}
-
+
if (!roles.isEmpty()) {
AttributeStatementBean attrBean = new AttributeStatementBean();
AttributeBean attributeBean = new AttributeBean();
attributeBean.setQualifiedName("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/role");
attributeBean.setNameFormat(SAML2Constants.ATTRNAME_FORMAT_UNSPECIFIED);
attributeBean.setAttributeValues(roles);
-
+
attrBean.setSamlAttributes(Collections.singletonList(attributeBean));
callback.setAttributeStatementData(Collections.singletonList(attrBean));
}
}
-
+
public void handle(Callback[] callbacks)
throws IOException, UnsupportedCallbackException {
for (int i = 0; i < callbacks.length; i++) {
@@ -90,8 +90,8 @@ public class SAML2CallbackHandler implements CallbackHandler {
if (conditions != null) {
callback.setConditions(conditions);
}
-
- SubjectBean subjectBean =
+
+ SubjectBean subjectBean =
new SubjectBean(
subjectName, subjectQualifier, confirmationMethod
);
@@ -107,23 +107,23 @@ public class SAML2CallbackHandler implements CallbackHandler {
}
}
}
-
+
public void setSubjectConfirmationData(SubjectConfirmationDataBean subjectConfirmationData) {
this.subjectConfirmationData = subjectConfirmationData;
}
-
+
public void setConditions(ConditionsBean conditionsBean) {
this.conditions = conditionsBean;
}
-
+
public void setConfirmationMethod(String confMethod) {
confirmationMethod = confMethod;
}
-
+
public void setIssuer(String issuer) {
this.issuer = issuer;
}
-
+
public void setSubjectNameIDFormat(String subjectNameIDFormat) {
this.subjectNameIDFormat = subjectNameIDFormat;
}
@@ -143,5 +143,5 @@ public class SAML2CallbackHandler implements CallbackHandler {
public void setSubjectQualifier(String subjectQualifier) {
this.subjectQualifier = subjectQualifier;
}
-
+
}
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/systests/federation/samlIdpWebapp/src/main/java/org/apache/cxf/fediz/samlsso/example/SAML2PResponseComponentBuilder.java
----------------------------------------------------------------------
diff --git a/systests/federation/samlIdpWebapp/src/main/java/org/apache/cxf/fediz/samlsso/example/SAML2PResponseComponentBuilder.java b/systests/federation/samlIdpWebapp/src/main/java/org/apache/cxf/fediz/samlsso/example/SAML2PResponseComponentBuilder.java
index 9934dc1..ade07d4 100644
--- a/systests/federation/samlIdpWebapp/src/main/java/org/apache/cxf/fediz/samlsso/example/SAML2PResponseComponentBuilder.java
+++ b/systests/federation/samlIdpWebapp/src/main/java/org/apache/cxf/fediz/samlsso/example/SAML2PResponseComponentBuilder.java
@@ -36,24 +36,24 @@ import org.opensaml.saml.saml2.core.StatusMessage;
* A (basic) set of utility methods to construct SAML 2.0 Protocol Response statements
*/
public final class SAML2PResponseComponentBuilder {
-
+
private static SAMLObjectBuilder<Response> responseBuilder;
-
+
private static SAMLObjectBuilder<Issuer> issuerBuilder;
-
+
private static SAMLObjectBuilder<Status> statusBuilder;
-
+
private static SAMLObjectBuilder<StatusCode> statusCodeBuilder;
-
+
private static SAMLObjectBuilder<StatusMessage> statusMessageBuilder;
-
- private static XMLObjectBuilderFactory builderFactory =
+
+ private static XMLObjectBuilderFactory builderFactory =
XMLObjectProviderRegistrySupport.getBuilderFactory();
-
+
private SAML2PResponseComponentBuilder() {
-
+
}
-
+
@SuppressWarnings("unchecked")
public static Response createSAMLResponse(
String inResponseTo,
@@ -65,17 +65,17 @@ public final class SAML2PResponseComponentBuilder {
builderFactory.getBuilder(Response.DEFAULT_ELEMENT_NAME);
}
Response response = responseBuilder.buildObject();
-
+
response.setID(UUID.randomUUID().toString());
response.setIssueInstant(new DateTime());
response.setInResponseTo(inResponseTo);
response.setIssuer(createIssuer(issuer));
response.setStatus(status);
response.setVersion(SAMLVersion.VERSION_20);
-
+
return response;
}
-
+
@SuppressWarnings("unchecked")
public static Issuer createIssuer(
String issuerValue
@@ -86,10 +86,10 @@ public final class SAML2PResponseComponentBuilder {
}
Issuer issuer = issuerBuilder.buildObject();
issuer.setValue(issuerValue);
-
+
return issuer;
}
-
+
@SuppressWarnings("unchecked")
public static Status createStatus(
String statusCodeValue,
@@ -107,21 +107,21 @@ public final class SAML2PResponseComponentBuilder {
statusMessageBuilder = (SAMLObjectBuilder<StatusMessage>)
builderFactory.getBuilder(StatusMessage.DEFAULT_ELEMENT_NAME);
}
-
+
Status status = statusBuilder.buildObject();
-
+
StatusCode statusCode = statusCodeBuilder.buildObject();
statusCode.setValue(statusCodeValue);
status.setStatusCode(statusCode);
-
+
if (statusMessage != null) {
StatusMessage statusMessageObject = statusMessageBuilder.buildObject();
statusMessageObject.setMessage(statusMessage);
status.setStatusMessage(statusMessageObject);
}
-
+
return status;
}
-
-
+
+
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/systests/federation/samlIdpWebapp/src/main/java/org/apache/cxf/fediz/samlsso/example/SamlSso.java
----------------------------------------------------------------------
diff --git a/systests/federation/samlIdpWebapp/src/main/java/org/apache/cxf/fediz/samlsso/example/SamlSso.java b/systests/federation/samlIdpWebapp/src/main/java/org/apache/cxf/fediz/samlsso/example/SamlSso.java
index 4adfcc8..3ec6688 100644
--- a/systests/federation/samlIdpWebapp/src/main/java/org/apache/cxf/fediz/samlsso/example/SamlSso.java
+++ b/systests/federation/samlIdpWebapp/src/main/java/org/apache/cxf/fediz/samlsso/example/SamlSso.java
@@ -69,40 +69,40 @@ import org.opensaml.saml.saml2.core.Status;
*/
@Path("/samlsso")
public class SamlSso {
-
+
static {
OpenSAMLUtil.initSamlEngine();
}
-
+
private final DocumentBuilderFactory docBuilderFactory;
private MessageContext messageContext;
-
+
public SamlSso() {
docBuilderFactory = DocumentBuilderFactory.newInstance();
docBuilderFactory.setNamespaceAware(true);
}
-
+
@POST
public javax.ws.rs.core.Response login(@FormParam("SAMLRequest") String samlRequest,
@FormParam("RelayState") String relayState) throws Exception {
-
+
return login(samlRequest, relayState, "POST");
}
-
+
@GET
public javax.ws.rs.core.Response login(@QueryParam("SAMLRequest") String samlRequest,
@QueryParam("RelayState") String relayState, @QueryParam("binding") String binding) throws Exception {
-
+
AuthnRequest request = extractRequest(samlRequest);
String racs = request.getAssertionConsumerServiceURL();
String requestIssuer = request.getIssuer().getValue();
-
+
// Create the response
Element response = createResponse(request.getID(), racs, requestIssuer);
boolean redirect = "REDIRECT".equals(binding);
String responseStr = encodeResponse(response, redirect);
-
+
if (redirect) {
return redirectResponse(relayState, racs, responseStr);
} else {
@@ -110,29 +110,29 @@ public class SamlSso {
}
}
- @Context
+ @Context
public void setMessageContext(MessageContext mc) {
this.messageContext = mc;
}
-
+
protected Element createResponse(String requestID, String racs, String requestIssuer) throws Exception {
DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
Document doc = docBuilder.newDocument();
-
- Status status =
+
+ Status status =
SAML2PResponseComponentBuilder.createStatus(
"urn:oasis:names:tc:SAML:2.0:status:Success", null
);
String issuer = messageContext.getUriInfo().getAbsolutePath().toString();
- Response response =
+ Response response =
SAML2PResponseComponentBuilder.createSAMLResponse(requestID, issuer, status);
-
+
// Create an AuthenticationAssertion
SAML2CallbackHandler callbackHandler = new SAML2CallbackHandler();
callbackHandler.setIssuer(issuer);
String user = messageContext.getSecurityContext().getUserPrincipal().getName();
callbackHandler.setSubjectName(user);
-
+
// Subject Confirmation Data
SubjectConfirmationDataBean subjectConfirmationData = new SubjectConfirmationDataBean();
subjectConfirmationData.setAddress(messageContext.getHttpServletRequest().getRemoteAddr());
@@ -140,28 +140,28 @@ public class SamlSso {
subjectConfirmationData.setNotAfter(new DateTime().plusMinutes(5));
subjectConfirmationData.setRecipient(racs);
callbackHandler.setSubjectConfirmationData(subjectConfirmationData);
-
+
// Audience Restriction
ConditionsBean conditions = new ConditionsBean();
conditions.setTokenPeriodMinutes(5);
-
+
AudienceRestrictionBean audienceRestriction = new AudienceRestrictionBean();
audienceRestriction.setAudienceURIs(Collections.singletonList(requestIssuer));
conditions.setAudienceRestrictions(Collections.singletonList(audienceRestriction));
callbackHandler.setConditions(conditions);
-
+
SAMLCallback samlCallback = new SAMLCallback();
SAMLUtil.doSAMLCallback(callbackHandler, samlCallback);
SamlAssertionWrapper assertion = new SamlAssertionWrapper(samlCallback);
-
+
Crypto issuerCrypto = CryptoFactory.getInstance("stsKeystoreB.properties");
assertion.signAssertion("realmb", "realmb", issuerCrypto, false);
-
+
response.getAssertions().add(assertion.getSaml2());
-
+
Element policyElement = OpenSAMLUtil.toDom(response, doc);
doc.appendChild(policyElement);
-
+
return policyElement;
}
@@ -179,15 +179,15 @@ public class SamlSso {
return Base64Utility.encode(deflatedBytes);
}
-
- protected AuthnRequest extractRequest(String samlRequest) throws Base64Exception,
+
+ protected AuthnRequest extractRequest(String samlRequest) throws Base64Exception,
DataFormatException, XMLStreamException, UnsupportedEncodingException, WSSecurityException {
byte[] deflatedToken = Base64Utility.decode(samlRequest);
-
+
InputStream tokenStream = new DeflateEncoderDecoder().inflateToken(deflatedToken);
-
+
Document responseDoc = StaxUtils.read(new InputStreamReader(tokenStream, "UTF-8"));
- AuthnRequest request =
+ AuthnRequest request =
(AuthnRequest)OpenSAMLUtil.fromDom(responseDoc.getDocumentElement());
System.out.println(DOM2Writer.nodeToString(responseDoc));
return request;
@@ -197,22 +197,22 @@ public class SamlSso {
throws IOException {
InputStream inputStream = this.getClass().getResourceAsStream("/TemplateSAMLResponse.xml");
String responseTemplate = IOUtils.toString(inputStream, "UTF-8");
- inputStream.close();
-
+ inputStream.close();
+
// Perform Redirect to RACS
responseTemplate = responseTemplate.replace("%RESPONSE_URL%", racs);
responseTemplate = responseTemplate.replace("%SAMLResponse%", responseStr);
responseTemplate = responseTemplate.replace("%RelayState%", relayState);
-
+
return javax.ws.rs.core.Response.ok(responseTemplate).type(MediaType.TEXT_HTML).build();
}
-
+
protected javax.ws.rs.core.Response redirectResponse(String relayState, String racs, String responseStr) {
// Perform Redirect to RACS
UriBuilder ub = UriBuilder.fromUri(racs);
ub.queryParam("SAMLResponse", responseStr);
ub.queryParam("RelayState", relayState);
-
+
return javax.ws.rs.core.Response.seeOther(ub.build()).build();
}
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/systests/federation/samlWebapp/src/main/java/org/apache/cxf/fediz/samlsso/service/DoubleItService.java
----------------------------------------------------------------------
diff --git a/systests/federation/samlWebapp/src/main/java/org/apache/cxf/fediz/samlsso/service/DoubleItService.java b/systests/federation/samlWebapp/src/main/java/org/apache/cxf/fediz/samlsso/service/DoubleItService.java
index ece78ce..f69f595 100644
--- a/systests/federation/samlWebapp/src/main/java/org/apache/cxf/fediz/samlsso/service/DoubleItService.java
+++ b/systests/federation/samlWebapp/src/main/java/org/apache/cxf/fediz/samlsso/service/DoubleItService.java
@@ -49,5 +49,5 @@ public class DoubleItService {
public Number doubleItPost(@PathParam("numberToDouble") int numberToDouble) {
return doubleIt(numberToDouble);
}
-
+
}
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/systests/federation/samlWebapp/src/main/java/org/apache/cxf/fediz/samlsso/service/KeystorePasswordCallback.java
----------------------------------------------------------------------
diff --git a/systests/federation/samlWebapp/src/main/java/org/apache/cxf/fediz/samlsso/service/KeystorePasswordCallback.java b/systests/federation/samlWebapp/src/main/java/org/apache/cxf/fediz/samlsso/service/KeystorePasswordCallback.java
index ef42da5..defb9be 100644
--- a/systests/federation/samlWebapp/src/main/java/org/apache/cxf/fediz/samlsso/service/KeystorePasswordCallback.java
+++ b/systests/federation/samlWebapp/src/main/java/org/apache/cxf/fediz/samlsso/service/KeystorePasswordCallback.java
@@ -33,16 +33,16 @@ import org.apache.wss4j.common.ext.WSPasswordCallback;
* A CallbackHandler implementation for keystores.
*/
public class KeystorePasswordCallback implements CallbackHandler {
-
- private Map<String, String> passwords =
+
+ private Map<String, String> passwords =
new HashMap<String, String>();
-
+
public KeystorePasswordCallback() {
passwords.put("realma", "realma");
}
/**
- * It attempts to get the password from the private
+ * It attempts to get the password from the private
* alias/passwords map.
*/
public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
@@ -61,6 +61,6 @@ public class KeystorePasswordCallback implements CallbackHandler {
}
}
}
-
+
}
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/systests/federation/samlWebapp/src/main/java/org/apache/cxf/fediz/samlsso/service/Number.java
----------------------------------------------------------------------
diff --git a/systests/federation/samlWebapp/src/main/java/org/apache/cxf/fediz/samlsso/service/Number.java b/systests/federation/samlWebapp/src/main/java/org/apache/cxf/fediz/samlsso/service/Number.java
index bccb647..a0f617e 100644
--- a/systests/federation/samlWebapp/src/main/java/org/apache/cxf/fediz/samlsso/service/Number.java
+++ b/systests/federation/samlWebapp/src/main/java/org/apache/cxf/fediz/samlsso/service/Number.java
@@ -24,9 +24,9 @@ import javax.xml.bind.annotation.XmlRootElement;
public class Number {
private int number;
private String description;
-
+
public Number() {
-
+
}
public int getNumber() {
@@ -44,5 +44,5 @@ public class Number {
public void setDescription(String description) {
this.description = description;
}
-
+
}
http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/2ca31863/systests/federation/samlsso/src/test/java/org/apache/cxf/fediz/integrationtests/RealmMapper.java
----------------------------------------------------------------------
diff --git a/systests/federation/samlsso/src/test/java/org/apache/cxf/fediz/integrationtests/RealmMapper.java b/systests/federation/samlsso/src/test/java/org/apache/cxf/fediz/integrationtests/RealmMapper.java
index ba2bb51..a2a6e64 100644
--- a/systests/federation/samlsso/src/test/java/org/apache/cxf/fediz/integrationtests/RealmMapper.java
+++ b/systests/federation/samlsso/src/test/java/org/apache/cxf/fediz/integrationtests/RealmMapper.java
@@ -27,18 +27,18 @@ import java.util.Map;
* Returns a static map of application realms to home realms
*/
public final class RealmMapper {
-
+
private RealmMapper() {
//
}
-
+
public static Map<String, String> realms() {
Map<String, String> realms = new HashMap<>();
realms.put("urn:org:apache:cxf:fediz:fedizhelloworld:realm-B", "urn:org:apache:cxf:fediz:idp:realm-B");
realms.put("urn:org:apache:cxf:fediz:fedizhelloworld:realm-C", "urn:org:apache:cxf:fediz:idp:realm-C");
realms.put("urn:org:apache:cxf:fediz:fedizhelloworld:realm-D", "urn:org:apache:cxf:fediz:idp:realm-D");
-
+
return realms;
}
-
+
}
\ No newline at end of file