[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ftpapi] httpapi example 3



Hi Scott and thanks 

I made the changes as you stated below...however, I am still getting an error 

I have attached some of the logging  - do you think you could point me in the right direction as how to resolve this issue 


NTLM Ver 1.4.0 released 2014-12-22
OS/400 Ver V7R2M0

New iconv() objects set, PostRem=819. PostLoc=0. ProtRem=819. ProtLoc=0
https_init(): entered
QSSLPCL = *OPSYS
SSL version 2 support disabled
SSL version 3 support disabled
Old interface to TLS version 1.0 support enabled
TLS version 1.0 support enabled
TLS version 1.1 support enabled
TLS version 1.2 support enabled
--------
recvresp(): entered
HTTP/1.1 401 Unauthorized
Content-Type: text/plain; charset=utf-8
Server: Microsoft-IIS/8.5
SPRequestGuid: 039e1e9f-b123-4072-4905-b97bd275b140
request-id: 039e1e9f-b123-4072-4905-b97bd275b140
X-FRAME-OPTIONS: SAMEORIGIN
SPRequestDuration: 4
SPIisLatency: 1
WWW-Authenticate: NTLM
X-Powered-By: ASP.NET
MicrosoftSharePointTeamServices: 15.0.0.5047
X-Content-Type-Options: nosniff
X-MS-InvokeApp: 1; RequireReadOnly
Date: Thu, 05 Dec 2019 20:14:45 GMT
Content-Length: 16
------

SetError() #13: HTTP/1.1 401 Unauthorized
recvresp(): end with 401
recvdoc parms: identity 16
interpret_auth(): entered
SetError() #36: This page requires a user-id & password
AuthPlugin_mustReceiceAuthErrorPage(): entered
recvdoc(): entered
SetError() #0:
recvdoc(): Receiving 16 bytes.
401 UNAUTHORIZED
SetError() #36: This page requires a user-id & password
http_close(): entered
HTTPAPI Ver 1.40 released 2019-08-15
NTLM Ver 1.4.0 released 2014-12-22
OS/400 Ver V7R2M0

http_getauth(): entered
http_proxy_setauth(): entered
http_persist_open(): entered
http_long_ParseURL(): entered
 



Mike Parker


On Thursday, December 5, 2019, 12:37:54 PM EST, Scott Klement <sk@xxxxxxxxxxxxxxxx> wrote:


Hi Mike,

It depends on the type of authentication they are requesting.  

The most common type of authentication is 'basic'.  If that is what is needed, you can do this prior to calling http_stmf:

http_setAuth( HTTP_AUTH_BASIC
            : 'your user id'
            : 'your password' );

If 'basic' isn't what it needs, you can make a request and let it fail with the 401, then call http_getAuth to find out what sort of authentication it was asking for.   Then, you can do http_setAuth to set the appropriate type of authentication and try again.

Good luck!

-SK

           

On 12/5/2019 11:08 AM, mike parker wrote:

Hi,

I have been trying to use the https example. I am getting error 401 Unauthorized.

I have created the certificate as per the instructions.

 How  do I add the userID and password?
 
-------
RPG Code:

app_id = 'AWTEC_HTTPAPI_SHAREPOINT';   

rc = https_init(app_id);               

if rc = -1;                            

   http_comp(http_error());            

   https_cleanup();                    

   return;                             

endif;                                 

http_stmf( 'GET'                                                           

         : 'https://xxxx.awtec.com/sites/IT/dev/Reports/Reports.docx'     

         : '/home/mparker/Reports.docx' );                                 

 
Error message: 

This page requires a user-id & password  


Error Log: 

recvdoc(): Receiving 16 bytes.                                        

401 UNAUTHORIZED                                                      

SetError() #36: This page requires a user-id & password               

http_close(): entered                                                  


HTTPAPI Ver 1.40 released 2019-08-15                                        

NTLM Ver 1.4.0 released 2014-12-22                                          

OS/400 Ver V7R2M0                                                           

 

New iconv() objects set, PostRem=819. PostLoc=0. ProtRem=819. ProtLoc=0     

https_init(): entered                                                       

QSSLPCL = *OPSYS                                                            

SSL version 2 support disabled                                              

SSL version 3 support disabled                                              

Old interface to TLS version 1.0 support enabled                            

TLS version 1.0 support enabled                                             

TLS version 1.1 support enabled                                             

TLS version 1.2 support enabled                                              


Mike Parker
--
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi
-- 
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi