authenticationsecurityoauth-2.0oauth

What's the purpose of the client secret in OAuth2?


I have an app that offers an API. This app is an OAuth2 provider.

I want to access this API (read & write) with a client-side only app. I'm using JSO to make this easier.

It works great.

The thing is, I don't have to enter my client secret (of the application I registered in my app) anywhere. And I understand why, it would then be available to anyone.

So, if I can access my api without the client secret, could you explain to me what is its purpose?


Solution

  • Client Secret was used in OAuth 1.0 to sign the request, so it was required. Some OAuth2 servers (such as Google Web Server API) required the client secret to be sent to receive the access token (either from request token or refresh token).

    OAuth 2.0 has reduced the role of the client secret significantly, but it is still passed along for the servers that use it.