private void clearState() { removeAllSamlCredentials(subject); samlToken = null; }
/** * Called if the overall authentication failed (phase 2). */ public boolean abort() throws LoginException { success = false; clearState(); return true; }
final Builder builder = createBuilder(); if (useOptionsCredentials) { useCredentialsFromOptions(builder, options); } else if (isUseFirstPass()) { useCredentialsFromSharedState(builder); } else { useCredentialsFromCallback(builder); setPasswordStackingCredentials(builder); final STSClient stsClient = createWSTrustClient(builder.build()); final Element token = invokeSTS(stsClient); setSuccess(true); setSamlToken(token); setSharedToken(token); return true; } catch (WSTrustException e) {
protected void useCredentialsFromSharedState(final Builder builder) { builder.username(getSharedUsername()).password(new String(getSharedPassword())); }
return new STSClientConfig.Builder(getRequiredOption(getOptions(), STS_CONFIG_FILE));
/** * This method gives users a chance to override how the {@link STSClientConfig} is created. For example some users might * perfer to not use a file containing the configuration properties, which is the default, but instead have the * configuration options in the login modules configuration directly. * * @param options The options passed to the initialize method. * @return {@link STSClientConfig} The configuration for STSClient. */ protected STSClientConfig getConfiguration(final Map<String, ?> options) { final String configFile = getRequiredOption(options, STS_CONFIG_FILE); return new STSClientConfig.Builder(configFile).build(); }
try getCallbackHandler().handle(new Callback[] {nameCallback, passwordCallback}); String userNameStr = nameCallback.getName();
@SuppressWarnings("deprecation") protected void populateSubject() { MappingManager mappingManager = getMappingManager(); if (mappingManager == null) { return;
final Builder builder = createBuilder(); if (useOptionsCredentials) useCredentialsFromOptions(builder, options); else if (isUseFirstPass()) useCredentialsFromSharedState(builder); useCredentialsFromCallback(builder); setPasswordStackingCredentials(builder); final STSClient stsClient = createWSTrustClient(builder.build()); final Element token = invokeSTS(stsClient); setSuccess(true); setSamlToken(token); setSharedToken(token); return true;
protected void useCredentialsFromSharedState(final Builder builder) { builder.username(getSharedUsername()).password(new String(getSharedPassword())); }
return new STSClientConfig.Builder(getRequiredOption(getOptions(), STS_CONFIG_FILE));
/** * This method gives users a chance to override how the {@link STSClientConfig} is created. For example some users might * perfer to not use a file containing the configuration properties, which is the default, but instead have the * configuration options in the login modules configuration directly. * * @param options The options passed to the initialize method. * @return {@link STSClientConfig} The configuration for STSClient. */ protected STSClientConfig getConfiguration(final Map<String, ?> options) { final String configFile = getRequiredOption(options, STS_CONFIG_FILE); return new STSClientConfig.Builder(configFile).build(); }
try getCallbackHandler().handle(new Callback[] {nameCallback, passwordCallback}); String userNameStr = nameCallback.getName();
@SuppressWarnings("deprecation") protected void populateSubject() { MappingManager mappingManager = getMappingManager(); if (mappingManager == null) { return;
final Builder builder = createBuilder(); if (useOptionsCredentials) useCredentialsFromOptions(builder, options); else if (isUseFirstPass()) useCredentialsFromSharedState(builder); useCredentialsFromCallback(builder); setPasswordStackingCredentials(builder); final STSClient stsClient = createWSTrustClient(builder.build()); final Element token = invokeSTS(stsClient); setSuccess(true); setSamlToken(token); setSharedToken(token); return true;
private void clearState() { removeAllSamlCredentials(subject); samlToken = null; }
protected void useCredentialsFromSharedState(final Builder builder) { builder.username(getSharedUsername()).password(new String(getSharedPassword())); }
return new STSClientConfig.Builder(getRequiredOption(getOptions(), STS_CONFIG_FILE)); } else { Builder builder = new Builder();
public boolean logout() throws LoginException { clearState(); return true; }
/** * This method gives users a chance to override how the {@link STSClientConfig} is created. For example some users might * perfer to not use a file containing the configuration properties, which is the default, but instead have the * configuration options in the login modules configuration directly. * * @param options The options passed to the initialize method. * @return {@link STSClientConfig} The configuration for STSClient. */ protected STSClientConfig getConfiguration(final Map<String, ?> options) { final String configFile = getRequiredOption(options, STS_CONFIG_FILE); return new STSClientConfig.Builder(configFile).build(); }