Example usage for com.liferay.portal.util PropsValues CAS_SERVER_URL

List of usage examples for com.liferay.portal.util PropsValues CAS_SERVER_URL

Introduction

In this page you can find the example usage for com.liferay.portal.util PropsValues CAS_SERVER_URL.

Prototype

String CAS_SERVER_URL

To view the source code for com.liferay.portal.util PropsValues CAS_SERVER_URL.

Click Source Link

Usage

From source file:com.ext.portal.servlet.filters.sso.cas.CASFilterExt.java

License:Open Source License

protected TicketValidator getTicketValidator(long companyId) throws Exception {

    TicketValidator ticketValidator = _ticketValidators.get(companyId);

    if (ticketValidator != null) {
        return ticketValidator;
    }//from ww w  .j a  va  2 s.c o  m

    String serverName = PrefsPropsUtil.getString(companyId, PropsKeys.CAS_SERVER_NAME,
            PropsValues.CAS_SERVER_NAME);
    String serverUrl = PrefsPropsUtil.getString(companyId, PropsKeys.CAS_SERVER_URL,
            PropsValues.CAS_SERVER_URL);
    String loginUrl = PrefsPropsUtil.getString(companyId, PropsKeys.CAS_LOGIN_URL, PropsValues.CAS_LOGIN_URL);

    Cas20ProxyTicketValidator cas20ProxyTicketValidator = new Cas20ProxyTicketValidator(serverUrl);

    Map<String, String> parameters = new HashMap<String, String>();

    parameters.put("serverName", serverName);
    parameters.put("casServerUrlPrefix", serverUrl);
    parameters.put("casServerLoginUrl", loginUrl);
    parameters.put("redirectAfterValidation", "false");

    cas20ProxyTicketValidator.setCustomParameters(parameters);

    _ticketValidators.put(companyId, cas20ProxyTicketValidator);

    return cas20ProxyTicketValidator;
}