Class KerberosServiceRequestToken
java.lang.Object
org.springframework.security.authentication.AbstractAuthenticationToken
org.springframework.security.kerberos.authentication.KerberosServiceRequestToken
- All Implemented Interfaces:
- Serializable,- Principal,- Authentication,- CredentialsContainer,- KerberosAuthentication
public class KerberosServiceRequestToken
extends AbstractAuthenticationToken
implements KerberosAuthentication
 Holds the Kerberos/SPNEGO token for requesting a kerberized service and is also the
 output of KerberosServiceAuthenticationProvider.
 
 Will mostly be created in SpnegoAuthenticationProcessingFilter and
 authenticated in KerberosServiceAuthenticationProvider.
 
- Since:
- 1.0
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from class org.springframework.security.authentication.AbstractAuthenticationTokenAbstractAuthenticationToken.AbstractAuthenticationBuilder<B extends AbstractAuthenticationToken.AbstractAuthenticationBuilder<B>>Nested classes/interfaces inherited from interface org.springframework.security.core.AuthenticationAuthentication.Builder<B extends Authentication.Builder<B>>
- 
Constructor SummaryConstructorsConstructorDescriptionKerberosServiceRequestToken(byte[] token) Creates an unauthenticated instance which should then be authenticated byKerberosServiceAuthenticationProvider.KerberosServiceRequestToken(Object principal, KerberosTicketValidation ticketValidation, Collection<? extends GrantedAuthority> authorities, byte[] token) Creates an authenticated token, normally used as an output of an authentication provider.
- 
Method SummaryModifier and TypeMethodDescriptionbyte[]decrypt(byte[] data) Unwraps an encrypted message using the gss contextbyte[]decrypt(byte[] data, int offset, int length) Unwraps an encrypted message using the gss contextbyte[]encrypt(byte[] data) Wraps an message using the gss contextbyte[]encrypt(byte[] data, int offset, int length) Wraps an message using the gss contextbooleanequals() is based only on the Kerberos tokenThe credentials that prove the principal is correct.Gets the (Base64) encoded response token assuming one is available.The identity of the principal being authenticated.Gets the ticket validationbyte[]getToken()Returns the Kerberos tokeninthashCode()Calculates hashcode based on the Kerberos tokenbooleanDetermines whether an authenticated token has a response tokenMethods inherited from class org.springframework.security.authentication.AbstractAuthenticationTokeneraseCredentials, getAuthorities, getDetails, getName, isAuthenticated, setAuthenticated, setDetails, toStringMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.security.core.AuthenticationtoBuilder
- 
Constructor Details- 
KerberosServiceRequestTokenpublic KerberosServiceRequestToken(Object principal, KerberosTicketValidation ticketValidation, Collection<? extends GrantedAuthority> authorities, byte[] token) Creates an authenticated token, normally used as an output of an authentication provider.- Parameters:
- principal- the user principal (mostly of instance- UserDetails)
- ticketValidation- result of ticket validation
- authorities- the authorities which are granted to the user
- token- the Kerberos/SPNEGO token
- See Also:
 
- 
KerberosServiceRequestTokenpublic KerberosServiceRequestToken(byte[] token) Creates an unauthenticated instance which should then be authenticated byKerberosServiceAuthenticationProvider.- Parameters:
- token- Kerberos/SPNEGO token
- See Also:
 
 
- 
- 
Method Details- 
equalsequals() is based only on the Kerberos token- Specified by:
- equalsin interface- Principal
- Overrides:
- equalsin class- AbstractAuthenticationToken
 
- 
hashCodepublic int hashCode()Calculates hashcode based on the Kerberos token- Specified by:
- hashCodein interface- Principal
- Overrides:
- hashCodein class- AbstractAuthenticationToken
 
- 
getCredentialsDescription copied from interface:AuthenticationThe credentials that prove the principal is correct. This is usually a password, but could be anything relevant to theAuthenticationManager. Callers are expected to populate the credentials.- Specified by:
- getCredentialsin interface- Authentication
- Returns:
- the credentials that prove the identity of the Principal
 
- 
getPrincipalDescription copied from interface:AuthenticationThe identity of the principal being authenticated. In the case of an authentication request with username and password, this would be the username. Callers are expected to populate the principal for an authentication request.The AuthenticationManager implementation will often return an Authentication containing richer information as the principal for use by the application. Many of the authentication providers will create a UserDetailsobject as the principal.- Specified by:
- getPrincipalin interface- Authentication
- Returns:
- the Principalbeing authenticated or the authenticated principal after authentication.
 
- 
getTokenpublic byte[] getToken()Returns the Kerberos token- Returns:
- the token data
 
- 
getTicketValidationGets the ticket validation- Returns:
- the ticket validation (which will be null if the token is unauthenticated)
 
- 
hasResponseTokenpublic boolean hasResponseToken()Determines whether an authenticated token has a response token- Returns:
- whether a response token is available
 
- 
getEncodedResponseTokenGets the (Base64) encoded response token assuming one is available.- Returns:
- encoded response token
 
- 
decryptUnwraps an encrypted message using the gss context- Parameters:
- data- the data
- offset- data offset
- length- data length
- Returns:
- the decrypted message
- Throws:
- PrivilegedActionException- if jaas throws and error
 
- 
decryptUnwraps an encrypted message using the gss context- Parameters:
- data- the data
- Returns:
- the decrypted message
- Throws:
- PrivilegedActionException- if jaas throws and error
 
- 
encryptWraps an message using the gss context- Parameters:
- data- the data
- offset- data offset
- length- data length
- Returns:
- the encrypted message
- Throws:
- PrivilegedActionException- if jaas throws and error
 
- 
encryptWraps an message using the gss context- Parameters:
- data- the data
- Returns:
- the encrypted message
- Throws:
- PrivilegedActionException- if jaas throws and error
 
- 
getJaasSubjectHolder- Specified by:
- getJaasSubjectHolderin interface- KerberosAuthentication
 
 
-