Skip to main content
Solved

Call REST API from event action with Bearer Authentication

  • June 21, 2021
  • 5 replies
  • 1055 views

Forum|alt.badge.img+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?

 

 

Best answer by Anne Fernando

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

This topic has been closed for replies.

5 replies

Forum|alt.badge.img+6
  • Do Gooder (Employee)
  • 15 replies
  • September 16, 2021

Did you get any response on this or a solution?

I have the same issue when using a Basic Authentication.


Forum|alt.badge.img+2
  • Author
  • Do Gooder
  • 4 replies
  • September 18, 2021

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.  


Forum|alt.badge.img+11
  • Hero (Employee)
  • 182 replies
  • September 29, 2021

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


Forum|alt.badge.img+2
  • Author
  • Do Gooder
  • 4 replies
  • September 29, 2021

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


Forum|alt.badge.img+11
  • Hero (Employee)
  • 182 replies
  • Answer
  • October 1, 2021

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