- 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
codefor anaccess_tokenshould always take place in your backend to ensure yourclient_secretandaccess_tokenare 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.