Bearer token not working in 10.6.9

0
Hi there,   We have been developing a REST call to an API but the call is returning  Authentication information is not given in the correct format. Check the value of Authorization header. When using the Bearer token in the exactly the same format in Postman (by copying it out of a microflow), it works! We have tried both with 'Bearer ' + $Token and by putting the 'Bearer ' as a part of the initial string creation but neither have worked.   We have found that updating to version 10.10 will fix our issue, but we would have preferred to stay on 10.6.x as it's MTS.   Does anyone have any thoughts?  
asked
2 answers
0

Hi Harry, 

Can you make sure whether the bearer token is being passed correctly? 

 

Create a string variable and set the value 'Bearer '+$Token

answered
0

 

Just to add on to this one...

 

We have updated to 10.11.0 for security reasons, but still encountering the same authorisation error.

 

LUCKILY it has been fixed in other locations, except when calling an endpoint that returns a document in it's response body.

 

The error we are still getting:

 

com.mendix.webui.WebUIException: Exception while executing runtime operation
	at com.mendix.webui.actions.client.RuntimeOperationAction.apply(RuntimeOperationAction.scala:72)

Caused by: com.mendix.modules.microflowengine.MicroflowException: Error calling REST service
	at OriginAPI.TEST_documentscall (CallRest : 'Call REST (GET)')

Advanced stacktrace:
	at com.mendix.integration.actions.microflow.RestCallAction.execute(RestCallAction.scala:79)

Caused by: com.mendix.modules.microflowengine.MicroflowException: 400: Authentication information is not given in the correct format. Check the value of Authorization header.
	at OriginAPI.TEST_documentscall (CallRest : 'Call REST (GET)')

Advanced stacktrace:
	at com.mendix.integration.actions.microflow.RestCallAction.checkStatusCode(RestCallAction.scala:117)

 

 

When using postman, there was a Host header that the endpoint wouldn't work with unless it was there.

 

image.png

 

When adding in our own Host header using the Mendix REST call action, the endpoint then has a different error:

 

image.png

 

com.mendix.webui.WebUIException: Exception while executing runtime operation
	at com.mendix.webui.actions.client.RuntimeOperationAction.apply(RuntimeOperationAction.scala:72)

Caused by: com.mendix.modules.microflowengine.MicroflowException: Error calling REST service
	at OriginAPI.TEST_documentscall (CallRest : 'Call REST (GET)')

Advanced stacktrace:
	at com.mendix.integration.actions.microflow.RestCallAction.execute(RestCallAction.scala:79)

Caused by: com.mendix.modules.microflowengine.MicroflowException: 400: The request URI is invalid.
	at OriginAPI.TEST_documentscall (CallRest : 'Call REST (GET)')

Advanced stacktrace:
	at com.mendix.integration.actions.microflow.RestCallAction.checkStatusCode(RestCallAction.scala:117)

 

So yeah, any further thoughts on this one?

 

 

 

answered