Skip to main content
Solved

How Pass Token in API Key when Authentication Method is Bearer

  • January 29, 2023
  • 5 replies
  • 425 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
Did this topic help you find an answer to your question?

5 replies

dsj
Ultimate Hero (Partner)
Forum|alt.badge.img+22
  • Ultimate Hero (Partner)
  • 866 replies
  • January 30, 2023

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)
  • 25 replies
  • Answer
  • January 30, 2023

Hi Damith, 

I tried it, it is not working

 

 

 


dsj
Ultimate Hero (Partner)
Forum|alt.badge.img+22
  • Ultimate Hero (Partner)
  • 866 replies
  • January 30, 2023

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)
  • 25 replies
  • February 11, 2023

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)
  • 866 replies
  • February 11, 2023
envkishon wrote:

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


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings