test_class.declarator: loginModule = new ExternalLoginModule()
test_class.modifier: private final
test_class.original_string: private final ExternalLoginModule loginModule = new ExternalLoginModule();
test_class.type: ExternalLoginModule
test_class.var_name: loginModule
test_class.declarator: wb = spy(new DefaultWhiteboard())
test_class.modifier: private final
test_class.original_string: private final Whiteboard wb = spy(new DefaultWhiteboard());
test_class.type: Whiteboard
test_class.var_name: wb
test_class.declarator: extIPMgr = mock(ExternalIdentityProviderManager.class)
test_class.modifier: private final
test_class.original_string: private final ExternalIdentityProviderManager extIPMgr = mock(ExternalIdentityProviderManager.class);
test_class.type: ExternalIdentityProviderManager
test_class.var_name: extIPMgr
test_class.declarator: syncManager = mock(SyncManager.class)
test_class.modifier: private final
test_class.original_string: private final SyncManager syncManager = mock(SyncManager.class);
test_class.type: SyncManager
test_class.var_name: syncManager
test_class.file: oak-auth-external/src/test/java/org/apache/jackrabbit/oak/spi/security/authentication/external/impl/ExternalLoginModuleTest.java
test_class.identifier: ExternalLoginModuleTest
test_class.superclass: extends AbstractSecurityTest
test_case.body: @Test
      public void testInitializEmptySyncHanderName() {
          wb.register(SyncManager.class, syncManager, Collections.emptyMap());
  
          loginModule.initialize(new Subject(), createCallbackHandler(wb, null, null, null), Collections.emptyMap(), Collections.singletonMap(PARAM_SYNC_HANDLER_NAME, ""));
          verify(syncManager, never()).getSyncHandler("");
      }
