Package org.apache.shiro.web.util

Examples of org.apache.shiro.web.util.SavedRequest


    protected void saveRequest(ServletRequest request, String backUrl, String fallbackUrl) {
        Subject subject = SecurityUtils.getSubject();
        Session session = subject.getSession();
        HttpServletRequest httpRequest = WebUtils.toHttp(request);
        session.setAttribute("authc.fallbackUrl", fallbackUrl);
        SavedRequest savedRequest = new ClientSavedRequest(httpRequest, backUrl);
        session.setAttribute(WebUtils.SAVED_REQUEST_KEY, savedRequest);
    }
View Full Code Here


        try {
          subject.login(token);
         
        String redirect = request.getContextPath();
        SavedRequest oldRequest = WebUtils.getSavedRequest(request);
        if (oldRequest != null && oldRequest.getRequestURI() != null) {
          redirect = oldRequest.getRequestURI();
        }
        if (redirect.isEmpty()) redirect = "/";
         
          responseMap.put("success", true);
          responseMap.put("redirect", redirect);
View Full Code Here

    public void doLogin() throws IOException {
        try {
            SecurityUtils.getSubject().login(new UsernamePasswordToken(username, password, remember));
            ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
            SavedRequest savedRequest = WebUtils
                    .getAndClearSavedRequest((ServletRequest) externalContext
                            .getRequest());

            externalContext
                    .redirect(savedRequest != null ? savedRequest.getRequestUrl() : getRootUrl(externalContext));
        } catch (IncorrectCredentialsException e) {
            messageContext.message().text("{octopus.invalid_password}").payload(MessageSeverity.ERROR).add();

        } catch (UnknownAccountException e) {
            messageContext.message().text("{octopus.unknown_username}").payload(MessageSeverity.ERROR).add();
View Full Code Here

        try {
          subject.login(token);
         
        String redirect = request.getContextPath();
        SavedRequest oldRequest = WebUtils.getSavedRequest(request);
        if (oldRequest != null && oldRequest.getRequestURI() != null) {
          redirect = oldRequest.getRequestURI();
        }
        if (redirect.isEmpty()) redirect = "/";
         
          responseMap.put("success", true);
          responseMap.put("redirect", redirect);
View Full Code Here

        try {
          subject.login(token);
         
        String redirect = request.getContextPath();
        SavedRequest oldRequest = WebUtils.getSavedRequest(request);
        if (oldRequest != null && oldRequest.getRequestURI() != null) {
          redirect = oldRequest.getRequestURI();
        }
        if (redirect.isEmpty()) redirect = "/";
         
          responseMap.put("success", true);
          responseMap.put("redirect", redirect);
View Full Code Here

TOP

Related Classes of org.apache.shiro.web.util.SavedRequest

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.