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

org.apereo.cas.web.DefaultTokenRequestExtractor Maven / Gradle / Ivy

There is a newer version: 7.1.0
Show newest version
package org.apereo.cas.web;

import org.apereo.cas.token.TokenConstants;

import org.apache.commons.lang3.StringUtils;

import javax.servlet.http.HttpServletRequest;

/**
 * This is {@link DefaultTokenRequestExtractor}.
 *
 * @author Misagh Moayyed
 * @since 5.2.0
 */
public class DefaultTokenRequestExtractor implements TokenRequestExtractor {
    @Override
    public String extract(final HttpServletRequest request) {
        var authTokenValue = request.getParameter(TokenConstants.PARAMETER_NAME_TOKEN);
        if (StringUtils.isBlank(authTokenValue)) {
            authTokenValue = request.getHeader(TokenConstants.PARAMETER_NAME_TOKEN);
        }
        return authTokenValue;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy