Jump to content
Guest

Authorization request - The redirect_uri does NOT have state upon return.


Recommended Posts

Posted
Posted

Hi Sipho,

I'm not sure I understand your issue and what it is you are expecting in the response? Are you following the auth guide https://developer.sage.com/accounting/guides/authenticating/authentication/. Could you reference in the guide what you are expecting?

The flow is - You send the auth request with the scope and then the redirect takes the user to the sign in. There they will be asked to grant access to the connecting application. If the scope was passed they would see read_only or full_access when they grant the connecting application access.

Once they have granted access the auth_code will be returned to your callback URL and then you exchange the auth_code for a set of tokens. On successful exchange tokens will be retuned for the access an refresh tokens. I've included an access token response below which includes the scope.
 

{
    "access_token": "eyJhbKXQF-nHPIualmhB9QeRhqChs9jMOPtQv3md40eB1KY_SjfwhPCoWkwxZla9DVAgUf2aVKhw_cw3Rr6e1AjT8DrLlz-59IsC_QkibG0QsVkiolKAXljvogCIZacMSpKM4U2H5nDJzkNnHKXZhXQQJEwX5oh8dY4AN-jaucmRIL8XUi5NII1PbFHH-qMPCfQujs0stH3NUfTtSjk7-A4RAI3EwUvOxM2O_G8dz3nSa2yzLumwzDa7gFQeg3sZRbES3wnS_wW122S4DP6OHCkwcUy9MCs6XZlTjZ4sO1dyHHzeFRlxZbLwUE4yPJiIqJEF-Bs7veyL0RoNPYZXMdAVB6kvnfrprEJRL8ogJvPiocApQIM9eO-FDd6LADM",
    "refresh_token_expires_in": 2678400,
    "scope": "full_access",
    "requested_by_id": "2b486e58-632a-a6cd-6ea8-eb5183931ad3"
}

Thanks

Mark

Posted


Hi @Steel, Mark thank you for reaching out. 

Yes, I am following the documentation and on the documentation, there is a query param called "state", according to the documentation, when the callback happens, it should contain THREE query params code, country and the state, but it only contains the code and the country not the state. I use state for validation and if it's null, my code falls over. 

image.thumb.png.bd4b1cbca615851f1f7d431573eab882.png

Posted

Finally figured this out. I was attending the 'state' value in my redirect url instead the Sage url. 

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...