Course contentsShow
← Security
Lesson 764 of 3,05216. Web Security - Authentication MechanismsFree lesson

OAuth 2.0 Client Authentication

Client secrets, client authentication methods, public vs confidential clients, and dynamic client registration security.

OAuth 2.0 Client Authentication

You'll learn how OAuth 2.0 clients prove their identity to authorization servers and why different client types require different authentication strategies.

What is Client Authentication?

When an application (the OAuth 2.0 client) exchanges an authorization code for tokens, the authorization server needs to verify who is making that request. Client authentication is how the client proves its identity—like showing an ID card before collecting a package.

This prevents attackers who intercept an authorization code from using it themselves. Without client authentication, anyone with a code could trade it for access tokens.

Client Secrets

The most common authentication method uses a client secret—a long random password shared between the client and authorization server during registration. The client sends both its client_id and client_secret when requesting tokens:

POST /token
Content-Type: application/x-www-form-urlencoded

grant_type=authorization_code&
code=AUTH_CODE&
client_id=abc123&
client_secret=xyz789secret&
redirect_uri=https://app.example.com/callback

Public vs Confidential Clients

Confidential clients (backend servers) can securely store secrets—think of a locked vault. They must authenticate with client secrets.

Public clients (mobile apps, SPAs) cannot safely store secrets—users could extract them by inspecting the app. They use PKCE instead of secrets for security, since any "secret" embedded in downloadable code isn't really secret.

Dynamic Client Registration Security

Some systems let clients register themselves programmatically. Security considerations include validating redirect URIs, rate-limiting registrations, and requiring admin approval to prevent abuse.

Key Takeaway: Client authentication verifies the application's identity when exchanging codes for tokens; confidential clients use secrets, while public clients rely on PKCE because they cannot securely store credentials.