Search code examples
spring-bootspring-authorization-serverspring-resource-server

What value is usually provided to client_id field in RegisteredClient objects?


What value is usually provided to client_id field in RegisteredClient objects in production? The first thought that comes to my mind is to just use unique integers for each client. But is it really a legitimate approach?..


Solution

  • The client_id is essentially a unique and a public identifier for OAuth Apps. Even though it's a public identifier, it's best that it shouldn't be guessable by any 3rd parties. Different vendors use different conventions to generate client_ids and the most common practise is to have a 32 character alpha-numeric string. You can read about different conventions here. In most cases, a UUID would be enough for a client_id given that you do not have any special requirements.