In Authentication Standards like OAuth 2.0, we use client id and secret for authenticating machines. When we authenticate a client in a system, we find that for example, it is application X on the android or application Y web version.
But why we have a key named "secret"? it isn't a secret key at all on all clients except servers. You can extract it easily from a web application code or mobile application traffic (even if it is on https).
Am I wrong or is this mean another thing than a secret key that only the owner or that key knows (like user password)?
The idea is that you don't expose the secret key anywhere in public. Usually, the secret is only used between your servers and OAuth tenant and never shown in the browser: https://auth0.com/docs/flows/concepts/auth-code. The security achieved by enforcing https and verifying URL code. Some services also have a signature for payload.
There are OAuth implementations of client-side flow (with no server involved) but they usually don't have secret keys (you're right those can be stolen) and nothing coming from the client in that flow should be trusted. For example, Firestore (from Firebase) has security rules enforced on the backend to enable client-side only auth.
If you have a specific flow you want to discuss, please post it here and we can go into more detail.
Thanks for the description, but I'm a bit confused.
The main question is:
Imagine you generated a client id and secret to access an API from a web client.
Then I steal them and make requests instead of your web application.
Even if you store your id and secret server-side, you have to make a secure request to your server and it's not possible because your web app's request is public from every browser.
So is my client id and secret for myself yet?
I believe the client_secret is for authorisation (i.e. is this app allowed to make this kind of request). Stealing the client_secret would still require hacker to authenticate (to make request on behalf of a specific user). But yes it seems weak.
https://salesforce.stackexchange.com/questions/14009/whats-the-benefit-of-the-client-secret-in-oauth2
I know that client credentials are for authorizing a client, not a user and there are no real security problems with stealing them. I'm talking about evaluating real data about one client's requests!
Ah OK. Get you now. Seems you are right and the recommendation today is to not use OAuth client secret in client apps because of the problem you describe.
Have you seen these:
Section 6 of #2 suggests exhausting these options first:
Thanks for the links. I know about PKCE (Pixie)
But I'll read 2 next links later!
Let's go over a typical oAuth back-end flow, the one you'll probably use 80% of the time:
Let me know if this makes sense,
Sergey
Thanks for the time you invest in this question. I'm not talking about stealing data by an attacker. I told you that I can use your client credentials to request instead of your app and maybe invalidate the analytics collected by watching the client. (I know it is a rare concern :D)
I'm either not getting your question or you're confusing who is generating app_id and app_secret. That pair is generating by an Application and not by a User. So, app_secret is private to an application that makes requests to oAuth application on behalf of the user without sharing any private information of a user (e.g. password)