All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.springframework.social.openid.security.DefaultRealmMapper Maven / Gradle / Ivy

The newest version!
/**
 * Copyright 2010 Molindo GmbH
 *
 * Licensed 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.springframework.social.openid.security;

import java.util.Collections;
import java.util.Map;

public class DefaultRealmMapper implements IRealmMapper {

	private Map realmMapping = Collections.emptyMap();
	
	@Override
	public String getMapping(String returnToUrl) {
		return realmMapping.get(returnToUrl);
	}

	/**
	 * Maps the return_to url to a realm, for example: 
	 * http://www.example.com/j_spring_openid_security_check ->
	 * http://www.example.com/realm 
If no mapping is provided then * the returnToUrl will be parsed to extract the protocol, hostname and port * followed by a trailing slash. This means that * http://www.example.com/j_spring_openid_security_check will * automatically become http://www.example.com:80/ * * @param realmMapping * containing returnToUrl -> realm mappings */ public void setRealmMapping(Map realmMapping) { this.realmMapping = realmMapping; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy