Skip to main content

RADIUS Provider

You can configure a RADIUS provider for applications that require RADIUS, such as VPN gateways and network access devices. Refer to our documentation to learn how to create a RADIUS provider, deploy an outpost, and test authentication.

info

This provider requires the deployment of a RADIUS outpost.

Only authentication requests are supported. RADIUS accounting is not supported.

Authentication flow​

Authentication requests against the RADIUS outpost use a flow in the background. You can reuse flows, stages, and policies from web-based logins when their stages are supported by the outpost.

The following stages are supported:

Authenticator validation supports Duo, TOTP, and static authenticators. SMS, email, and WebAuthn authenticators are not supported by the RADIUS outpost. Users must enroll their authenticators before using RADIUS.

Code-based MFA support​

To authenticate with a password and an MFA code, users submit the password followed by a semicolon and the code. The provider's Code-based MFA Support setting, which is enabled by default, controls how the outpost interprets the submitted PAP password. It does not add an MFA stage or require users to have an authenticator. Use an authenticator validation stage in the selected flow to enforce MFA.

When the setting is enabled:

  • Submit <password>;<code> for TOTP or a static recovery code. For example, example-password;123456 supplies example-password to the password stage and 123456 to the authenticator validation stage.
  • The outpost splits at the last semicolon, keeping earlier semicolons in the password. For example, example;password;123456 supplies example;password as the password.
  • A value with no semicolon, or one that ends in a semicolon, is passed unchanged as the password and supplies no separate code. A trailing semicolon is not stripped.
  • Splitting does not depend on whether the user has an enrolled device, and the suffix is not checked for numeric content before splitting. A password such as example;password is therefore split even for a user without MFA and can fail password validation.

When the setting is disabled, the entire value, including semicolons, is passed unchanged to the password stage. The same value is also available to the authenticator validation stage, which allows a deliberately configured code-only flow. Disabling this setting does not skip an authenticator validation stage.

Duo uses a push challenge rather than an appended code. For password-and-Duo flows, you can disable code-based support to preserve literal semicolons in passwords. Allow enough time in the RADIUS client's timeout for the user to approve the push.

Client networks and provider selection​

The provider's Client Networks setting accepts comma-separated IPv4 or IPv6 CIDRs, such as 192.0.2.0/24, 2001:db8:1234::/64. Use /32 for one IPv4 address and /128 for one IPv6 address. The default, 0.0.0.0/0, ::/0, allows clients from every IPv4 and IPv6 network to reach authentication; it does not grant application access.

The outpost matches the source IP of the incoming UDP packet. This is normally the VPN gateway, access point, or other RADIUS client, not the end user's workstation. The NAS-IP-Address and Calling-Station-Id attributes do not select the provider. If a NAT gateway, RADIUS proxy, container network, or Kubernetes service rewrites the source address, configure the address that the outpost actually sees. Clients sharing a translated source address cannot be distinguished by this setting.

The Admin interface describes longest-prefix selection across the providers assigned to the outpost: a more specific network, such as 192.0.2.128/25, should take precedence over 192.0.2.0/24. The selected network supplies the shared secret used to process the packet, and the outpost then locates the provider by that secret. This is why providers on the same outpost need distinct secrets.

Overlapping networks

The current outpost implementation does not reliably apply the advertised longest-prefix rule. It compares address widths instead of prefix lengths, so overlapping networks of the same address family can select either provider. Use non-overlapping client networks and distinct shared secrets. Do not depend on provider order, identical CIDRs, or a catch-all provider as a fallback for a more specific provider.

When no configured network matches, the outpost logs No matching prefixes found and drops the packet without a RADIUS response. The client normally reports a timeout, not Access-Reject. Check every provider on the outpost for a remaining catch-all network when testing this behavior.

Example with two networks​

Suppose one outpost serves office VPN gateways and lab network devices. Configure two application/provider pairs:

  • Office RADIUS, with provider Office RADIUS provider, Client Networks set to 192.0.2.0/24, and a dedicated office shared secret.
  • Lab RADIUS, with provider Lab RADIUS provider, Client Networks set to 198.51.100.0/24, and a different lab shared secret.

Assign both applications to the same RADIUS outpost. They can use the same authentication flow or separate flows and application access policies.

A request arriving from 192.0.2.10 uses the office provider and secret. A request from 198.51.100.20 uses the lab provider and secret. A request from 203.0.113.10 is dropped if no other provider on the outpost allows it. These are the client addresses as seen by the outpost, not the address of the outpost itself. Replace the example networks with your actual client networks.

Protocol support​

The RADIUS provider supports PAP (Password Authentication Protocol) for password-based authentication. authentik Enterprise adds support for EAP-TLS for certificate-based authentication. CHAP, MS-CHAP, and MS-CHAPv2 password authentication are not supported.

