liveBook · Manning

Client registration

As explained in Spring Security in Action, Second Edition

A client registration is the configured association of an OAuth client with its provider, credentials, redirect URI, and requested scopes.

A client registration associates an OAuth client with its provider, credentials, authentication method, redirect URI, and requested scopes. In a Spring application, these details let the client call a custom authorization server and receive the authenticated user after login. section 16.1.3

A custom provider registration typically specifies:

  • A provider name, client ID, and client secret. section 16.1.3
  • A client authentication method, commonly HTTP Basic through client_secret_basic. section 16.1.3
  • A redirect URI matching one registered by the authorization server. section 16.1.3
  • Requested scopes that are also registered on the authorization server. section 16.1.3

For simple deployments, Spring Boot properties can configure the registration. More flexible deployments create a ClientRegistration and provide it through a ClientRegistrationRepository, allowing credentials or enabled providers to come from custom logic, a database, or a vault. section 16.1.4

Custom authorization server

Run the authorization server at 127.0.0.1 and the web application at localhost to keep browser sessions distinct. Configure the issuer at http://127.0.0.1:7070 and use the callback /login/oauth2/code/my_authorization_server. section 16.1.3

 http://localhost:8080/login/oauth2/code/my_authorization_server

Inspect the standard OAuth login callback URI used by the custom provider. section 16.1.3

How Spring Security in Action, Second Edition covers it

How deep it goes
Defines required properties and extends configuration through ClientRegistrationRepository, stopping short of repository implementation details.
Examples
Uses a custom authorization server, localhost and 127.0.0.1 addresses, a standard callback URI, and an in-memory registration repository.
What it assumes
Assumes basic Spring and Java configuration while teaching provider details, callback matching, scopes, and registration retrieval.
What you can do after
Configure it via Spring Boot properties or customize retrieval with a ClientRegistrationRepository implementation.
How it connects
Connects OAuth 2 client login with authorization servers, client credentials, redirect URIs, scopes, and provider discovery.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Spring Security in Action, Second Edition. The section links point to the parts of the book it draws on.