Package org.geomajas.security

Examples of org.geomajas.security.Authentication


  @Test
  public void testDefaultVisibleAreaOne() throws Exception {
    SecurityContextImpl securityContext = (SecurityContextImpl)this.securityContext;
    List<Authentication> authentications = new ArrayList<Authentication>();
    Authentication auth1 = getAuthentication();
    Authentication auth2 = getAreaAuthentication(1);
    authentications.add(auth1);
    authentications.add(auth2);
    securityContext.setAuthentications("token", authentications);

    Geometry geometry = securityContext.getVisibleArea(LAYER_ID);
View Full Code Here


  @Test
  public void testDefaultVisibleAreaTwo() throws Exception {
    SecurityContextImpl securityContext = (SecurityContextImpl)this.securityContext;
    List<Authentication> authentications = new ArrayList<Authentication>();
    Authentication auth1 = getAreaAuthentication(1);
    Authentication auth2 = getAreaAuthentication(2);
    authentications.add(auth1);
    authentications.add(auth2);
    securityContext.setAuthentications("token", authentications);

    Geometry geometry = securityContext.getVisibleArea(LAYER_ID);
View Full Code Here

  public void restoreSecurityContext(SavedAuthorization savedAuthorization) {
    List<Authentication> auths = new ArrayList<Authentication>();
    if (null != savedAuthorization) {
      for (SavedAuthentication sa : savedAuthorization.getAuthentications()) {
        Authentication auth = new Authentication();
        auth.setSecurityServiceId(sa.getSecurityServiceId());
        auth.setAuthorizations(sa.getAuthorizations());
        auths.add(auth);
      }
    }
    setAuthentications(null, auths);
    userInfoInit();
View Full Code Here

    Assert.assertFalse(securityContext.isPartlyVisibleSufficient(LAYER_ID));
  }

  private Authentication getAuthentication() {
    Authentication auth = new Authentication();
    auth.setAuthorizations(new BaseAuthorization[]{new AllowAllAuthorization()});
    auth.setSecurityServiceId(SECURITY_SERVICE_ID);
    auth.setUserId(USER_ID);
    return auth;
  }
View Full Code Here

    auth.setUserId(USER_ID);
    return auth;
  }

  private Authentication getBaseAuthentication() {
    Authentication auth = new Authentication();
    auth.setAuthorizations(new BaseAuthorization[]{new AllowBaseAuthorization()});
    auth.setSecurityServiceId(SECURITY_SERVICE_ID);
    auth.setUserId(USER_ID);
    return auth;
  }
View Full Code Here

    auth.setUserId(USER_ID);
    return auth;
  }

  private Authentication getAreaAuthentication(int which) {
    Authentication auth = new Authentication();
    auth.setAuthorizations(new BaseAuthorization[]{new TestAuthorization(which)});
    auth.setSecurityServiceId(SECURITY_SERVICE_ID + which);
    auth.setUserId(USER_ID);
    return auth;
  }
View Full Code Here

  public String getId() {
    return "AllowAll";
  }

  public Authentication getAuthentication(String authenticationToken) {
    Authentication authentication = new Authentication();
    authentication.setUserId("anonymous");
    authentication.setAuthorizations(AUTHORIZATIONS);
    return authentication;
  }
View Full Code Here

TOP

Related Classes of org.geomajas.security.Authentication

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.