Web API on IBMi - Bearer Token (JWT) problem
Posted: Thu Aug 04, 2022 5:49 pm
Hi again,
I have a problem with LANSA Web APIs in conjunction with Bearer Authentication and the environment on which the API resides.
I have created an API that works fine without Authorization - both locally on my laptop and via Model B access when the API is located on the IBMi.
Now I have switched to Bearer Authentication (JWT).
When I create the API on my laptop and then access it via localhost:8082, first retrieve the token in /PostTokens and then use it in the /AdminEcho operation, the expected response comes.
If I check in the same API on the IBMi and access it via my Model B configuration (IIS on my laptop, APIs on IBMi - localhost:8084), create the token and then use it in the AdminEcho operation, the response is "Authorization failure. Access forbidden."
There are no entries in x_err.log and other log files, neither on the laptop nor on the IBMi.
Why is this? What do I have to do to make it work when the API is invoked on IBMi via Model-B-Configuration?
Best regards,
Jörg
I have a problem with LANSA Web APIs in conjunction with Bearer Authentication and the environment on which the API resides.
I have created an API that works fine without Authorization - both locally on my laptop and via Model B access when the API is located on the IBMi.
Now I have switched to Bearer Authentication (JWT).
When I create the API on my laptop and then access it via localhost:8082, first retrieve the token in /PostTokens and then use it in the /AdminEcho operation, the expected response comes.
If I check in the same API on the IBMi and access it via my Model B configuration (IIS on my laptop, APIs on IBMi - localhost:8084), create the token and then use it in the AdminEcho operation, the response is "Authorization failure. Access forbidden."
There are no entries in x_err.log and other log files, neither on the laptop nor on the IBMi.
Why is this? What do I have to do to make it work when the API is invoked on IBMi via Model-B-Configuration?
Best regards,
Jörg