The matrix below shows which password hashes are compatible with each RADIUS authentication protocol. Hash compatibility alone does not mean that the RADIUS provider supports a protocol.

RADIUS password-hash compatibility matrix
CleartextNTMD5Salted MD5SHA1Salted SHA1Unix Crypt
PAP✓✓✓✓✓✓✓
CHAP✓✗✗✗✗✗✗
Digest✓✗✗✗✗✗✗
MS-CHAP✓✓✗✗✗✗✗
PEAP✓✓✗✗✗✗✗
MS-CHAPv2✓✓✗✗✗✗✗
Cisco LEAP✓✓✗✗✗✗✗
EAP-GTC✓✓✓✓✓✓✓
EAP-MD5✓✗✗✗✗✗✗
EAP-PWD✓✗✗✗✗✓✓

EAP-TLS Enterprise​

EAP-TLS uses certificates to authenticate the server and client. Before configuring the provider, obtain a server certificate and private key, a certificate authority (CA) certificate for validating clients, and client certificates and private keys for the end-user devices. Certificate issuance and deployment are outside the scope of this document.

  1. Create an authentication flow with a mutual TLS stage as its first stage.
    • Set Mode to Certificate required.
    • Under Certificate authorities, select the CA certificates that should be trusted to issue client certificates.
    • Configure Certificate attribute and User attribute so that the certificate identifies an existing authentik user.
  2. Add a user login stage after the mutual TLS stage to complete authentication.
  3. In the RADIUS provider, set Authentication Flow to this flow and select the server certificate under Protocol settings > Certificate. The certificate's private key must be available to the outpost. Only certificates with a key algorithm supported for RADIUS can be selected. An ML-DSA certificate requires clients that support EAP-TLS with TLS 1.3.
  4. Configure the end-user devices to use their client certificates and validate the RADIUS server certificate, including the expected server name and trusted issuing CA.
Limit trust for client certificates

Use a private CA and control which client certificates it issues. The mutual TLS stage validates the certificate against its configured CAs and matches a certificate attribute to an existing user. Trusting a CA alone does not authorize every certificate holder. Ensure that certificate holders cannot obtain certificates identifying other users, and use application bindings or additional policies to restrict access as needed.

The CAs trusted by the mutual TLS stage for client authentication are separate from the CA that end-user devices trust for the RADIUS server certificate.

RADIUS property mappings​

RADIUS provider property mappings add attributes to successful authentication responses. A single mapping can assign multiple attributes. Follow the instructions to create a custom provider property mapping and select the RADIUS provider property mapping type. Then select the mapping under Protocol settings > Property mappings on the RADIUS provider.

Mapping context​

Mappings run after authentication and application authorization succeed. They supply attributes for the Access-Accept response and cannot customize an Access-Reject, including its Reply-Message.

The mapping receives:

  • user: the authenticated user, whose attributes and group memberships you can access.
  • packet: a mutable packet used to build additional response attributes. It is not the incoming Access-Request or the final Access-Accept; the outpost copies its attributes into the successful response.

Incoming RADIUS attributes are not forwarded into the mapping context. The HTTP request available to the expression is the outpost's access-check request to authentik, not the incoming RADIUS packet.

Mappings run in name order and share the same packet. Each mapping can add attributes in either of the following ways:

  • Return a dictionary of attribute names and values. authentik adds the returned entries to packet after the mapping finishes.
  • Assign values to packet directly. A mapping that modifies packet in place does not need to return a value.

Returning a dictionary, the vendor_attribute() helper, and the return value of define_attribute() require authentik: 2026.11.0+. On earlier versions, assign values to packet directly, using the attribute's lookup name.

How authentik handles a failure depends on where it occurs:

  • If the mapping's expression raises an error, including when it assigns an undefined attribute or an invalid value to packet, authentik logs a configuration-error event and continues with the next mapping.
  • If a returned dictionary contains an undefined attribute name or a value that does not match the attribute's type, the access check fails and the request is rejected. No configuration-error event is created.

See Troubleshoot a failed mapping.

Standard attributes​

Use the attribute's exact name from authentik's bundled RADIUS dictionary.

The following example returns three standard attributes from a single mapping: an integer Session-Timeout, a string Reply-Message, and an octets value for Class. All three are already defined in the bundled dictionary, so no attribute registration is needed.

return {
"Session-Timeout": 3600,
"Reply-Message": "Network access granted",
"Class": b"authentik-radius",
}

You can instead assign these values to packet directly and omit the return statement. The Reply-Message is added only to a successful response; it does not configure a rejection message. The Class value is a fixed example marker, not a unique session identifier.

After assigning the mapping to the provider, authenticate and inspect the decoded Access-Accept. Confirm that all three values appear as standard attribute codes 27 (Session-Timeout), 18 (Reply-Message), and 25 (Class), not as vendor-specific attributes. The Class bytes should represent the literal text authentik-radius.

