[REST API] OAuth2 & Error 500

So, i have found similar situations like this https://www.outsystems.com/forums/discussion/55631/unable-to-debug-500-error-on-published-rest-api/

But no idea about how to proceed. On Postman works normally!


mvp_badge
MVP

Hi Motta,


If not defined yet, try to set your 'Request Format' attribute to Form URL Encoded on the advanced properties of your REST Endpoint:



I had a similar error in the past and that solved,

Let me know if that helped!


Cheers and Regards,
RR :)

Hi Raphael! I appreciate, but the request format was already setted that way. But thanks! 

mvp_badge
MVP

In this case check this component,

It has a sample on how to use OAuth token API and might help!


Try to check if all attributes are being sent in the correct way.


If this one don't have what you need there are other samples you can also find on forge for some other scenarios, just check here.




Besides that,

 
I checked the message of your error on your first print screen and seems like the problem may be on the code parameter, try to remove the '&' after the grant and define a valid code on the test parameter.


On the second one your Authorization header is a little bit weird.
Should you have a Basic64 or just Basic followed by you Base64 hash? Try to remove the 64 from Basic.
It may be the cause of 500 server error.


Cheers and Regards,
RR :)

We tried the OAuth2 plugin before and similars ones. They were already being used for other applications, but the configuration was no the same for our case, then we are trying to do to do ourselves.


And yeah, it was just Basic followed by the base64 hash before, but as the error kept happening I wondered about the possibility (of anything else). Gonna try what you say about '&' after the grant, just waiting to restart the server!

Can get the resource... Still no idea about the access_token! (got the access_token from a request trough postman! )

mvp_badge
MVP

Hi Motta,

Following the error_uri documentation, you need to make sure the redirect_uri you include in the token request is EXACTLY the same as the one you include in the authorization request.

Regards,

Nordin

Hello Ajit, in fact I did post the same link, what would you want to show?

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.