John Posted February 4, 2021 Posted February 4, 2021 Hi, In Sage One API, I would like to know if it is possible to get an Access Token without the input of the user / redirect_uri. From my understanding we must call the https://www.sageone.com/oauth2/auth route that will prompt the user to enter the login infos manually and then redirect the user to a redirect_uri callback with a code. And then we will be able to call https://oauth.na.sageone.com/token with the provided code to get the Access Token. What we want is the authentication step in the API to be transparent to the user. Thank you!
Administrators Ben Smith Posted February 4, 2021 Administrators Posted February 4, 2021 Hi John, Welcome to the community! At present this is the only way you can handle the initial authentication process, and it will require a manual login. That being said, once an app has been has been authorised once and an access token retrieved it's possible to maintain the connection by utilising the refresh token to request a new access token when the previous has expired. You would need to retrieve the token expiry time during auth, and store the refresh token which has a lifetime of 31 days. If the access token has expired, simply refresh it using the refresh token, and repeat. This would mean that once your initial integration is complete, the process wouldn't require any manual input from a user. We have a thorough guide on the authentication process on our developer portal which you can find here: https://developer.sage.com/accounting/guides/authenticating/authentication/ I hope this helps, Ben 1
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now