IRIS - RestAPI - websession authentication

Primary tabs

I generated a REST API from a Swagger document with basic security.

When I send a request to that API, I now get an authentication error 401 always.

I entered a user api and a password and gave it the role %All.

I tried to call the API with the URL

http://solidara.net:52773/csp/solidara/get_components/solidara?username=...

What's am I doing wrong there?

  • 0
  • 0
  • 106
  • 4
  • 0

Comments

Try to call your API via Postman or a similar REST Client.

Set user/pass in a Basic Auth bloc of Postman request.

Ok, did that with Postman and it looks like I am one step further now. I get back some headers including cookies for CSPSESSIONID and CSPWSERVERID now, but I get it together with error 404 not found.

So it looks like I'm reaching the csp server, but not my generated rest class method %RouteCB1 in impl.cls. Shouldn't this be automatically called by the given URL independent from username? Or do I have to specify there something more besides username, password and roles in the user record?

By the way I also get this error 404, when I try to do the request on virtserver.swaggerhub.com, although there are example mock data, which are displayed as a result in the Swaggerhub development page for the API. But I think that is not related to the IRIS error.

Have you created a Web application pointing to your generated REST dispatch class?

Try this tutorial.

I found the error now.

In the path definition I had

    "/get_components:/{appname}" : {

instead of

    "/get_components/{appname}" : {

Now it*s running.