Class RadiusConn
- java.lang.Object
-
- com.sun.identity.authentication.modules.radius.client.RadiusConn
-
public class RadiusConn extends Object
This class implements RFC2865 - Remote Authentication Dial In User Service (RADIUS), June 2000.
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_TIMEOUT
The default timeout.
-
Constructor Summary
Constructors Constructor Description RadiusConn(Set<RADIUSServer> primaries, String secret, byte[] seed, int healthCheckInterval)
Constructs a connection object with only a set of primary servers.RadiusConn(Set<RADIUSServer> primaries, Set<RADIUSServer> secondaries, String secret, int timeout, byte[] seed, int healthCheckInterval)
Construct a connection object primary and secondary servers and seed for generating aSecureRandom
.RadiusConn(Set<RADIUSServer> primaries, Set<RADIUSServer> secondaries, String secret, int timeout, int healthCheckInterval)
Construct a connection object with a set of primary and seconary servers.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Packet
authenticate(String name, String password)
Authenticates the username and password against the remote servers.void
disconnect()
Disconnects the underlying datagram socket.Packet
replyChallenge(String name, String password, ChallengeException ce)
Sends an access-request to the server in response to a challenge request.
-
-
-
Field Detail
-
DEFAULT_TIMEOUT
public static final int DEFAULT_TIMEOUT
The default timeout.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RadiusConn
public RadiusConn(Set<RADIUSServer> primaries, Set<RADIUSServer> secondaries, String secret, int timeout, int healthCheckInterval) throws SocketException
Construct a connection object with a set of primary and seconary servers.- Parameters:
primaries
- the primary servers to connect to.secondaries
- the secondary servers to connect to.secret
- the secret shared between this client and the remote servers.timeout
- the timeout value.healthCheckInterval
- the health check interval.- Throws:
SocketException
- thrown if unable to create a DatagramSocket.
-
RadiusConn
public RadiusConn(Set<RADIUSServer> primaries, String secret, byte[] seed, int healthCheckInterval) throws SocketException
Constructs a connection object with only a set of primary servers.- Parameters:
primaries
- the primary servers to connect to.secret
- the secret shared between this client and the remote servers.seed
- the seed value to be used to create aSecureRandom
instance.healthCheckInterval
- the health check interval.- Throws:
SocketException
- thrown if unable to create a DatagramSocket.
-
RadiusConn
public RadiusConn(Set<RADIUSServer> primaries, Set<RADIUSServer> secondaries, String secret, int timeout, byte[] seed, int healthCheckInterval) throws SocketException
Construct a connection object primary and secondary servers and seed for generating aSecureRandom
.- Parameters:
primaries
- the primary servers to connect to.secondaries
- the secondary servers to connect to.secret
- the secret shared between this client and the remote servers.timeout
- the timeout value.seed
- the seed value to be used to create aSecureRandom
instance.healthCheckInterval
- the health check interval.- Throws:
SocketException
- if a socket exception occurs.
-
-
Method Detail
-
disconnect
public void disconnect() throws IOException
Disconnects the underlying datagram socket.- Throws:
IOException
- if an io exception occurs.
-
authenticate
public Packet authenticate(String name, String password) throws IOException, NoSuchAlgorithmException, RejectException, ChallengeException
Authenticates the username and password against the remote servers.- Parameters:
name
- the username.password
- the password.- Returns:
- the response packet.
- Throws:
IOException
- if there is a problem.NoSuchAlgorithmException
- if there is a problem.RejectException
- if there is a problem.ChallengeException
- if there is a problem.
-
replyChallenge
public Packet replyChallenge(String name, String password, ChallengeException ce) throws IOException, NoSuchAlgorithmException, RejectException, ChallengeException
Sends an access-request to the server in response to a challenge request.- Parameters:
name
- the username.password
- the password.ce
- the challenge exception providing access to the original challenge response.- Returns:
- the response packet.
- Throws:
IOException
- if there is a problem.NoSuchAlgorithmException
- if there is a problem.RejectException
- if there is a problem.ChallengeException
- if there is a problem.
-
-