Package org.apache.shiro.authz

Examples of org.apache.shiro.authz.UnauthenticatedException


                    "be executing " + Subject.class.getName() + ".login(AuthenticationToken) or when 'Remember Me' " +
                    "functionality is enabled by the SecurityManager.  This exception can also occur when a " +
                    "previously logged-in Subject has logged out which " +
                    "makes it anonymous again.  Because an identity is currently not known due to any of these " +
                    "conditions, authorization is denied.";
            throw new UnauthenticatedException(msg);
        }
    }
View Full Code Here


   
    @Test
    public void testUnauthenticatedRedirectsToLogin_exception() throws Exception
    {
        mockGuest();
        this.tester.startPage(new ExceptionalPage(new UnauthenticatedException()));
        assertRedirectsToLogin();
    }
View Full Code Here

  }

  @Override
  public void assertAuthorized() throws AuthorizationException {
    if (!getSubject().isAuthenticated()) {
      throw new UnauthenticatedException("The current Subject is not authenticated.  Access denied.");
    }
  }
View Full Code Here

  @Override
  public void assertAuthorized() throws AuthorizationException {
    Subject subject = getSubject();
    if (subject.getPrincipal() == null) {
      throw new UnauthenticatedException("Attempting to perform a user-only operation.  The current Subject is " +
          "not a user (they haven't been authenticated or remembered from a previous login).  " +
          "Access denied.");
    }
  }
View Full Code Here

    Subject subject = getSubject();

    if (subject.getPrincipal() == null) {
      return;
    }
    throw new UnauthenticatedException("Attempting to perform a guest-only operation.  The current Subject is " +
        "not a guest (they have been authenticated or remembered from a previous login).  Access " +
        "denied.");
  }
View Full Code Here

TOP

Related Classes of org.apache.shiro.authz.UnauthenticatedException

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.