- the service takes input requests
- checks if the API Key / Referrer is valid
- sends out a response
At the same time there is the business user who can control what the output is in the response.I want to make the onboarding/ authentication as smooth as possible but also maintain that is both secure and robust enough.
For example, the use case would look like this
- The customer installs the plugin / code on their website
- The website reaches out to the SaaS server and authenticates itself (tells the SaaS app that it is contacting from xyz.com)
- The SaaS app does a Reverse IP check to see if the request from the IP was same as xyz.com
- A record is stored in the DB which maps the API key to the customers domain name, and the API Key is stored on the customers website.
- All the requests from customers website to the SaaS server now uses the API Key that was generated
So far it looks very straighforward for me to implement. Here is what complicates things and I don't know - How do I authenticate correctly and eliminate fraud if there is more than 1 website hosted on the same ip
- If a user changes their webhost / ip address, how do I authenticate them again?
More Questions1. Is this a good practice (secure) ? 2. Are there any tools/libraries out there that provide this out of the box? 3. The whole post sounds very stupid and I should simply read how OAuth 2.0 works