Cyber Trainer Passwords & Auth
Passwords & Auth · Chapter 07

Single sign-on & federation

Signing in once and reaching dozens of apps is convenient, and it lets organisations put all their authentication effort (MFA, passkeys, monitoring) in one place. Here's how the main protocols pass your identity around.

The key ideas

Single sign-on (SSO)

Authenticate once and get access to many applications without signing in again.

Federation

Separate organisations or services agree to trust one another's identities, e.g. "Sign in with Google" or a supplier signing in with their own company account.

Identity provider (IdP)

The system that authenticates you and vouches for you: Microsoft Entra ID, Okta, Google, Active Directory.

Service provider / relying party

The application that trusts the IdP's assertion instead of checking your password itself.

One key to every doorSSO concentrates risk: compromise the IdP account and the attacker reaches every connected app. That's why SSO accounts deserve the strongest MFA you have, plus monitoring for unusual sign-ins.
ProtocolTypical useToken format
KerberosWindows domains and Active Directory, on the internal network.Encrypted tickets
SAML 2.0Enterprise SSO to web apps (Salesforce, ServiceNow, HR systems).Signed XML assertions
OAuth 2.0Authorisation: letting one app access another on your behalf ("allow this app to read your calendar").Access tokens (often JWTs)
OpenID Connect (OIDC)Authentication built on OAuth 2.0: "Sign in with Google/Microsoft/Apple", modern SSO and mobile apps.ID token (always a JWT)

Kerberos

Named after the three-headed dog of Greek myth, Kerberos involves three parties: you, the Key Distribution Centre (KDC, which in Windows is every domain controller) and the service you want. Your password never crosses the network; instead you collect tickets.

Signing in to a Windows domain and opening a file share
Attacks you'll hear aboutKerberoasting requests service tickets for accounts with weak passwords and cracks them offline. A golden ticket forges TGTs using a stolen krbtgt key. Pass-the-ticket reuses stolen tickets. Strong service-account passwords (or managed service accounts) and protecting domain controllers are the defences.

SAML 2.0

SAML uses your browser to carry a digitally signed XML assertion from the IdP to the application. The app and IdP never talk directly; they trust each other because of certificates exchanged in advance.

SP-initiated SAML sign-in

OAuth 2.0 and OpenID Connect

OAuth 2.0 answers "may this app access that resource?". OpenID Connect adds "and who is the user?" by issuing an ID token. Modern apps use the authorisation code flow with PKCE, which proves the app that started the sign-in is the one finishing it.

"Sign in with Microsoft": authorisation code + PKCE
Consent phishingAttackers register a malicious app and send a link asking you to "grant access to your mail and files". No password is stolen; you hand over an OAuth token. Read consent screens carefully, and admins should restrict which apps users can approve. The toolkit's "consent app" phishing scenario shows this attack.

Inside a token: JSON Web Tokens

A JWT is three Base64url-encoded parts separated by dots: a header, a payload of "claims", and a signature. Anyone can read a JWT. It's signed, not encrypted, so the signature is what stops it being changed.

Decode and tamper with a token

Header

Payload (edit me)

This demo token is signed with HMAC-SHA256 and the secret cybertrainer-demo. Real identity providers sign with RS256 or ES256 private keys and publish the public keys for apps to verify with. Try changing "role": "user" to "admin".

Knowledge check