test_case.class_method_signature: ExternalLoginModuleTest.testInitializEmptySyncHanderName()
test_case.full_signature: @Test public void testInitializEmptySyncHanderName()
test_case.identifier: testInitializEmptySyncHanderName
test_case.invocations: register emptyMap initialize createCallbackHandler emptyMap singletonMap getSyncHandler verify never
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testInitializEmptySyncHanderName()
focal_class.declarator: log = LoggerFactory.getLogger(ExternalLoginModule.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(ExternalLoginModule.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: MAX_SYNC_ATTEMPTS = 50
focal_class.modifier: private static final
focal_class.original_string: private static final int MAX_SYNC_ATTEMPTS = 50;
focal_class.type: int
focal_class.var_name: MAX_SYNC_ATTEMPTS
focal_class.declarator: PARAM_IDP_NAME = SyncHandlerMapping.PARAM_IDP_NAME
focal_class.modifier: public static final
focal_class.original_string: public static final String PARAM_IDP_NAME = SyncHandlerMapping.PARAM_IDP_NAME;
focal_class.type: String
focal_class.var_name: PARAM_IDP_NAME
focal_class.declarator: PARAM_SYNC_HANDLER_NAME = SyncHandlerMapping.PARAM_SYNC_HANDLER_NAME
focal_class.modifier: public static final
focal_class.original_string: public static final String PARAM_SYNC_HANDLER_NAME = SyncHandlerMapping.PARAM_SYNC_HANDLER_NAME;
focal_class.type: String
focal_class.var_name: PARAM_SYNC_HANDLER_NAME
focal_class.declarator: idpManager
focal_class.modifier: private
focal_class.original_string: private ExternalIdentityProviderManager idpManager;
focal_class.type: ExternalIdentityProviderManager
focal_class.var_name: idpManager
focal_class.declarator: syncManager
focal_class.modifier: private
focal_class.original_string: private SyncManager syncManager;
focal_class.type: SyncManager
focal_class.var_name: syncManager
focal_class.declarator: credentialsSupport = SimpleCredentialsSupport.getInstance()
focal_class.modifier: private
focal_class.original_string: private CredentialsSupport credentialsSupport = SimpleCredentialsSupport.getInstance();
focal_class.type: CredentialsSupport
focal_class.var_name: credentialsSupport
focal_class.declarator: osgiConfig
focal_class.modifier: private
focal_class.original_string: private ConfigurationParameters osgiConfig;
focal_class.type: ConfigurationParameters
focal_class.var_name: osgiConfig
focal_class.declarator: idp
focal_class.modifier: private
focal_class.original_string: private ExternalIdentityProvider idp;
focal_class.type: ExternalIdentityProvider
focal_class.var_name: idp
focal_class.declarator: syncHandler
focal_class.modifier: private
focal_class.original_string: private SyncHandler syncHandler;
focal_class.type: SyncHandler
focal_class.var_name: syncHandler
focal_class.declarator: externalUser
focal_class.modifier: private
focal_class.original_string: private ExternalUser externalUser;
focal_class.type: ExternalUser
focal_class.var_name: externalUser
focal_class.declarator: credentials
focal_class.modifier: private
focal_class.original_string: private Credentials credentials;
focal_class.type: Credentials
focal_class.var_name: credentials
focal_class.declarator: principals
focal_class.modifier: private
focal_class.original_string: private Set<? extends Principal> principals;
focal_class.type: Set<? extends Principal>
focal_class.var_name: principals
focal_class.declarator: authInfo
focal_class.modifier: private
focal_class.original_string: private AuthInfo authInfo;
focal_class.type: AuthInfo
focal_class.var_name: authInfo
focal_class.file: oak-auth-external/src/main/java/org/apache/jackrabbit/oak/spi/security/authentication/external/impl/ExternalLoginModule.java
focal_class.identifier: ExternalLoginModule
focal_class.class_method_signature: ExternalLoginModule.ExternalLoginModule()
focal_class.full_signature: @SuppressWarnings("UnusedDeclaration") public  ExternalLoginModule()
focal_class.identifier: ExternalLoginModule
focal_class.modifiers: @SuppressWarnings("UnusedDeclaration") public
focal_class.parameters: ()
focal_class.signature:  ExternalLoginModule()
focal_class.class_method_signature: ExternalLoginModule.ExternalLoginModule(ConfigurationParameters osgiConfig)
focal_class.full_signature: public  ExternalLoginModule(ConfigurationParameters osgiConfig)
focal_class.identifier: ExternalLoginModule
focal_class.modifiers: public
focal_class.parameters: (ConfigurationParameters osgiConfig)
focal_class.signature:  ExternalLoginModule(ConfigurationParameters osgiConfig)
focal_class.class_method_signature: ExternalLoginModule.initialize(Subject subject, CallbackHandler callbackHandler, Map<String, ?> sharedState, Map<String, ?> opts)
focal_class.full_signature: @Override public void initialize(Subject subject, CallbackHandler callbackHandler, Map<String, ?> sharedState, Map<String, ?> opts)
focal_class.identifier: initialize
focal_class.modifiers: @Override public
focal_class.parameters: (Subject subject, CallbackHandler callbackHandler, Map<String, ?> sharedState, Map<String, ?> opts)
focal_class.return: void
focal_class.signature: void initialize(Subject subject, CallbackHandler callbackHandler, Map<String, ?> sharedState, Map<String, ?> opts)
focal_class.class_method_signature: ExternalLoginModule.login()
focal_class.full_signature: @Override public boolean login()
focal_class.identifier: login
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean login()
focal_class.class_method_signature: ExternalLoginModule.commit()
focal_class.full_signature: @Override public boolean commit()
focal_class.identifier: commit
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean commit()
focal_class.class_method_signature: ExternalLoginModule.abort()
focal_class.full_signature: @Override public boolean abort()
focal_class.identifier: abort
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean abort()
focal_class.class_method_signature: ExternalLoginModule.logout()
focal_class.full_signature: @Override public boolean logout()
focal_class.identifier: logout
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean logout()
focal_class.class_method_signature: ExternalLoginModule.getUserId(@Nullable PreAuthenticatedLogin preAuthLogin, @Nullable Credentials credentials)
focal_class.full_signature: @Nullable private String getUserId(@Nullable PreAuthenticatedLogin preAuthLogin, @Nullable Credentials credentials)
focal_class.identifier: getUserId
focal_class.modifiers: @Nullable private
focal_class.parameters: (@Nullable PreAuthenticatedLogin preAuthLogin, @Nullable Credentials credentials)
focal_class.return: String
focal_class.signature: String getUserId(@Nullable PreAuthenticatedLogin preAuthLogin, @Nullable Credentials credentials)
focal_class.class_method_signature: ExternalLoginModule.getSyncedIdentity(@Nullable String userId)
focal_class.full_signature: @Nullable private SyncedIdentity getSyncedIdentity(@Nullable String userId)
focal_class.identifier: getSyncedIdentity
focal_class.modifiers: @Nullable private
focal_class.parameters: (@Nullable String userId)
focal_class.return: SyncedIdentity
focal_class.signature: SyncedIdentity getSyncedIdentity(@Nullable String userId)
focal_class.class_method_signature: ExternalLoginModule.ignore(@Nullable SyncedIdentity syncedIdentity, @Nullable PreAuthenticatedLogin preAuthLogin)
focal_class.full_signature: private boolean ignore(@Nullable SyncedIdentity syncedIdentity, @Nullable PreAuthenticatedLogin preAuthLogin)
focal_class.identifier: ignore
focal_class.modifiers: private
focal_class.parameters: (@Nullable SyncedIdentity syncedIdentity, @Nullable PreAuthenticatedLogin preAuthLogin)
focal_class.return: boolean
focal_class.signature: boolean ignore(@Nullable SyncedIdentity syncedIdentity, @Nullable PreAuthenticatedLogin preAuthLogin)
focal_class.class_method_signature: ExternalLoginModule.syncUser(@NotNull ExternalUser user)
focal_class.full_signature: private void syncUser(@NotNull ExternalUser user)
focal_class.identifier: syncUser
focal_class.modifiers: private
focal_class.parameters: (@NotNull ExternalUser user)
focal_class.return: void
focal_class.signature: void syncUser(@NotNull ExternalUser user)
focal_class.class_method_signature: ExternalLoginModule.validateUser(@NotNull String id)
focal_class.full_signature: private void validateUser(@NotNull String id)
focal_class.identifier: validateUser
focal_class.modifiers: private
focal_class.parameters: (@NotNull String id)
focal_class.return: void
focal_class.signature: void validateUser(@NotNull String id)
focal_class.class_method_signature: ExternalLoginModule.createAuthInfo(@NotNull String userId, @NotNull Set<? extends Principal> principals)
focal_class.full_signature: @NotNull private AuthInfo createAuthInfo(@NotNull String userId, @NotNull Set<? extends Principal> principals)
focal_class.identifier: createAuthInfo
focal_class.modifiers: @NotNull private
focal_class.parameters: (@NotNull String userId, @NotNull Set<? extends Principal> principals)
focal_class.return: AuthInfo
focal_class.signature: AuthInfo createAuthInfo(@NotNull String userId, @NotNull Set<? extends Principal> principals)
focal_class.class_method_signature: ExternalLoginModule.getRootOrThrow()
focal_class.full_signature: @NotNull private Root getRootOrThrow()
focal_class.identifier: getRootOrThrow
focal_class.modifiers: @NotNull private
focal_class.parameters: ()
focal_class.return: Root
focal_class.signature: Root getRootOrThrow()
focal_class.class_method_signature: ExternalLoginModule.getUsermanagerOrThrow()
focal_class.full_signature: @NotNull private UserManager getUsermanagerOrThrow()
focal_class.identifier: getUsermanagerOrThrow
focal_class.modifiers: @NotNull private
focal_class.parameters: ()
focal_class.return: UserManager
focal_class.signature: UserManager getUsermanagerOrThrow()
focal_class.class_method_signature: ExternalLoginModule.debug(@NotNull String msg, String... args)
focal_class.full_signature: private static void debug(@NotNull String msg, String... args)
focal_class.identifier: debug
focal_class.modifiers: private static
focal_class.parameters: (@NotNull String msg, String... args)
focal_class.return: void
focal_class.signature: void debug(@NotNull String msg, String... args)
focal_class.class_method_signature: ExternalLoginModule.clearState()
focal_class.full_signature: @Override protected void clearState()
focal_class.identifier: clearState
focal_class.modifiers: @Override protected
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void clearState()
focal_class.class_method_signature: ExternalLoginModule.getSupportedCredentials()
focal_class.full_signature: @NotNull @Override protected Set<Class> getSupportedCredentials()
focal_class.identifier: getSupportedCredentials
focal_class.modifiers: @NotNull @Override protected
focal_class.parameters: ()
focal_class.return: Set<Class>
focal_class.signature: Set<Class> getSupportedCredentials()
focal_class.class_method_signature: ExternalLoginModule.setSyncManager(@NotNull SyncManager syncManager)
focal_class.full_signature: public void setSyncManager(@NotNull SyncManager syncManager)
focal_class.identifier: setSyncManager
focal_class.modifiers: public
focal_class.parameters: (@NotNull SyncManager syncManager)
focal_class.return: void
focal_class.signature: void setSyncManager(@NotNull SyncManager syncManager)
focal_class.class_method_signature: ExternalLoginModule.setIdpManager(@NotNull ExternalIdentityProviderManager idpManager)
focal_class.full_signature: public void setIdpManager(@NotNull ExternalIdentityProviderManager idpManager)
focal_class.identifier: setIdpManager
focal_class.modifiers: public
focal_class.parameters: (@NotNull ExternalIdentityProviderManager idpManager)
focal_class.return: void
focal_class.signature: void setIdpManager(@NotNull ExternalIdentityProviderManager idpManager)
focal_class.superclass: extends AbstractLoginModule
focal_method.body: @Override
      public void initialize(Subject subject, CallbackHandler callbackHandler, Map<String, ?> sharedState, Map<String, ?> opts) {
          super.initialize(subject, callbackHandler, sharedState, opts);
  
          // merge options with osgi options if needed
          if (osgiConfig != null) {
              options = ConfigurationParameters.of(osgiConfig, options);
          }
  
          Whiteboard whiteboard = getWhiteboard();
          if (whiteboard == null) {
              log.error("External login module needs whiteboard. Will not be used for login.");
              return;
          }
  
          String idpName = options.getConfigValue(PARAM_IDP_NAME, "");
          if (idpName.isEmpty()) {
              log.error("External login module needs IPD name. Will not be used for login.");
          } else {
              if (idpManager == null) {
                  idpManager = WhiteboardUtils.getService(whiteboard, ExternalIdentityProviderManager.class);
              }
              if (idpManager == null) {
                  log.error("External login module needs IDPManager. Will not be used for login.");
              } else {
                  idp = idpManager.getProvider(idpName);
                  if (idp == null) {
                      log.error("No IDP found with name {}. Will not be used for login.", idpName);
                  }
              }
          }
  
          String syncHandlerName = options.getConfigValue(PARAM_SYNC_HANDLER_NAME, "");
          if (syncHandlerName.isEmpty()) {
              log.error("External login module needs SyncHandler name. Will not be used for login.");
          } else {
              if (syncManager == null) {
                  syncManager = WhiteboardUtils.getService(whiteboard, SyncManager.class);
              }
              if (syncManager == null) {
                  log.error("External login module needs SyncManager. Will not be used for login.");
              } else {
                  syncHandler = syncManager.getSyncHandler(syncHandlerName);
                  if (syncHandler == null) {
                      log.error("No SyncHandler found with name {}. Will not be used for login.", syncHandlerName);
                  }
              }
          }
  
          if (idp instanceof CredentialsSupport) {
              credentialsSupport = (CredentialsSupport) idp;
          } else {
              log.debug("No 'SupportedCredentials' configured. Using default implementation supporting 'SimpleCredentials'.");
          }
      }
focal_method.class_method_signature: ExternalLoginModule.initialize(Subject subject, CallbackHandler callbackHandler, Map<String, ?> sharedState, Map<String, ?> opts)
focal_method.full_signature: @Override public void initialize(Subject subject, CallbackHandler callbackHandler, Map<String, ?> sharedState, Map<String, ?> opts)
focal_method.identifier: initialize
focal_method.invocations: initialize of getWhiteboard error getConfigValue isEmpty error getService error getProvider error getConfigValue isEmpty error getService error getSyncHandler error debug
focal_method.modifiers: @Override public
focal_method.parameters: (Subject subject, CallbackHandler callbackHandler, Map<String, ?> sharedState, Map<String, ?> opts)
focal_method.return: void
focal_method.signature: void initialize(Subject subject, CallbackHandler callbackHandler, Map<String, ?> sharedState, Map<String, ?> opts)