Web API on IBMi - Bearer Token (JWT) problem

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
Joerg Hamacher
Posts: 95
Joined: Thu Feb 11, 2016 12:01 am

Web API on IBMi - Bearer Token (JWT) problem

Post by Joerg Hamacher » 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

René Houba
Posts: 117
Joined: Thu Nov 26, 2015 7:03 am

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

Post by René Houba » Sat Aug 06, 2022 11:41 pm

Hi Jörg,

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

Joerg Hamacher
Posts: 95
Joined: Thu Feb 11, 2016 12:01 am

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

Post by Joerg Hamacher » Mon Aug 08, 2022 6:31 pm

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

User avatar
Dino
Posts: 306
Joined: Fri Jul 19, 2019 7:49 am
Location: Robbinsville, NC
Contact:

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

Post by Dino » Tue Aug 09, 2022 2:04 am

Hi Joerg,

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

Post Reply