I'm reading about refresh tokens: https://auth0.com/learn/refresh-tokens/. I'm building an Authentication Server (AS) myself.
To get a refresh token from a email/password authentication, the client app sends 4 pieces of information:
- client id
- client password
- user email
- user password
My question is: how does the AS pass the client id and password to the client app?
My first idea: is the password generated randomly beforehand and hard-coded in every client app? Why is the client id needed then?
My 2nd idea: the client app on first startup hits the AS to gets its client id/password, and uses this pair to get all future refresh tokens. But it isn't secure, as any hacker can hit this same endpoint.
Help appreciated.