VG08
VG08

Reputation: 11

Only let one app have access to api endpoint?

I am gonna have an open source app in which it needs to send some data to an fastapi python api, how can i make it so that only the app can make requests to the api and not some random person abusing the api endpoint?

Upvotes: 1

Views: 971

Answers (1)

Ashraful
Ashraful

Reputation: 1974

There are so many ways to do that. Even some of the techniques doesn't bother the API endpoint.

  1. IP Restriction: You can restrict an IP from cloud provider which IP can call the API. Even you can have multiple IPs.
  2. API KEY: You can provide an API KEY to the API client. When the request come along with the provided key then you work on it otherwise ignore.

The IP method is much better than doing on the application end.

Upvotes: 1

Related Questions