18
Views
4
Comments
Access token for ODC API giving error
Discussion

Hi all,

I am trying to set up consuming ODC API for the first time. I am following the steps, and am struck at this step, specifically the POST method to get the access token.

I am have already tried sending encoded client secret but still getting below error:

Error Executing Test. Http Error Code: 401 - Unauthorized. 

Title: 

Error Code: 

Detail: 

TraceId: 

Thank you!

2025-01-31 03-15-38
Irfan Ahamed Abdul Shukoor

Hi @Nitesh Ahirwar ,


Can you remove the client_secret and client_id and only pass the grant_type and check?

The client_id and client_secret to be sent in the Authorization header (Basic Auth), not in the body. 

Try moving them to basic authentication. 
Please let me know if it helps 

Thank You.

2022-04-29 11-28-26
Nitesh Ahirwar

Hi Irfan , 

thanks for your reply ... but i am following steps according to the documentation.  

It mentions we have to pass grant type, client id and secren in request body ... 

2019-11-11 17-10-24
Manish Jawla
 
MVP

Hi @Nitesh Ahirwar ,

use the below url to encode your secret:

https://www.urlencoder.org/ 

and use it.

I also got the similar 401 error but when i encode my secret using the above url it starts to work.

In addition to that check the below post.

https://www.outsystems.com/forums/discussion/102149/not-able-to-get-access-token-in-prod-env-odc-api/

Hope this helps.

Regards,

Manish Jawla

2022-04-29 11-28-26
Nitesh Ahirwar

Hi Manish ,

How are you! 

I have already gone through the process of encoding and also have seen the thread mentioned but still its not working for me.

Not sure what i am missing, if possible, could you pls ping me on whatsapp or call me for a short discussion. 


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