ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Problem with Webservice Authentication

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem with Webservice Authentication

    Hello,

    I have a problem with the webserices of Scott Klement.
    I have successfully used it in other projects, but now I can't get any further.
    I need to call a HTTPS page with Basic Authentication, that's what I'm doing now.
    USER and PASS are hard coded in RPGle.

    Code:
     https_strict(*OFF);  
     http_setauth(HTTP_AUTH_BASIC: 'user' : 'pass');
    
     rc = http_url_post_stmf( url
                                    :%trim(sndfile)
                                    : %trim(rcvfile)
                                    HTTP_TIMEOUT
                                    : HTTP_USERAGENT
                                    ContentType );
    If I call the program as *PGMR, it runs perfectly.
    If a normal user calls the program, he gets:
    Code:
    SetError() #13: HTTP/1.1 401 UNAUTHORIZED
    recvresp(): end with 401
    recvdoc parms: chunked 0
    interpret_auth(): entered
    SetError() #36: This page requires a user-id & password
    What additional rights are required here?

    Holger

  • #2
    HTTPAPI is sending your request to the server, and the server is sending back "401 UNAUTHORIZED".

    That's all the information you've provided -- so it is all I can tell you.

    Perhaps this server doesn't use basic authentication? Or perhaps you are not sending the correct userid/password?

    Comment


    • #3
      Hello, Scott,
      the access data are hard coded in the program and always the same.
      Probably the user is not allowed to write in the IFS and this was a consequence error. I solved it differently now, there is a serverjob with rights, so it works.
      Holger

      Comment

      Working...
      X