public class KerberosServiceRequestToken
extends org.springframework.security.authentication.AbstractAuthenticationToken
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
.
KerberosServiceAuthenticationProvider
,
Serialized FormConstructor and Description |
---|
KerberosServiceRequestToken(byte[] token)
Creates an unauthenticated instance which should then be authenticated by
KerberosServiceAuthenticationProvider . |
KerberosServiceRequestToken(java.lang.Object principal,
KerberosTicketValidation ticketValidation,
java.util.Collection<? extends org.springframework.security.core.GrantedAuthority> authorities,
byte[] token)
Creates an authenticated token, normally used as an output of an
authentication provider.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
decrypt(byte[] data)
Unwraps an encrypted message using the gss context
|
byte[] |
decrypt(byte[] data,
int offset,
int length)
Unwraps an encrypted message using the gss context
|
byte[] |
encrypt(byte[] data)
Wraps an message using the gss context
|
byte[] |
encrypt(byte[] data,
int offset,
int length)
Wraps an message using the gss context
|
boolean |
equals(java.lang.Object obj)
equals() is based only on the Kerberos token
|
java.lang.Object |
getCredentials() |
java.lang.String |
getEncodedResponseToken()
Gets the (Base64) encoded response token assuming one is available.
|
java.lang.Object |
getPrincipal() |
KerberosTicketValidation |
getTicketValidation()
Gets the ticket validation
|
byte[] |
getToken()
Returns the Kerberos token
|
int |
hashCode()
Calculates hashcode based on the Kerberos token
|
boolean |
hasResponseToken()
Determines whether an authenticated token has a response token
|
public KerberosServiceRequestToken(java.lang.Object principal, KerberosTicketValidation ticketValidation, java.util.Collection<? extends org.springframework.security.core.GrantedAuthority> authorities, byte[] token)
principal
- the user principal (mostly of instance UserDetails
)ticketValidation
- result of ticket validationauthorities
- the authorities which are granted to the usertoken
- the Kerberos/SPNEGO tokenUserDetails
public KerberosServiceRequestToken(byte[] token)
KerberosServiceAuthenticationProvider
.token
- Kerberos/SPNEGO tokenKerberosServiceAuthenticationProvider
public int hashCode()
hashCode
in interface java.security.Principal
hashCode
in class org.springframework.security.authentication.AbstractAuthenticationToken
public boolean equals(java.lang.Object obj)
equals
in interface java.security.Principal
equals
in class org.springframework.security.authentication.AbstractAuthenticationToken
public java.lang.Object getCredentials()
public java.lang.Object getPrincipal()
public byte[] getToken()
public KerberosTicketValidation getTicketValidation()
public boolean hasResponseToken()
public java.lang.String getEncodedResponseToken()
public byte[] decrypt(byte[] data, int offset, int length) throws java.security.PrivilegedActionException
data
- the dataoffset
- data offsetlength
- data lengthjava.security.PrivilegedActionException
- if jaas throws and errorpublic byte[] decrypt(byte[] data) throws java.security.PrivilegedActionException
data
- the datajava.security.PrivilegedActionException
- if jaas throws and errorpublic byte[] encrypt(byte[] data, int offset, int length) throws java.security.PrivilegedActionException
data
- the dataoffset
- data offsetlength
- data lengthjava.security.PrivilegedActionException
- if jaas throws and errorpublic byte[] encrypt(byte[] data) throws java.security.PrivilegedActionException
data
- the datajava.security.PrivilegedActionException
- if jaas throws and error