Package org.pac4j.core.context

Examples of org.pac4j.core.context.J2EContext


    public CasSingleSignOutHandler(final SingleSignOutHandler singleSignOutHandler) {
        logger.warn("The provided CAS SingleSignOutHandler is not taken into account anymore!");
    }
   
    public boolean isTokenRequest(final WebContext context) {
        final J2EContext j2eContext = (J2EContext) context;
        return CommonUtils.isNotBlank(CommonUtils.safeGetParameter(j2eContext.getRequest(), this.artifactParameterName,
                this.safeParameters));
    }
View Full Code Here


        return CommonUtils.isNotBlank(CommonUtils.safeGetParameter(j2eContext.getRequest(), this.artifactParameterName,
                this.safeParameters));
    }
   
    public boolean isLogoutRequest(final WebContext context) {
        final J2EContext j2eContext = (J2EContext) context;
        HttpServletRequest request = j2eContext.getRequest();
        return "POST".equals(request.getMethod())
                && !isMultipartRequest(request)
                && CommonUtils.isNotBlank(CommonUtils.safeGetParameter(request, this.logoutParameterName,
                        this.safeParameters));
    }
View Full Code Here

                && CommonUtils.isNotBlank(CommonUtils.safeGetParameter(request, this.logoutParameterName,
                        this.safeParameters));
    }
   
    public void recordSession(final WebContext context, final String ticket) {
        final J2EContext j2eContext = (J2EContext) context;
        HttpServletRequest request = j2eContext.getRequest();
        final HttpSession session = request.getSession(this.eagerlyCreateSessions);

        if (session == null) {
            logger.debug("No session currently exists (and none created).  Cannot record session information for single sign out.");
            return;
View Full Code Here

        }
        sessionMappingStorage.addSessionById(token, session);
    }
   
    public void destroySession(final WebContext context) {
        final J2EContext j2eContext = (J2EContext) context;
        HttpServletRequest request = j2eContext.getRequest();
        final String logoutMessage = CommonUtils.safeGetParameter(request, this.logoutParameterName, this.safeParameters);
        logger.trace("Logout request:\n{}", logoutMessage);

        final String token = XmlUtils.getTextForElement(logoutMessage, "SessionIndex");
        if (CommonUtils.isNotBlank(token)) {
View Full Code Here

   
    @SuppressWarnings("unchecked")
    @Override
    protected ModelAndView handleRequestInternal(final HttpServletRequest request, final HttpServletResponse response) {
       
        final WebContext context = new J2EContext(request, response);
       
        final Client<CasCredentials, CasProfile> client = this.clients.findClient(context);
       
        CasCredentials credentials = null;
        try {
View Full Code Here

  public static String getClientRedirectUrl(Pac4jClient client) {
    BaseClient<?, ?> baseClient = (BaseClient<?, ?>) WebApplication.get().getServletContext().getAttribute(client.getClientKey());
    HttpServletRequest request = (HttpServletRequest) RequestCycle.get().getRequest().getContainerRequest();
    HttpServletResponse response = (HttpServletResponse) RequestCycle.get().getResponse().getContainerResponse();
   
    return baseClient.getRedirectionUrl(new J2EContext(request, response));
  }
View Full Code Here

TOP

Related Classes of org.pac4j.core.context.J2EContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.