Skip to main content
Solved

How Pass Token in API Key when Authentication Method is Bearer

  • Jan 29, 2023 10:23 AM UTC
  • 5 replies
  • 623 views

Forum|alt.badge.img+9

Hi All, 

We have scenario when API Key is Dynamic and each time we have to send new Token. 

Is it any method or configuration. 

Regards, 

Kishore Nenwani

Best answer by envkishon

Hi Damith, 

I tried it, it is not working

 

 

 

View original

5 replies

dsj
Ultimate Hero (Partner)
Forum|alt.badge.img+22
  • Ultimate Hero (Partner)
  • Jan 30, 2023 5:31 AM UTC

Hi @envkishon 

If you are sending this using PLSQL_REST_SENDER_API, then authentication can be added in the http_req_headers_  parameter. By this way you can add dynamic api key in the request.

In the routing address, set the authentication method to None.

Eg:

plsql_rest_sender_API.Call_Rest_EndPoint(rest_service_ => 'YOUR_MESSAGE_FUNCTION',
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,Authorization: Bearer YOURAPIKEY');
END;

Hope it helps!

Damith


Forum|alt.badge.img+9
  • Author
  • Do Gooder (Partner)
  • Answer
  • Jan 30, 2023 6:39 AM UTC

Hi Damith, 

I tried it, it is not working

 

 

 


dsj
Ultimate Hero (Partner)
Forum|alt.badge.img+22
  • Ultimate Hero (Partner)
  • Jan 30, 2023 12:00 PM UTC

Options in the address line are one from the routing address setup, but when we add headers when creating the message in PLSQL_REST_SENDER_API, they should be added to the transport. Can you check the receiving end and see what are the http headers passing from IFS?

 

Regards,

Damith


Forum|alt.badge.img+9
  • Author
  • Do Gooder (Partner)
  • Feb 11, 2023 3:05 AM UTC

Hi Damith, 

If it is in failed/waiting state then how it will transferred at Receiving end. 

 

Regards,

Kishore Nenwani


dsj
Ultimate Hero (Partner)
Forum|alt.badge.img+22
  • Ultimate Hero (Partner)
  • Feb 11, 2023 12:23 PM UTC

Hi Damith, 

If it is in failed/waiting state then how it will transferred at Receiving end. 

 

Regards,

Kishore Nenwani

Hi @envkishon 

 

Do you know why it’s failing? Is it due to an error with your receiving endpoint or due to HTTP response code other than HTTP 200?

If the receiving end sends HTTP response code other than 200, then you can add them in the REST sender ACCEPTED_CODES so application message will be finished.

 

Otherwise you can use something like Postman Mock Server to receive the response and see how the response headers and content looks like.

 

Regards,

Damith