vaxas59775 Posted November 29, 2023 Posted November 29, 2023 Hello, I want to pass user id parameter to my server after they authenticate sage account with my app. Because my users are using same sage app so I need to know which user authenticated. I tried to add parameter in authorization request url: https://www.sageone.com/oauth2/auth/central?client_id={{client_id}}&country=GB&filter=apiv3.1&redirect_uri={{redirect_url}}&response_type=code&scope=full_access&user_id=123 It is not working. The sage backend deletes extra parameters in the url, the user_id parameter is not transferring to the callback. I tried to add parameter to callback url redirect_url = url_encoded(http://........com/callback?user_id=123) https://www.sageone.com/oauth2/auth/central?client_id={{client_id}}&country=GB&filter=apiv3.1&redirect_uri={{redirect_url}}&response_type=code&scope=full_access I tried to change callback url; redirect_url = url_encoded(http://........com/callback/123) https://www.sageone.com/oauth2/auth/central?client_id={{client_id}}&country=GB&filter=apiv3.1&redirect_uri={{redirect_url}}&response_type=code&scope=full_access but when I change callback url sage auth page giving error "Authorize Application Error" It's not working. Is there any way to this? I want to add parameter to authorization request url and read the parameter in the callback.
Steel, Mark Posted November 30, 2023 Posted November 30, 2023 Hi, Thank you for your question. The user_id is returned when obtaining the tokens and is found in the requested_by_id attribute of the refresh_token. { "refresh_token": "eyJhbGciOiJSUzUxMiIss9In0.ejkiLCJpYXQNjiNkdUG5L0w", "refresh_token_expires_in": 2678400, "scope": "full_access", "requested_by_id": "2b486e58-632a-a6cd-6ea8-eb5183931ad3" } Thanks Mark
vaxas59775 Posted November 30, 2023 Author Posted November 30, 2023 I used `state` parameter to send extra data
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now