congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
JaasAuthenticationProvider.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.springframework.security.authentication.jaas.JaasAuthenticationProvider
constructor

Best Java code snippets using org.springframework.security.authentication.jaas.JaasAuthenticationProvider.<init> (Showing top 5 results out of 315)

origin: spring-projects/spring-security

@Test
public void testConfigureJaas() throws Exception {
  testConfigureJaasCase(new JaasAuthenticationProvider(),
      new JaasAuthenticationProvider());
}
origin: spring-projects/spring-security

@Test
public void spacesInLoginConfigPathAreAccepted() throws Exception {
  File configFile;
  // Create temp directory with a space in the name
  File configDir = new File(System.getProperty("java.io.tmpdir") + File.separator
      + "jaas test");
  configDir.deleteOnExit();
  if (configDir.exists()) {
    configDir.delete();
  }
  configDir.mkdir();
  configFile = File.createTempFile("login", "conf", configDir);
  configFile.deleteOnExit();
  FileOutputStream fos = new FileOutputStream(configFile);
  PrintWriter pw = new PrintWriter(fos);
  pw.append("JAASTestBlah {"
      + "org.springframework.security.authentication.jaas.TestLoginModule required;"
      + "};");
  pw.flush();
  pw.close();
  JaasAuthenticationProvider myJaasProvider = new JaasAuthenticationProvider();
  myJaasProvider.setApplicationEventPublisher(context);
  myJaasProvider.setLoginConfig(new FileSystemResource(configFile));
  myJaasProvider.setAuthorityGranters(jaasProvider.getAuthorityGranters());
  myJaasProvider.setCallbackHandlers(jaasProvider.getCallbackHandlers());
  myJaasProvider.setLoginContextName(jaasProvider.getLoginContextName());
  myJaasProvider.afterPropertiesSet();
}
origin: spring-projects/spring-security

@Test
public void detectsMissingLoginConfig() throws Exception {
  JaasAuthenticationProvider myJaasProvider = new JaasAuthenticationProvider();
  myJaasProvider.setApplicationEventPublisher(context);
  myJaasProvider.setAuthorityGranters(jaasProvider.getAuthorityGranters());
  myJaasProvider.setCallbackHandlers(jaasProvider.getCallbackHandlers());
  myJaasProvider.setLoginContextName(jaasProvider.getLoginContextName());
  try {
    myJaasProvider.afterPropertiesSet();
    fail("Should have thrown ApplicationContextException");
  }
  catch (IllegalArgumentException expected) {
    assertThat(expected.getMessage().startsWith("loginConfig must be set on")).isTrue();
  }
}
origin: spring-projects/spring-security

@Test
public void detectsMissingLoginContextName() throws Exception {
  JaasAuthenticationProvider myJaasProvider = new JaasAuthenticationProvider();
  myJaasProvider.setApplicationEventPublisher(context);
  myJaasProvider.setAuthorityGranters(jaasProvider.getAuthorityGranters());
  myJaasProvider.setCallbackHandlers(jaasProvider.getCallbackHandlers());
  myJaasProvider.setLoginConfig(jaasProvider.getLoginConfig());
  myJaasProvider.setLoginContextName(null);
  try {
    myJaasProvider.afterPropertiesSet();
    fail("Should have thrown IllegalArgumentException");
  }
  catch (IllegalArgumentException expected) {
    assertThat(expected.getMessage()).startsWith("loginContextName must be set on");
  }
  myJaasProvider.setLoginContextName("");
  try {
    myJaasProvider.afterPropertiesSet();
    fail("Should have thrown IllegalArgumentException");
  }
  catch (IllegalArgumentException expected) {
    assertThat(expected.getMessage().startsWith("loginContextName must be set on"));
  }
}
origin: org.apereo.cas/cas-server-webapp-config

/**
 * Configure jaas authentication provider.
 *
 * @param auth the auth
 * @param jaas the jaas
 * @throws Exception the exception
 */
protected void configureJaasAuthenticationProvider(final AuthenticationManagerBuilder auth,
                          final MonitorProperties.Endpoints.JaasSecurity jaas) throws Exception {
  val p = new JaasAuthenticationProvider();
  p.setLoginConfig(jaas.getLoginConfig());
  p.setLoginContextName(jaas.getLoginContextName());
  p.setRefreshConfigurationOnStartup(jaas.isRefreshConfigurationOnStartup());
  p.afterPropertiesSet();
  auth.authenticationProvider(p);
}
org.springframework.security.authentication.jaasJaasAuthenticationProvider<init>

Popular methods of JaasAuthenticationProvider

  • getApplicationEventPublisher
  • getLoginContextName
  • configureJaas
    Hook method for configuring Jaas.
  • configureJaasUsingLoop
    Loops through the login.config.url.1,login.config.url.2 properties looking for the login configurati
  • convertLoginConfigToUrl
  • afterPropertiesSet
  • setLoginConfig
    Set the JAAS login configuration file.
  • setLoginContextName
  • authenticate
  • getAuthorityGranters
  • getCallbackHandlers
  • getLoginConfig
  • getCallbackHandlers,
  • getLoginConfig,
  • getLoginExceptionResolver,
  • handleLogout,
  • setApplicationEventPublisher,
  • setAuthorityGranters,
  • setCallbackHandlers,
  • setLoginExceptionResolver,
  • setRefreshConfigurationOnStartup

Popular in Java

  • Running tasks concurrently on multiple threads
  • getExternalFilesDir (Context)
  • startActivity (Activity)
  • requestLocationUpdates (LocationManager)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • Kernel (java.awt.image)
  • String (java.lang)
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now