- Since the data from payroll providers is sensitive, making API requests from the backend and storing that data on the backend reduces the likelihood of this data being exposed to malicious persons.
- Exchanging the authorization
code
for anaccess_token
should always take place in your backend to ensure yourclient_secret
andaccess_token
are never publicly exposed. - Likewise, your backend should always store the access token in a secure database and should never return the access token to the frontend application.