Tabnine Logo
AuthenticationManager.registerAuthenticationProvider
Code IndexAdd Tabnine to your IDE (free)

How to use
registerAuthenticationProvider
method
in
org.pentaho.di.core.auth.core.AuthenticationManager

Best Java code snippets using org.pentaho.di.core.auth.core.AuthenticationManager.registerAuthenticationProvider (Showing top 9 results out of 315)

origin: pentaho/pentaho-kettle

@Before
public void setup() {
 manager = new AuthenticationManager();
 noAuthenticationAuthenticationProvider = new NoAuthenticationAuthenticationProvider();
 manager.registerAuthenticationProvider( noAuthenticationAuthenticationProvider );
}
origin: pentaho/pentaho-kettle

@SuppressWarnings( { "rawtypes", "unchecked" } )
@Test
public void testRegisterConsumerFactory() throws AuthenticationConsumptionException, AuthenticationFactoryException {
 AuthenticationConsumer<Object, KerberosAuthenticationProvider> authConsumer = mock( AuthenticationConsumer.class );
 AuthenticationConsumerFactory<Object, AuthenticationConsumer, KerberosAuthenticationProvider> factory =
   mock( AuthenticationConsumerFactory.class );
 when( factory.getReturnType() ).thenReturn( Object.class );
 when( factory.getCreateArgType() ).thenReturn( AuthenticationConsumer.class );
 when( factory.getConsumedType() ).thenReturn( KerberosAuthenticationProvider.class );
 when( factory.create( authConsumer ) ).thenReturn( authConsumer );
 KerberosAuthenticationProvider kerberosAuthenticationProvider =
   new KerberosAuthenticationProvider( "kerb", "kerb", true, "pass", true, "none" );
 manager.registerAuthenticationProvider( kerberosAuthenticationProvider );
 manager.registerConsumerFactory( factory );
 manager.getAuthenticationPerformer( Object.class, AuthenticationConsumer.class,
   kerberosAuthenticationProvider.getId() ).perform( authConsumer );
 verify( authConsumer ).consume( kerberosAuthenticationProvider );
}
origin: pentaho/pentaho-kettle

@SuppressWarnings( "rawtypes" )
@Test
public void testGetSupportedPerformers() throws AuthenticationConsumptionException, AuthenticationFactoryException {
 manager.registerConsumerClass( DelegatingNoAuthConsumer.class );
 manager.registerConsumerClass( DelegatingUsernamePasswordConsumer.class );
 manager.registerConsumerClass( DelegatingKerberosConsumer.class );
 UsernamePasswordAuthenticationProvider usernamePasswordAuthenticationProvider =
   new UsernamePasswordAuthenticationProvider( "upass", "u", "pass" );
 manager.registerAuthenticationProvider( usernamePasswordAuthenticationProvider );
 KerberosAuthenticationProvider kerberosAuthenticationProvider =
   new KerberosAuthenticationProvider( "kerb", "kerb", true, "pass", true, "none" );
 manager.registerAuthenticationProvider( kerberosAuthenticationProvider );
 List<AuthenticationPerformer<Object, AuthenticationConsumer>> performers =
   manager.getSupportedAuthenticationPerformers( Object.class, AuthenticationConsumer.class );
 assertEquals( 3, performers.size() );
 Set<String> ids =
   new HashSet<String>( Arrays.asList( NoAuthenticationAuthenticationProvider.NO_AUTH_ID,
     usernamePasswordAuthenticationProvider.getId(), kerberosAuthenticationProvider.getId() ) );
 for ( AuthenticationPerformer<Object, AuthenticationConsumer> performer : performers ) {
  ids.remove( performer.getAuthenticationProvider().getId() );
 }
 assertEquals( 0, ids.size() );
}
origin: pentaho/pentaho-kettle

@SuppressWarnings( "unchecked" )
@Test
public void testUsernamePasswordProviderConsumer() throws AuthenticationConsumptionException,
 AuthenticationFactoryException {
 manager.registerConsumerClass( DelegatingNoAuthConsumer.class );
 manager.registerConsumerClass( DelegatingUsernamePasswordConsumer.class );
 UsernamePasswordAuthenticationProvider usernamePasswordAuthenticationProvider =
   new UsernamePasswordAuthenticationProvider( "upass", "u", "pass" );
 manager.registerAuthenticationProvider( usernamePasswordAuthenticationProvider );
 AuthenticationConsumer<Object, UsernamePasswordAuthenticationProvider> consumer =
   mock( AuthenticationConsumer.class );
 manager.getAuthenticationPerformer( Object.class, AuthenticationConsumer.class,
   usernamePasswordAuthenticationProvider.getId() ).perform( consumer );
 verify( consumer ).consume( usernamePasswordAuthenticationProvider );
}
origin: pentaho/pentaho-kettle

