How do you prevent hackers from taking a "publicly used API key" and using it in their own script?

At first, for MVP, I want to basically allow API requests to only come from my domains, or from a server-side script I control.
For the server-side script, I can simply use a "secret API token" sent in the Authorization Bearer he… Continue reading How do you prevent hackers from taking a "publicly used API key" and using it in their own script?

How should the grant type of an oauth2 access token be preserved after refreshing it using refresh grant?

Let’s say I got an access token of the "authorization code" grant type. After the expiration of it, I would refresh it using the refresh grant. Then I’ll get a new token. Is the grant type of the new token still the same as the &… Continue reading How should the grant type of an oauth2 access token be preserved after refreshing it using refresh grant?

can we use access token as session cookie in browser? and how to protect it?

The scenario is: you have refresh token that is valid for a longer period of time and an access token that is valid for a shorter period of time.
The setup: There is a client, application server and authentication server.
The client stores… Continue reading can we use access token as session cookie in browser? and how to protect it?