001/*
002 * (C) Copyright 2010 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 *
016 * Contributors:
017 *     Nuxeo - initial API and implementation
018 */
019
020package org.nuxeo.ecm.platform.shibboleth.service;
021
022import java.util.HashMap;
023import java.util.Map;
024
025import org.nuxeo.common.xmap.annotation.XNode;
026import org.nuxeo.common.xmap.annotation.XNodeMap;
027import org.nuxeo.common.xmap.annotation.XObject;
028
029@XObject("config")
030public class ShibbolethAuthenticationConfig {
031
032    @XNodeMap(value = "uidHeaders/uidHeader", key = "@idpUrl", type = HashMap.class, componentType = String.class)
033    protected Map<String, String> uidHeaders = new HashMap<>();
034
035    @XNode("uidHeaders/default")
036    protected String defaultUidHeader;
037
038    @XNode("loginURL")
039    protected String loginURL;
040
041    @XNode("loginRedirectURLParameter")
042    protected String loginRedirectURLParameter = "target";
043
044    @XNode("logoutURL")
045    protected String logoutURL;
046
047    @XNode("logoutRedirectURLParameter")
048    protected String logoutRedirectURLParameter = "return";
049
050    @XNode("idpHeader")
051    protected String idpHeader = "shib-identity-provider";
052
053    @XNode("@headerEncoding")
054    protected String headerEncoding = "UTF-8";
055
056    @XNodeMap(value = "fieldMapping", key = "@header", type = HashMap.class, componentType = String.class)
057    protected Map<String, String> fieldMapping = new HashMap<>();
058
059    public Map<String, String> getUidHeaders() {
060        return uidHeaders;
061    }
062
063    public String getDefaultUidHeader() {
064        return defaultUidHeader;
065    }
066
067    public String getLoginURL() {
068        return loginURL;
069    }
070
071    public String getLogoutURL() {
072        return logoutURL;
073    }
074
075    public String getLoginRedirectURLParameter() {
076        return loginRedirectURLParameter;
077    }
078
079    public String getLogoutRedirectURLParameter() {
080        return logoutRedirectURLParameter;
081    }
082
083    public Map<String, String> getFieldMapping() {
084        return fieldMapping;
085    }
086
087    public String getIdpHeader() {
088        return idpHeader;
089    }
090
091    public String getHeaderEncoding() { return headerEncoding; }
092}