Interface RadiusRequest

All Superinterfaces:
AttributeHolder<RadiusRequest>, NestedAttributeHolder<RadiusRequest>, RadiusPacket<RadiusRequest>
All Known Implementing Classes:
AccessRequest, AccessRequestArap, AccessRequestChap, AccessRequestEap, AccessRequestNoAuth, AccessRequestPap, AccountingRequest, GenericRequest

public interface RadiusRequest
extends RadiusPacket<RadiusRequest>
  • Method Details

    • create

      static RadiusRequest create​(Dictionary dictionary, byte type, byte identifier, byte[] authenticator, java.util.List<RadiusAttribute> attributes)
      Creates a RadiusPacket object. Depending on the passed type, an appropriate packet is created. Also sets the type, and the the packet identifier.
      Parameters:
      dictionary - custom dictionary to use
      type - packet type
      identifier - packet identifier
      authenticator - authenticator for packet, nullable
      attributes - list of attributes for packet
      Returns:
      RadiusPacket object
    • fromDatagram

      static RadiusRequest fromDatagram​(Dictionary dictionary, io.netty.channel.socket.DatagramPacket datagram) throws RadiusPacketException
      Reads a request from the given input stream and creates an appropriate RadiusPacket/subclass.

      Decodes the encrypted fields and attributes of the packet, and checks authenticator if appropriate.

      Parameters:
      dictionary - dictionary to use for attributes
      datagram - DatagramPacket to read packet from
      Returns:
      new RadiusPacket object
      Throws:
      RadiusPacketException - malformed packet
    • encodeRequest

      RadiusRequest encodeRequest​(java.lang.String sharedSecret) throws RadiusPacketException
      Encode request and generate authenticator.

      Must be idempotent.

      Parameters:
      sharedSecret - shared secret that secures the communication with the other Radius server/client
      Returns:
      RadiusRequest with new authenticator and/or encoded attributes
      Throws:
      RadiusPacketException - if invalid or missing attributes
    • decodeRequest

      RadiusRequest decodeRequest​(java.lang.String sharedSecret) throws RadiusPacketException
      Decodes the request against the supplied shared secret.

      Must be idempotent.

      Parameters:
      sharedSecret - shared secret
      Returns:
      verified RadiusRequest with decoded attributes if appropriate
      Throws:
      RadiusPacketException - if authenticator check fails