Class BasicAgent
- All Implemented Interfaces:
Predicate<ProfileRequestContext>,RelyingPartyConfiguration,RelyingPartyConfigurationResolver,Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent,Resolver<RelyingPartyConfiguration,,CriteriaSet> Agent,Application
Agent.-
Field Summary
FieldsModifier and TypeFieldDescriptionAllowed address ranges.private Map<String,Application> Application map.(package private) StringAuthentication method.Internally configured shared secrets.private CharsetCharacter set encoding for POST recovery.private longLimit on size of form data to preserve.private booleanWhether cached authentication is supported.private booleanWhether to support form submission preservation and recovery.Fields inherited from class net.shibboleth.sp.impl.BasicApplication
protocolServiceManager, protocolServiceMapFields inherited from interface net.shibboleth.sp.Agent
AUTH_METHOD_BASIC, DEFAULT_APPLICATION_ID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbooleanGet the network addresses or ranges of addresses from which requests from this agent may originate.getApplication(String id) Get anApplicationassociated with this agent.Dedicated method to access application ID for explicitness.Get allApplicationinstances associated with this agent.Get the authentication method to use for the agent.Gets the character encoding to apply during URI processing and POST recovery.Get the credentials configured to authenticate requests from this Agent.longGets the size limit to apply to form data preservation attempts.inthashCode()booleanisAllowed(InetAddress address) Returns true iff the supplied address matches one of the allowed ranges.booleanReturns true iff the agent supports cached authentication via cookie.booleanReturns true iff the agent is permitted to submit form data to preserve during SSO.voidsetAllowedAddressRanges(Set<IPRange> ranges) Set the network ranges from which this agent may make requests.voidsetApplications(Set<Application> applications) Sets theApplicationinstances associated with this agent.voidsetAuthenticationMethod(String method) Set the authentication method to require for this agent.voidsetCharacterEncoding(String name) Sets the character encoding to apply for POST recovery.voidsetCredentials(Map<String, String> creds) Sets the credentials to store directly in this Agent.voidsetPostLimit(long limit) Sets limit on size of form data to preserve.voidsetSupportsCachedAuthentication(boolean flag) Sets whether this agent supports cached authentication via cookie.voidsetSupportsPostPreservation(boolean flag) Sets whether agent is permitted to submit form data for preservation during SSO.voidsetUsernames(Collection<String> usernames) Sets the usernames to use for this Agent, implying that the passwords are maintained externally.toString()Methods inherited from class net.shibboleth.sp.impl.BasicApplication
getAttributeFilter, getAttributeResolver, getAttributeTranscoderRegistry, getAuthenticatingAuthority, getDiscoveryService, getEncryptionCredentials, getIssuer, getLogoutConsumers, getLogoutInitiators, getParent, getProfileConfiguration, getProfileConfigurations, getProtocolSupportService, getSecurityConfiguration, getSessionInitiators, getSigningCredentials, getStateManager, getTokenConsumers, isAllowInheritance, resolve, resolveSingle, setAllowInheritance, setAttributeFilter, setAttributeResolver, setAttributeTranscoderRegistry, setAuthenticatingAuthority, setAuthenticatingAuthorityLookupStrategy, setCredentialResolver, setDefaultConfiguration, setDiscoveryService, setDiscoveryServiceLookupStrategy, setEncryptionCredentials, setLogoutConsumers, setLogoutConsumersLookupStrategy, setLogoutInitiators, setLogoutInitiatorsLookupStrategy, setMetricName, setParent, setProtocolSupportServices, setRelyingPartyConfigurations, setSessionInitiators, setSessionInitiatorsLookupStrategy, setSigningCredentials, setStateManager, setTokenConsumers, setTokenConsumersLookupStrategy, setUnverifiedConfigurationMethods inherited from class net.shibboleth.profile.relyingparty.BasicRelyingPartyConfiguration
isDetailedErrors, setActivationCondition, setDetailedErrors, setDetailedErrorsPredicate, setIssuer, setIssuerLookupStrategy, setProfileConfigurations, setProfileConfigurationsLookupStrategy, setResponderId, setResponderIdLookupStrategy, setSecurityConfiguration, setSecurityConfigurationLookupStrategy, testMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
setIdMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentExceptionMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.IdentifiedComponent
getIdMethods inherited from interface net.shibboleth.shared.component.InitializableComponent
initialize, isInitializedMethods inherited from interface net.shibboleth.profile.relyingparty.RelyingPartyConfiguration
isDetailedErrors, setResponderId
-
Field Details
-
supportsCachedAuthentication
private boolean supportsCachedAuthenticationWhether cached authentication is supported. -
allowedAddressRanges
Allowed address ranges. -
authenticationMethod
Authentication method. -
supportsPostPreservation
private boolean supportsPostPreservationWhether to support form submission preservation and recovery. -
postLimit
private long postLimitLimit on size of form data to preserve. -
encoding
Character set encoding for POST recovery. -
credentials
Internally configured shared secrets. -
applicationMap
Application map.
-
-
Constructor Details
-
BasicAgent
public BasicAgent(@ParameterName(name="protocolManager") @Nonnull ProtocolSupportServiceManager protocolManager) Constructor.- Parameters:
protocolManager- injected plugin capability objects
-
-
Method Details
-
getApplicationId
Dedicated method to access application ID for explicitness.- Specified by:
getApplicationIdin interfaceApplication- Overrides:
getApplicationIdin classBasicApplication- Returns:
- application ID
-
getAllowedAddressRanges
Get the network addresses or ranges of addresses from which requests from this agent may originate.- Specified by:
getAllowedAddressRangesin interfaceAgent- Returns:
- set of address ranges
-
setAllowedAddressRanges
Set the network ranges from which this agent may make requests.- Parameters:
ranges- allowed ranges
-
isAllowed
Returns true iff the supplied address matches one of the allowed ranges. -
getAuthenticationMethod
Get the authentication method to use for the agent.Authentication methods are in addition to address restrictions.
The only currently defined value is
Agent.AUTH_METHOD_BASIC.- Specified by:
getAuthenticationMethodin interfaceAgent- Returns:
- authentication method/type, null for none
-
setAuthenticationMethod
Set the authentication method to require for this agent.Defaults to
Agent.AUTH_METHOD_BASIC.- Parameters:
method- method identifier
-
getCredentials
Get the credentials configured to authenticate requests from this Agent.The map keys expose the "identifiers" usable by the Agent when authenticating itself (service account username(s) in other words). The values MAY be null in the case that actual authentication is handled using LDAP, Kerberos, etc., but MAY be populated for direct configuration of shared secrets.
If a map key is null, then the Agent's unique ID can be used as a "username".
- Specified by:
getCredentialsin interfaceAgent- Returns:
- set of username/shared secret mappings, either of which may be null
-
setCredentials
Sets the credentials to store directly in this Agent.A null key may be used to fall back to
AbstractIdentifiedInitializableComponent.getId(), while a null value may be used to signify an "external" authentication mechanism be used.- Parameters:
creds- mappings of username/secret pairs to accept
-
setUsernames
Sets the usernames to use for this Agent, implying that the passwords are maintained externally.- Parameters:
usernames- usernames for Agent authentication
-
isSupportsCachedAuthentication
public boolean isSupportsCachedAuthentication()Returns true iff the agent supports cached authentication via cookie.- Specified by:
isSupportsCachedAuthenticationin interfaceAgent- Returns:
- true iff the agent supports cached authentication via cookie
-
setSupportsCachedAuthentication
public void setSupportsCachedAuthentication(boolean flag) Sets whether this agent supports cached authentication via cookie.Defaults to true.
- Parameters:
flag- flag to set
-
isSupportsPostPreservation
public boolean isSupportsPostPreservation()Returns true iff the agent is permitted to submit form data to preserve during SSO.Defaults to false.
- Specified by:
isSupportsPostPreservationin interfaceAgent- Returns:
- true iff the agent is permitted to submit form data to preserve
-
setSupportsPostPreservation
public void setSupportsPostPreservation(boolean flag) Sets whether agent is permitted to submit form data for preservation during SSO.- Parameters:
flag- flag to set
-
getPostLimit
public long getPostLimit()Gets the size limit to apply to form data preservation attempts.The default is 1024 * 1024.
Zero indicates no inherent limit.
- Specified by:
getPostLimitin interfaceAgent- Returns:
- size limit for form data preservation
-
setPostLimit
Sets limit on size of form data to preserve.- Parameters:
limit- size limit or 0 for none
-
getCharacterEncoding
Gets the character encoding to apply during URI processing and POST recovery.Defaults to UTF-8.
- Specified by:
getCharacterEncodingin interfaceAgent- Returns:
- name of encoding
-
setCharacterEncoding
Sets the character encoding to apply for POST recovery.- Parameters:
name- name of encoding
-
setApplications
Sets theApplicationinstances associated with this agent.- Parameters:
applications- applications associated with this agent
-
getApplication
Get anApplicationassociated with this agent.- Specified by:
getApplicationin interfaceAgent- Parameters:
id- application id- Returns:
- the corresponding application or null
-
getApplications
Get allApplicationinstances associated with this agent.- Specified by:
getApplicationsin interfaceAgent- Returns:
- collection of applications
-
doInitialize
- Overrides:
doInitializein classBasicApplication- Throws:
ComponentInitializationException
-
hashCode
public int hashCode()- Overrides:
hashCodein classBasicApplication
-
equals
- Overrides:
equalsin classBasicApplication
-
toString
- Overrides:
toStringin classBasicApplication
-