Class AccessRequestPap
java.lang.Object
org.tinyradius.core.packet.BaseRadiusPacket<RadiusRequest>
org.tinyradius.core.packet.request.GenericRequest
org.tinyradius.core.packet.request.AccessRequest<AccessRequestPap>
org.tinyradius.core.packet.request.AccessRequestPap
- All Implemented Interfaces:
AttributeHolder<RadiusRequest>
,NestedAttributeHolder<RadiusRequest>
,RadiusPacket<RadiusRequest>
,RadiusRequest
,MessageAuthSupport<RadiusRequest>
public class AccessRequestPap extends AccessRequest<AccessRequestPap>
PAP AccessRequest RFC2865
-
Nested Class Summary
Nested classes/interfaces inherited from class org.tinyradius.core.packet.request.AccessRequest
AccessRequest.AccessRequestFactory<U extends AccessRequest<?>>
-
Field Summary
Fields inherited from class org.tinyradius.core.packet.request.AccessRequest
ARAP_PASSWORD, CHAP_PASSWORD, EAP_MESSAGE, logger, RANDOM, USER_PASSWORD
Fields inherited from interface org.tinyradius.core.packet.util.MessageAuthSupport
MESSAGE_AUTHENTICATOR, msgAuthLogger
Fields inherited from interface org.tinyradius.core.packet.RadiusPacket
HEADER_LENGTH, MAX_PACKET_LENGTH, packetLogger
-
Constructor Summary
Constructors Constructor Description AccessRequestPap(Dictionary dictionary, byte identifier, byte[] authenticator, java.util.List<RadiusAttribute> attributes)
-
Method Summary
Modifier and Type Method Description RadiusRequest
decodeRequest(java.lang.String sharedSecret)
Decodes the request against the supplied shared secret.RadiusRequest
encodeRequest(java.lang.String sharedSecret)
AccessRequest overrides this method to generate a randomized authenticator (RFC 2865) and encode required attributes (e.g.protected AccessRequest.AccessRequestFactory<AccessRequestPap>
factory()
java.util.Optional<java.lang.String>
getPassword()
Retrieves the plain-text user password.AccessRequestPap
withPassword(java.lang.String password)
Methods inherited from class org.tinyradius.core.packet.request.AccessRequest
genAuth, random16bytes, withAttributes
Methods inherited from class org.tinyradius.core.packet.BaseRadiusPacket
decodeAttributes, encodeAttributes, equals, getAttributes, getAuthenticator, getChildVendorId, getDictionary, getId, getType, hashCode, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.tinyradius.core.attribute.AttributeHolder
addAttribute, addAttribute, filterAttributes, filterAttributes, filterAttributes, getAttribute, getAttribute, getAttributeBytes, getChildVendorId, removeAttributes, removeLastAttribute
Methods inherited from interface org.tinyradius.core.packet.util.MessageAuthSupport
computeMessageAuth, encodeMessageAuth, verifyMessageAuth
Methods inherited from interface org.tinyradius.core.attribute.NestedAttributeHolder
addAttribute, filterAttributes, filterAttributes, getAttribute, getFlattenedAttributes, getVendorAttributes, removeAttribute, removeAttributes
Methods inherited from interface org.tinyradius.core.packet.RadiusPacket
genHashedAuth, getAttributes, getAuthenticator, getDictionary, getId, getType, toDatagram, toDatagram, verifyPacketAuth
-
Constructor Details
-
AccessRequestPap
public AccessRequestPap(Dictionary dictionary, byte identifier, byte[] authenticator, java.util.List<RadiusAttribute> attributes)
-
-
Method Details
-
factory
- Specified by:
factory
in classAccessRequest<AccessRequestPap>
-
withPassword
-
getPassword
public java.util.Optional<java.lang.String> getPassword()Retrieves the plain-text user password.- Returns:
- user password in plaintext if decoded
-
encodeRequest
Description copied from class:AccessRequest
AccessRequest overrides this method to generate a randomized authenticator (RFC 2865) and encode required attributes (e.g. User-Password).- Specified by:
encodeRequest
in interfaceRadiusRequest
- Overrides:
encodeRequest
in classAccessRequest<AccessRequestPap>
- Parameters:
sharedSecret
- shared secret that secures the communication with the other Radius server/client- Returns:
- RadiusPacket with new authenticator and encoded attributes
- Throws:
RadiusPacketException
- if invalid or missing attributes
-
decodeRequest
Description copied from interface:RadiusRequest
Decodes the request against the supplied shared secret.Must be idempotent.
- Specified by:
decodeRequest
in interfaceRadiusRequest
- Overrides:
decodeRequest
in classAccessRequest<AccessRequestPap>
- Parameters:
sharedSecret
- shared secret- Returns:
- verified RadiusRequest with decoded attributes if appropriate
- Throws:
RadiusPacketException
- if authenticator check fails
-