An attribute listed in a vendor dictionary is not necessarily included in authentik's bundled dictionary. Its Python value must also match the attribute's dictionary type.

Vendor-specific attributes​

For a vendor-specific attribute already defined in a bundled dictionary, return its existing name and value. For example, the bundled Cisco dictionary defines vendor code 9, attribute code 1, under the name AVPair:

return {"AVPair": "shell:priv-lvl=15"}

To register a new lookup name for a vendor-specific attribute, use vendor_attribute() as the key in the returned dictionary. The helper registers and returns the lookup name. The following example registers Cisco-AV-Pair and assigns a privilege level:

return {
vendor_attribute(
vendor_code=9,
vendor_name="Cisco",
attribute_name="AV-Pair",
attribute_code=1,
attribute_type="string",
): "shell:priv-lvl=15"
}
ArgumentDescription
vendor_codeThe vendor's IANA Private Enterprise Number
vendor_nameThe vendor name used to qualify the attribute in the mapping
attribute_nameThe attribute name to register
attribute_codeThe attribute number from the vendor's RADIUS dictionary
attribute_typeThe dictionary value type, such as string or integer

Use codes and types from authoritative vendor documentation. The registered lookup name is <vendor_name>-<attribute_name>. Mappings share these definitions during the current access check, but the definitions do not permanently change the bundled dictionary. If that lookup name already exists, the helper leaves its definition unchanged.

To modify packet directly, call define_attribute() before assigning the attribute's value. define_attribute() accepts the same arguments as vendor_attribute() and also returns the registered lookup name:

attribute = define_attribute(
vendor_code=9,
vendor_name="Cisco",
attribute_name="AV-Pair",
attribute_code=1,
attribute_type="string",
)
packet[attribute] = "shell:priv-lvl=15"

You can register multiple attributes in one mapping. Each definition and value must be valid. See Troubleshoot a failed mapping for how authentik handles a mapping that fails.

Do not assign a vendor name to a standard RFC attribute. A nonempty vendor_name produces a vendor-specific attribute, even if vendor_code is 0.

Attribute value types​

Common dictionary types accept the following values. authentik uses the RADIUS library pyrad to encode them.

Dictionary typeExample Python valueNotes
string"example"Strings are UTF-8 encoded.
integer3600Use an unsigned 32-bit integer, or a symbolic value defined for the attribute in the dictionary.
ipaddr"192.0.2.10"Use an IPv4 address string for an IPv4 attribute.
octetsb"session-id"Use bytes for an opaque value; see the encoding caveat below.

For octets, pyrad treats strings containing only decimal digits as integers to encode, rather than literal text. For example, "65" becomes b"A", while b"65" preserves the two ASCII digits. Strings beginning with 0x are interpreted as hexadecimal and must contain valid hexadecimal digits. Bytes beginning with b"0x" are interpreted as hexadecimal only when the remainder is valid hexadecimal; otherwise, they are used unchanged. Inspect the decoded response when the exact byte representation matters.

Dynamic VLAN assignment​

The bundled dictionaries do not define Tunnel-Type, Tunnel-Medium-Type, or Tunnel-Private-Group-Id, so you cannot assign these attributes by name as in the standard-attribute example above. Their absence from the dictionaries does not tell you whether the underlying encoder can represent them.

Dynamic VLAN configuration also requires the correct attribute types and tunnel-tag encoding. Do not substitute similarly named vendor-specific attributes for standard tunnel attributes unless the client explicitly expects them. See #16879 for related discussion.

Troubleshoot a failed mapping​

Do not use mapping errors to deny access

An error raised while a mapping's expression runs creates a configuration-error event, but authentik continues to process the remaining mappings. The error does not discard attributes added by earlier successful mappings or change a successful authorization result.

An undefined attribute name or an invalid value in a returned dictionary instead causes the access check to fail, and the request is rejected without a configuration-error event.

Do not rely on either behavior to deny access; use application bindings or authentication policies for access control.

If requests are rejected after you assign a mapping that returns a dictionary:

  1. Check each attribute name in the returned dictionary against the bundled dictionary or the name returned by vendor_attribute().
  2. Confirm that each value matches the attribute's dictionary type.
  3. Check the authentik server logs for an error during the access check, and the outpost logs for a failed access check.
  4. Remove the mapping from the provider to confirm that authentication succeeds without it.

If the expected attributes are missing:

  1. Confirm that authentication and application authorization succeeded.
  2. Confirm that the mapping is selected on the provider.
  3. Check the attribute name and capitalization against the bundled dictionary or the name returned by vendor_attribute() or define_attribute().
  4. Confirm that each value matches the attribute's dictionary type.
  5. In the Admin interface, check Events > Logs for a configuration-error event. Also check the server and outpost logs for packet serialization or decoding failures.
  6. Inspect the decoded Access-Accept to verify the attribute codes, vendor codes, values, and any required tags.

For an end-to-end check, follow Configuration verification.