简体   繁体   中英

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM