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 testValidateUser() throws Exception {
          when(extIPMgr.getProvider(DEFAULT_IDP_NAME)).thenReturn(new TestIdentityProvider());
          when(syncManager.getSyncHandler("syncHandler")).thenReturn(new DefaultSyncHandler(new DefaultSyncConfigImpl().setName("syncHandler")));
  
          wb.register(ExternalIdentityProviderManager.class, extIPMgr, Collections.emptyMap());
          wb.register(SyncManager.class, syncManager, Collections.emptyMap());
  
          Map<String,Object> sharedState = Maps.newHashMap();
          sharedState.put(SHARED_KEY_PRE_AUTH_LOGIN, new PreAuthenticatedLogin("local"));
  
          User u = getUserManager(root).createUser("local", null);
          u.setProperty(REP_EXTERNAL_ID, getValueFactory().createValue("local;"+TestIdentityProvider.DEFAULT_IDP_NAME));
          root.commit();
  
          CallbackHandler cbh = createCallbackHandler(wb, getContentRepository(), getSecurityProvider(), null);
  
          loginModule.initialize(new Subject(), cbh, sharedState, ImmutableMap.of(PARAM_IDP_NAME, DEFAULT_IDP_NAME, PARAM_SYNC_HANDLER_NAME, "syncHandler"));
          assertFalse(loginModule.login());
          root.refresh();
          assertNull(getUserManager(root).getAuthorizable("local"));
  
          assertFalse(loginModule.commit());
          assertFalse(loginModule.logout());
      }
test_case.class_method_signature: ExternalLoginModuleTest.testValidateUser()
test_case.full_signature: @Test public void testValidateUser()
test_case.identifier: testValidateUser
test_case.invocations: thenReturn when getProvider thenReturn when getSyncHandler setName register emptyMap register emptyMap newHashMap put createUser getUserManager setProperty createValue getValueFactory commit createCallbackHandler getContentRepository getSecurityProvider initialize of assertFalse login refresh assertNull getAuthorizable getUserManager assertFalse commit assertFalse logout
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testValidateUser()
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: private void validateUser(@NotNull String id) throws SyncException {
          Root root = getRootOrThrow();
          UserManager userManager = getUsermanagerOrThrow();
          SyncContext context = syncHandler.createContext(idp, userManager, new ValueFactoryImpl(root, NamePathMapper.DEFAULT));
          try {
              DebugTimer timer = new DebugTimer();
              context = syncHandler.createContext(idp, userManager, new ValueFactoryImpl(root, NamePathMapper.DEFAULT));
              context.sync(id);
              timer.mark("sync");
              root.commit();
              timer.mark("commit");
              debug("validateUser({}) {}", id, timer.getString());
          } catch (CommitFailedException e) {
              throw new SyncException("User synchronization failed during commit.", e);
          } finally {
              context.close();
          }
      }
focal_method.class_method_signature: ExternalLoginModule.validateUser(@NotNull String id)
focal_method.full_signature: private void validateUser(@NotNull String id)
focal_method.identifier: validateUser
focal_method.invocations: getRootOrThrow getUsermanagerOrThrow createContext createContext sync mark commit mark debug getString close
focal_method.modifiers: private
focal_method.parameters: (@NotNull String id)
focal_method.return: void
focal_method.signature: void validateUser(@NotNull String id)