Solved

Call REST API from event action with Bearer Authentication

  • 21 June 2021
  • 5 replies
  • 747 views

Badge +2

I’m trying to set up an event action to call a REST end point that is secured with an API key.  The event action works correctly when I have the Authentication method set to none, but when I secure my end point and change the Authentication method to Bearer the application message fails.  I’ve tried entering an API key of ”abc123”, when I do that the application fails with this message:

Failure while obtaining result: java.lang.ArrayIndexOutOfBoundsException: 2 

Caused by: commonj.work.WorkException: java.lang.ArrayIndexOutOfBoundsException: 2 

Caused by: java.lang.ArrayIndexOutOfBoundsException: 2

 

When I try with an API key of “Bearer abc123” it fails with this message:

Failure while obtaining result: java.lang.StringIndexOutOfBoundsException: String index out of range: -6 

Caused by: commonj.work.WorkException: java.lang.StringIndexOutOfBoundsException: String index out of range: -6 

Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -6

 

So I think there is something I’m missing in the API key but I have no idea what it is, has anyone been able to set this up successfully?

 

 

icon

Best answer by Anne Fernando 1 October 2021, 11:27

View original

This topic has been closed for comments

5 replies

Userlevel 3
Badge +6

Did you get any response on this or a solution?

I have the same issue when using a Basic Authentication.

Badge +2

No, I haven’t heard anything, my only solution was to use no authentication.  Since I wrote the REST endpoint I try to validate the request based on what is in the body, definitely not ideal.  

Userlevel 5
Badge +11

Hi @CHFMOLTBD, What is the App10 UPD version that you are using?  

Badge +2

We are currently on App10 UPD 9 and plan on going to UPD 12 sometime soon.

Userlevel 5
Badge +11

This seems like a bug and solution 293772 will help. The relevant patch is released from UPD13.