Page 1 of 1

Web API on IBMi - Bearer Token (JWT) problem

Posted: Thu Aug 04, 2022 5:49 pm
by Joerg Hamacher
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

Re: Web API on IBMi - Bearer Token (JWT) problem

Posted: Sat Aug 06, 2022 11:41 pm
by René Houba
Hi Jörg,

This should work.
We use this (also in a mixed multi tier) for a customer in the Netherlands.

Re: Web API on IBMi - Bearer Token (JWT) problem

Posted: Mon Aug 08, 2022 6:31 pm
by Joerg Hamacher
Hi René,

can this be caused by a HTTPD.conf configuration problem? Or a missing IBMi license programm / program feature? A special OS/400-version - we have V7R3M0 installed? Or maybe a problem with language IDs? Or is there something to be defined / configurated on IBMi that we don't have?

Best regards,
Jörg

Re: Web API on IBMi - Bearer Token (JWT) problem

Posted: Tue Aug 09, 2022 2:04 am
by Dino
Hi Joerg,

You are going to need to review this with support. maybe something missing in your configuration?