Package org.sonatype.security

Examples of org.sonatype.security.SecuritySystem.authenticate()


  public void testValidAuthentication()
      throws Exception
  {
    SecuritySystem plexusSecurity = this.lookup(SecuritySystem.class);
    AuthenticationToken token = new UsernamePasswordToken("admin-simple", "admin123");
    AuthenticationInfo authInfo = plexusSecurity.authenticate(token);

    // check
    Assert.assertNotNull(authInfo);
  }
View Full Code Here


  {
    SecuritySystem plexusSecurity = this.lookup(SecuritySystem.class);
    AuthenticationToken token = new UsernamePasswordToken("admin-simple", "INVALID");

    try {
      plexusSecurity.authenticate(token);
    }
    catch (AuthenticationException e) {
      // expected
    }
  }
View Full Code Here

  {
    SecuritySystem plexusSecurity = this.lookup(SecuritySystem.class);
    AuthenticationToken token = new UsernamePasswordToken("INVALID", "INVALID");

    try {
      plexusSecurity.authenticate(token);
    }
    catch (AuthenticationException e) {
      // expected
    }
  }
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.