Lesson 2 of 2 Federation and Authentication Systems

Authentication Systems and Protocols

Organisations implement authentication through a small set of systems and protocols. This lesson covers Kerberos and directories, RADIUS, TACACS+ and Diameter, and SAML, OAuth and OpenID Connect.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe how Kerberos authenticates users.
  • Compare RADIUS, TACACS+ and Diameter.
  • Distinguish SAML, OAuth and OpenID Connect.

Kerberos and directories

Kerberos provides ticket-based single sign-on within an enterprise. A trusted key distribution centre (KDC) contains the authentication service (AS) and the ticket-granting service (TGS).

  1. Authenticate

    The client proves its identity to the AS and receives a ticket-granting ticket (TGT).

  2. Request service

    The client presents the TGT to the TGS and requests access to a service.

  3. Receive ticket

    The TGS issues a service ticket encrypted with the service's key.

  4. Access

    The client presents the service ticket to the service, which grants access.

Passwords are not sent across the network, and tickets have limited lifetimes. Kerberos requires synchronised clocks, and the KDC is a single point of failure and a prime target. Directory services such as Active Directory and LDAP directories store identities, groups and policies; LDAP queries and binds should be protected with LDAPS or StartTLS.

Kerberos avoids sending passwords by relying on shared symmetric keys. The KDC knows a key derived from each user's password and a key for each service. When the user logs on, the authentication service sends back data encrypted with the user's key; only someone who knows the password can decrypt it and obtain a session key for talking to the ticket-granting service. Service tickets are encrypted with the service's key, so the service can verify a ticket without contacting the KDC. Each ticket includes a timestamp and lifetime, and the client adds an authenticator containing the current time, which is why clocks must be synchronised, usually within five minutes: the timestamps stop an attacker from replaying a captured ticket later.

Kerberos is therefore strong against eavesdropping and replay, but its security rests on the KDC and on the strength of the keys. Weak service account passwords make service tickets crackable, and theft of the KRBTGT key allows forged tickets, as the lesson on Kerberos attacks explains.

Put in order

The Kerberos exchange

Exam skills 5.6.1

Arrange the steps of Kerberos authentication.

Log in to try this activity Interactive activities are free with an account.

AAA protocols for network access

AAA protocols centralise authentication for network access and device administration. Without them, every VPN concentrator, wireless controller and router would hold its own list of users, and removing a leaver would mean editing each device. With them, the device acts as a client that forwards the user's credentials to a central AAA server, which checks them against the directory and returns a decision, often with attributes such as the VLAN to assign or the privilege level to grant.

The protocols differ in ways that matter for security. RADIUS encrypts only the password field, so other attributes, such as the user name and the authorisation details, travel in cleartext unless the connection is protected by other means, and it combines authentication and authorisation in a single response. TACACS+, developed by Cisco, encrypts the whole body of each message and handles authentication, authorisation and accounting as separate exchanges, so a device can ask whether a specific command is allowed each time an administrator types one. Diameter is the more extensible successor to RADIUS, used mainly in mobile networks for subscriber authentication. The following comparison summarises them.

RADIUS
TransportUDP
EncryptionPassword only
AAA functionsAuthentication and authorisation combined
Typical useVPN, Wi-Fi 802.1X, network access
TACACS+
TransportTCP
EncryptionEntire payload
AAA functionsAuthentication, authorisation and accounting separated
Typical useRouter and switch administration, per-command authorisation
Diameter
TransportTCP or SCTP
EncryptionWith TLS or IPsec
AAA functionsSeparate, extensible
Typical useMobile and telecom networks
Scenario questions

RADIUS, TACACS+ or Diameter?

Exam skills 5.6.2

Choose the AAA protocol that fits each requirement.

Log in to try this activity Interactive activities are free with an account.

SAML, OAuth and OpenID Connect

SAML 2.0 exchanges XML assertions between an identity provider and a service provider and is widely used for enterprise single sign-on to web applications. OAuth 2.0 is an authorisation framework: a user lets a client application access their resources on a resource server with an access token issued by an authorisation server, without sharing their password. It does not itself say who the user is.

OpenID Connect (OIDC) adds authentication on top of OAuth 2.0, returning an ID token, a signed JSON Web Token (JWT) that identifies the user. Secure use requires validating token signatures, issuers, audiences and expiry, using the authorisation code flow with PKCE for public clients, registering exact redirect URIs and keeping tokens short-lived.

The common mistake is using an OAuth access token as proof of identity. An access token says that its holder may call an API, not who the holder is, and a token issued to one application might be presented to another. OpenID Connect's ID token is addressed to a specific application (its audience), which that application must check. The following table summarises the three protocols.

ProtocolPurposeToken formatTypical use
SAML 2.0Authentication and attributesXML assertionEnterprise web SSO
OAuth 2.0Delegated authorisationAccess token (often JWT)Apps accessing APIs on a user's behalf
OpenID ConnectAuthentication on OAuthID token (JWT)Consumer and modern web and mobile sign-in

The following diagram shows the OAuth flow and where OpenID Connect fits.

OAuth delegated authorisation and where OpenID Connect fits. The client application redirects the user to the authorisation server; the user signs in there and approves a limited scope, and the client receives an access token for that scope, never the password, which it presents to the resource API. To learn who the user is, the client also needs OpenID Connect, which adds an ID token.
OAuth alone does not authenticate the user.
Match the pairs

Web identity protocols

Exam skills 5.6.3

Match each protocol or token with its purpose.

Log in to try this activity Interactive activities are free with an account.
Worked example

OAuth or OpenID Connect

A user wants a photo printing service to fetch pictures from their cloud photo library, and the printing service also wants to create an account for the user. Which protocol meets each need?

With OAuth, the printing service redirects the user to the photo provider's authorisation server, the user signs in there and approves the request for read-only access to photos, and the printing service receives an access token limited to that scope. The printing service never learns the user's password, and the user can revoke the token later.

If the printing service also wants to know who the user is, so that it can create an account for them, it uses OpenID Connect and receives an ID token stating the user's identity.

Worked example

Choosing an AAA protocol

A network team wants to authenticate administrators of routers and switches centrally, record every command they run and allow some administrators only a subset of commands. Which protocol fits BEST?

TACACS+ separates authentication, authorisation and accounting, supports per-command authorisation and command accounting, and encrypts the whole payload, which makes it the standard choice for device administration. RADIUS combines authentication and authorisation and is better suited to network access such as VPN and Wi-Fi.

Check yourself

Which part of the payload does RADIUS encrypt?

Show answer

Only the password. TACACS+ encrypts the entire payload.

Exam Tips

Remember for the exam

  • Kerberos needs time synchronisation and a protected KDC.
  • TACACS+ for device administration; RADIUS for network access.
  • OAuth authorises; OpenID Connect authenticates.
  • SAML uses XML assertions; OIDC uses JWT ID tokens.