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

14,256

Solution 1

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.

Solution 2

This discussion provides an excellent explanation of why the client secret is much more important for server-side apps than client-side apps. An excerpt:

Web apps [server-side apps] use client secrets because they represent huge attack vectors. Let us say that someone poisons a DNS entry and sets up a rogue app "lookalike", the juxtapose might not be noticed for months, with this intermediary sucking up tons of data. Client secrets are supposed to mitigate this attack vector. For single user clients, compromise has to come one device at a time, which is horribly inefficient in comparison.

Share:
14,256
Robin
Author by

Robin

Rails developer at Devpost. http://devpost.com/niuage I love design as much as I love code.

Updated on August 02, 2022

Comments

  • Robin
    Robin almost 2 years

    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?