@SuppressWarnings( "unchecked" )
@Test
public void testKerberosProviderConsumer() throws AuthenticationConsumptionException, AuthenticationFactoryException {
 manager.registerConsumerClass( DelegatingNoAuthConsumer.class );
 manager.registerConsumerClass( DelegatingUsernamePasswordConsumer.class );
 manager.registerConsumerClass( DelegatingKerberosConsumer.class );
 KerberosAuthenticationProvider kerberosAuthenticationProvider =
   new KerberosAuthenticationProvider( "kerb", "kerb", true, "pass", true, "none" );
 manager.registerAuthenticationProvider( kerberosAuthenticationProvider );
 AuthenticationConsumer<Object, KerberosAuthenticationProvider> consumer = mock( AuthenticationConsumer.class );
 manager.getAuthenticationPerformer( Object.class, AuthenticationConsumer.class,
   kerberosAuthenticationProvider.getId() ).perform( consumer );
 verify( consumer ).consume( kerberosAuthenticationProvider );
}
origin: pentaho/pentaho-kettle

UsernamePasswordAuthenticationProvider usernamePasswordAuthenticationProvider =
  new UsernamePasswordAuthenticationProvider( "upass", "u", "pass" );
manager.registerAuthenticationProvider( usernamePasswordAuthenticationProvider );
performers = manager.getSupportedAuthenticationPerformers( Object.class, AuthenticationConsumer.class );
assertEquals( 2, performers.size() );
origin: pentaho/pentaho-kettle

public static AuthenticationManager getAuthenticationManager() {
 AuthenticationManager manager = new AuthenticationManager();
 manager.registerAuthenticationProvider( new NoAuthenticationAuthenticationProvider() );
 // TODO: Register providers from metastore
 for ( PluginInterface plugin : PluginRegistry.getInstance().getPlugins( AuthenticationConsumerPluginType.class ) ) {
  try {
   Object pluginMain = PluginRegistry.getInstance().loadClass( plugin );
   if ( pluginMain instanceof AuthenticationConsumerType ) {
    Class<? extends AuthenticationConsumer<?, ?>> consumerClass =
      ( (AuthenticationConsumerType) pluginMain ).getConsumerClass();
    manager.registerConsumerClass( consumerClass );
   } else {
    throw new KettlePluginException( BaseMessages.getString( PKG,
      "AuthenticationPersistenceManager.NotConsumerType", pluginMain, AuthenticationConsumerType.class ) );
   }
  } catch ( KettlePluginException e ) {
   log.logError( e.getMessage(), e );
  } catch ( AuthenticationFactoryException e ) {
   log.logError( e.getMessage(), e );
  }
 }
 return manager;
}
origin: pentaho/pentaho-kettle

KerberosAuthenticationProvider kerberosAuthenticationProvider =
  new KerberosAuthenticationProvider( "kerb", "kerb", true, "pass", true, "none" );
manager.registerAuthenticationProvider( kerberosAuthenticationProvider );
AuthenticationConsumer<Object, KerberosAuthenticationProviderProxyInterface> consumer =
  mock( AuthenticationConsumer.class );
origin: pentaho/pentaho-hadoop-shims

manager.registerAuthenticationProvider( provider );
org.pentaho.di.core.auth.coreAuthenticationManagerregisterAuthenticationProvider

Popular methods of AuthenticationManager

  • <init>
  • getAuthenticationPerformer
  • getSupportedAuthenticationPerformers
  • registerConsumerClass
  • registerConsumerFactory
  • getRelevantConsumerFactoryMap
  • setAuthenticationPerformerFactory
  • unregisterAuthenticationProvider

Popular in Java

  • Updating database using SQL prepared statement
  • getSupportFragmentManager (FragmentActivity)
  • getApplicationContext (Context)
  • startActivity (Activity)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Top Vim 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