Question

REST Sender - OAuth 2.0 Client Credentials

  • 20 May 2020
  • 3 replies
  • 1145 views

Badge +2

Hi,

I am testing an integration with REST Sender. The integration will use OAuth 2.0 Client Credential authentication and works fine when I test with Postman.

However when I perform the same via the IFS REST Sender am receiving 401 errors (for auth). This could be a configuration related mistake on my end and want to know if any one has used the REST Sender with OAuth 2.0 Client Credential?

Regards,

 


3 replies

Userlevel 7
Badge +20

Hi Artha,

 

I also had troubles with RSET sender provided authentication types but you can always add the http headers from plsql code. It works handy and what I usually do is copy the http headers from postman and add in the code

below example is to clickatell SMS REST api.

plsql_rest_sender_API.Call_Rest_EndPoint(rest_service_ => 'SMS',

                                         xml_ => bxml_,

                                         callback_func_ => 'P_L_S_Q_L_Rest_Test_API.REST_callback_Test',

                                         http_method_ => 'POST',

                                         http_req_headers_ =>'Content-Type: application/xml,Accept: application/xml,Authorization: YOURAPIKEY');

 

Complete example can be found in https://dsj23.me/2020/04/06/clickatell-sms-integration-with-ifs/

 

Hope it helps!

 

Badge +2

Hi,

Thanks for your reply. The issue was not with the headers as I initially thought. The headers can be defined on the sender via GUI and also via the PLSQL access providers as you mentioned.

In this case, I found that the issue was with the fetching of the authentication token. Had to change the Rest Sender to include scopes. 

Regards,

Artha

Badge +2

Is it possible to have an example of using POSTMAN to obtain a Token maybe a simple step by step. I’m trying to consume a projection and I can view the projection in a web browser but trying to use POSTMAN I’ve not been able to get past the Token.

Not sure what the callback URL should be I can only assume I’ve been provided the correct Auth URL and Access Token URL but I don’t know that either for sure. If you been able to gain a Token and could share, I’m sure others have had the same issue.

Thanks

Reply