@Test public void testGetLoginContextWithCompleteProvider() throws Exception { String providerName = addProvider(true); ConfigurationParameters params = ConfigurationParameters.of(AuthenticationConfiguration.PARAM_CONFIG_SPI_NAME, providerName); LoginContextProvider lcp = newLoginContextProviderImpl(params); LoginContext ctx = lcp.getLoginContext(null, adminSession.getWorkspaceName()); ctx.login(); }
@Override @NotNull public LoginContext getLoginContext(Credentials credentials, String workspaceName) throws LoginException { Subject subject = getSubject(); if (subject != null && credentials == null) { log.debug("Found pre-authenticated subject: No further login actions required."); return new PreAuthContext(subject); } if (subject == null) { subject = new Subject(); } CallbackHandler handler = getCallbackHandler(credentials, workspaceName); return new JaasLoginContext(appName, subject, handler, getConfiguration()); }
LoginContextProviderImpl implements LoginContextProvider { @Override @NotNull public LoginContext getLoginContext(Credentials credentials, String workspaceName) throws LoginException { Subject subject = getSubject(); if (subject != null && credentials == null) { log.debug("Found pre-authenticated subject: No further login actions required."); return new PreAuthContext(subject); } if (subject == null) { subject = new Subject(); } CallbackHandler handler = getCallbackHandler(credentials, workspaceName); return new JaasLoginContext(appName, subject, handler, getConfiguration()); } }
LoginContextProviderImpl implements LoginContextProvider { @Override @NotNull public LoginContext getLoginContext(Credentials credentials, String workspaceName) throws LoginException { Subject subject = getSubject(); if (subject != null && credentials == null) { log.debug("Found pre-authenticated subject: No further login actions required."); return new PreAuthContext(subject); } if (subject == null) { subject = new Subject(); } CallbackHandler handler = getCallbackHandler(credentials, workspaceName); return new JaasLoginContext(appName, subject, handler, getConfiguration()); } LoginContextProviderImpl(String appName, ConfigurationParameters params,
                             ContentRepository contentRepository,
                             SecurityProvider securityProvider,
                             Whiteboard whiteboard,
                             LoginModuleMonitor loginModuleMonitor); }
LoginContextProviderImpl implements LoginContextProvider { @Override @NotNull public LoginContext getLoginContext(Credentials credentials, String workspaceName) throws LoginException { Subject subject = getSubject(); if (subject != null && credentials == null) { log.debug("Found pre-authenticated subject: No further login actions required."); return new PreAuthContext(subject); } if (subject == null) { subject = new Subject(); } CallbackHandler handler = getCallbackHandler(credentials, workspaceName); return new JaasLoginContext(appName, subject, handler, getConfiguration()); } LoginContextProviderImpl(String appName, ConfigurationParameters params,
                             ContentRepository contentRepository,
                             SecurityProvider securityProvider,
                             Whiteboard whiteboard,
                             LoginModuleMonitor loginModuleMonitor); @Override @NotNull LoginContext getLoginContext(Credentials credentials, String workspaceName); }
LoginContextProviderImpl implements LoginContextProvider { @Override @NotNull public LoginContext getLoginContext(Credentials credentials, String workspaceName) throws LoginException { Subject subject = getSubject(); if (subject != null && credentials == null) { log.debug("Found pre-authenticated subject: No further login actions required."); return new PreAuthContext(subject); } if (subject == null) { subject = new Subject(); } CallbackHandler handler = getCallbackHandler(credentials, workspaceName); return new JaasLoginContext(appName, subject, handler, getConfiguration()); } LoginContextProviderImpl(String appName, ConfigurationParameters params,
                             ContentRepository contentRepository,
                             SecurityProvider securityProvider,
                             Whiteboard whiteboard,
                             LoginModuleMonitor loginModuleMonitor); @Override @NotNull LoginContext getLoginContext(Credentials credentials, String workspaceName);  }