Fixing home realm mapping for SAML SSO
Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/8ed72ca2 Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/8ed72ca2 Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/8ed72ca2 Branch: refs/heads/master Commit: 8ed72ca26d6c1b59ad876a7274611eb24188526b Parents: 9e7d261 Author: Colm O hEigeartaigh <[email protected]> Authored: Fri Nov 11 12:45:09 2016 +0000 Committer: Colm O hEigeartaigh <[email protected]> Committed: Fri Nov 11 12:45:09 2016 +0000 ---------------------------------------------------------------------- .../cxf/fediz/integrationtests/RealmMapper.java | 44 ++++++++++++++++++++ .../test/resources/realma/entities-realma.xml | 2 +- 2 files changed, 45 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/8ed72ca2/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 new file mode 100644 index 0000000..ba2bb51 --- /dev/null +++ b/systests/federation/samlsso/src/test/java/org/apache/cxf/fediz/integrationtests/RealmMapper.java @@ -0,0 +1,44 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.cxf.fediz.integrationtests; + + +import java.util.HashMap; +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 http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/8ed72ca2/systests/federation/samlsso/src/test/resources/realma/entities-realma.xml ---------------------------------------------------------------------- diff --git a/systests/federation/samlsso/src/test/resources/realma/entities-realma.xml b/systests/federation/samlsso/src/test/resources/realma/entities-realma.xml index 6963772..1acc306 100644 --- a/systests/federation/samlsso/src/test/resources/realma/entities-realma.xml +++ b/systests/federation/samlsso/src/test/resources/realma/entities-realma.xml @@ -77,7 +77,7 @@ <ref bean="claim_email" /> </util:list> </property> - <property name="hrds" value="{'urn:org:apache:cxf:fediz:fedizhelloworld:realm-B':'urn:org:apache:cxf:fediz:idp:realm-B'} + <property name="hrds" value="T(org.apache.cxf.fediz.integrationtests.RealmMapper).realms() .get(getFlowScope().get('saml_authn_request').issuer)" /> </bean>
