What happens in phase 3 of Kerberos, and how do client and service authenticate each other?
The client sends the AP-REQ with the service ticket and an authenticator encrypted with the service session key; the service decrypts the ticket with its own key, checks the authenticator, and answers with its own authenticator (service ID + timestamp) under the same session key, which proves to the client that it reached the real service.
* Phase 3: the service proves itself by using a session key only the real service could have unpacked. *
- The client creates another authenticator (user ID + timestamp), encrypted with the service session key.
- It sends the AP-REQ (Application Request): authenticator plus service ticket.
- The service decrypts the service ticket with its service secret key and stores it in its credential cache.
- It decrypts the authenticator with the service session key taken from the ticket.
- It verifies: user ID in authenticator equals user ID in ticket, ticket still valid, timestamp fresh.
- It builds its own service authenticator (service ID + timestamp), encrypted with the service session key (AP-REP).
- The client decrypts it. Only the real service could have extracted the service session key from the ticket, so the client now knows it is talking to the right server.
If mutual authentication succeeded, the client uses the service, and both sides can protect their further traffic with the shared session key. Mutual authentication defeats a fake server that tries to collect requests.
Go deeper:
RFC 4120, Section 3.2: The Client/Server Authentication exchange โ AP-REQ, AP-REP and the mutual-authentication option.