Examples of LoginPasswordAuthenticator


Examples of org.sonar.api.security.LoginPasswordAuthenticator

        throw new SonarException(String.format(
          "Realm '%s' not found. Please check the property '%s' in conf/sonar.properties", realmName, CoreProperties.CORE_AUTHENTICATOR_REALM));
      }
    }
    if (selectedRealm == null && !StringUtils.isEmpty(className)) {
      LoginPasswordAuthenticator authenticator = selectAuthenticator(authenticators, className);
      if (authenticator == null) {
        throw new SonarException(String.format(
          "Authenticator '%s' not found. Please check the property '%s' in conf/sonar.properties", className, CoreProperties.CORE_AUTHENTICATOR_CLASS));
      }
      selectedRealm = new CompatibilityRealm(authenticator);
View Full Code Here

Examples of org.sonar.api.security.LoginPasswordAuthenticator

public class CompatibilityRealmTest {

  @Test
  public void shouldDelegate() {
    LoginPasswordAuthenticator authenticator = mock(LoginPasswordAuthenticator.class);
    CompatibilityRealm realm = new CompatibilityRealm(authenticator);
    realm.init();
    verify(authenticator).init();
    assertThat(realm.getLoginPasswordAuthenticator(), is(authenticator));
    assertThat(realm.getName(), is("CompatibilityRealm[" + authenticator.getClass().getName() + "]"));
  }
View Full Code Here

Examples of org.sonar.api.security.LoginPasswordAuthenticator

  }

  @Test
  public void should_provide_compatibility_for_authenticator() {
    settings.setProperty(CoreProperties.CORE_AUTHENTICATOR_CLASS, FakeAuthenticator.class.getName());
    LoginPasswordAuthenticator authenticator = new FakeAuthenticator();

    SecurityRealmFactory factory = new SecurityRealmFactory(settings, new LoginPasswordAuthenticator[]{authenticator});
    SecurityRealm realm = factory.getRealm();
    assertThat(realm).isInstanceOf(CompatibilityRealm.class);
  }
View Full Code Here

Examples of org.sonar.api.security.LoginPasswordAuthenticator

  @Test
  public void should_take_precedence_over_authenticator() {
    SecurityRealm realm = new FakeRealm();
    settings.setProperty(CoreProperties.CORE_AUTHENTICATOR_REALM, realm.getName());
    LoginPasswordAuthenticator authenticator = new FakeAuthenticator();
    settings.setProperty(CoreProperties.CORE_AUTHENTICATOR_CLASS, FakeAuthenticator.class.getName());

    SecurityRealmFactory factory = new SecurityRealmFactory(settings, new SecurityRealm[]{realm},
      new LoginPasswordAuthenticator[]{authenticator});
    assertThat(factory.getRealm()).isSameAs(realm);
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.