Examples of UnAuthenticatedException


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

Examples of org.apache.shiro.authz.UnauthenticatedException

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

Examples of org.apache.shiro.authz.UnauthenticatedException

  }

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

Examples of org.apache.shiro.authz.UnauthenticatedException

  @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

Examples of org.apache.shiro.authz.UnauthenticatedException

    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

Examples of org.exoplatform.social.client.api.auth.UnAuthenticatedException

  @Override
  public void setBasicAuthenticateToRequest() throws SocialClientLibException {
    if (delegate == null) return;
    if (SocialClientContext.getUsername() == null || SocialClientContext.getPassword() == null) {
      //fast check from client
      throw new SocialClientLibException("401 Unauthorized", new UnAuthenticatedException());
    }
    delegate.getCredentialsProvider().setCredentials(new AuthScope(SocialClientContext.getHost(), SocialClientContext.getPort()),
                                                     new UsernamePasswordCredentials(SocialClientContext.getUsername(), SocialClientContext.getPassword()));
    delegate.addRequestInterceptor(preemptiveAuthInterceptor ,0);
  }
View Full Code Here

Examples of org.exoplatform.social.client.api.auth.UnAuthenticatedException

      if(statusCode == 404){
        throw new SocialClientLibException(response.getStatusLine().toString(), new NotFoundException());
      } else if(statusCode == 403){
        throw new SocialClientLibException(response.getStatusLine().toString(), new AccessDeniedException());
      } else if(statusCode == 401){
        throw new SocialClientLibException(response.getStatusLine().toString(), new UnAuthenticatedException());
      } else {
        throw new ServiceException(response.getStatusLine().toString());
      }
    }
  }
View Full Code Here

Examples of org.exoplatform.social.client.api.auth.UnAuthenticatedException

      if(statusCode == 404){
        throw new SocialClientLibException(response.getStatusLine().toString(), new NotFoundException());
      } else if(statusCode == 403){
        throw new SocialClientLibException(response.getStatusLine().toString(), new AccessDeniedException());
      } else if(statusCode == 401){
        throw new SocialClientLibException(response.getStatusLine().toString(), new UnAuthenticatedException());
      } else if (statusCode == 301) {
        /** handle redirect */
        Header[] headers = response.getHeaders("Location");
        if (headers != null && headers.length != 0) {
          String newUrl = headers[headers.length - 1].getValue();
View Full Code Here

Examples of org.jboss.errai.security.shared.exception.UnauthenticatedException

        else {
          throw new UnauthorizedException();
        }
      }
      else {
        throw new UnauthenticatedException();
      }
    }
    else {
      callContext.proceed();
    }
View Full Code Here

Examples of org.jboss.errai.security.shared.exception.UnauthenticatedException

    final Collection<RestrictedAccess> annotations = getRestrictedAccessAnnotations(context.getTarget().getClass(),
            context.getMethod());
    final String[] roles = AnnotationUtils.mergeRoles(annotations.toArray(new RestrictedAccess[annotations.size()]));

    if (User.ANONYMOUS.equals(user)) {
      throw new UnauthenticatedException();
    }
    else if (!user.hasAllRoles(roles)) {
      throw new UnauthorizedException();
    }
    else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.