public class SPNEGOServerSocket extends ServerSocket
ServerSocket
that tries to establish a GSSContext
when a Socket
connects to it.Constructor and Description |
---|
SPNEGOServerSocket() |
SPNEGOServerSocket(int port) |
SPNEGOServerSocket(int port,
int backlog) |
SPNEGOServerSocket(int port,
int backlog,
InetAddress bindAddr) |
Modifier and Type | Method and Description |
---|---|
Socket |
accept()
Tries to establish a
GSSContext with the client using the tokens
provided. |
protected void |
acceptSocket(Socket socket,
NegotiationContext negotiationContext)
Accepts a
Socket connection by trying to do a JAAS Kerberos login using the tokens exchanged
with the client. |
void |
close() |
protected void |
flushPrincipalFromCache(Principal principal,
String securityDomain)
Removes the user entry from the authentication cache.
|
protected Principal |
getClientPrincipal(byte[] ticket,
Subject subject)
Decodes and parses the ticket to retrieve the client
Principal . |
String |
getHostSecurityDomain()
Returns the Kerberos security domain.
|
String |
getSecurityDomain()
Returns the security domain securing the EJBs.
|
protected boolean |
isValid(Principal principal,
Object credential,
String securityDomain)
Performs a JAAS login.
|
protected Subject |
login()
Performs a JAAS login on the client side.
|
protected void |
logout()
Performs a JAAS logout on the client side.
|
void |
setHostSecurityDomain(String hostSecurityDomain)
Sets the Kerberos security domain.
|
void |
setSecurityDomain(String securityDomain)
Sets the security domain securing the EJBs.
|
bind, bind, getChannel, getInetAddress, getLocalPort, getLocalSocketAddress, getReceiveBufferSize, getReuseAddress, getSoTimeout, implAccept, isBound, isClosed, setPerformancePreferences, setReceiveBufferSize, setReuseAddress, setSocketFactory, setSoTimeout, toString
public SPNEGOServerSocket() throws IOException
IOException
ServerSocket.ServerSocket()
public SPNEGOServerSocket(int port) throws IOException
IOException
ServerSocket.ServerSocket(int)
public SPNEGOServerSocket(int port, int backlog) throws IOException
IOException
ServerSocket.ServerSocket(int, int)
public SPNEGOServerSocket(int port, int backlog, InetAddress bindAddr) throws IOException
IOException
ServerSocket.ServerSocket(int, int, InetAddress)
public Socket accept() throws IOException
GSSContext
with the client using the tokens
provided.accept
in class ServerSocket
IOException
ServerSocket.accept()
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class ServerSocket
IOException
ServerSocket.close()
protected void acceptSocket(Socket socket, NegotiationContext negotiationContext) throws Exception
Socket
connection by trying to do a JAAS Kerberos login using the tokens exchanged
with the client.socket
- Client Socket
negotiationContext
- NegotiationContext
to be used for the JAAS loginIOException
NegotiationException
NamingException
Exception
protected boolean isValid(Principal principal, Object credential, String securityDomain) throws Exception
protected void flushPrincipalFromCache(Principal principal, String securityDomain) throws Exception
public String getSecurityDomain()
public void setSecurityDomain(String securityDomain)
securityDomain
- name of the security domainpublic String getHostSecurityDomain()
public void setHostSecurityDomain(String hostSecurityDomain)
hostSecurityDomain
- name of the security domainprotected Subject login() throws LoginException
Subject
LoginException
- if the login failsprotected void logout() throws LoginException
LoginException
- if the logout failsCopyright © 2018 JBoss by Red Hat. All rights reserved.