4

I am trying to access a web service from R using RCurl. The web service uses Kerberos authentication.

Testing using curl on the command line works fine e.g.

curl --negotiate -u: http://reuxeuls199:8084/reports-ws/api/r/1.0/vesselTracking?region-name=ECC&start-date-time=01/10/2014

However in R I am unable to make it work.

ReportsProdURL <- "http://reuxeuls199:8084/reports-ws/api/r/1.0/vesselTracking?region-    name=ECC&start-date-time=01/10/2014"
URL <- getURL(ReportsProdURL, verbose=TRUE, .opts=curlOptions(username=":"))

I also tried using the httpauth option set to gssnegotiate, but that fails also.

Luxspes
  • 6,268
  • 2
  • 28
  • 31
nightwatch
  • 41
  • 1
  • 2

3 Answers3

3

Using ,

httr::GET(ReportsProdURL, 
    authenticate(":", "", type="gssnegotiate"))

And if no proxy is required for an internal website, then

httr::GET(ReportsProdURL, 
    use_proxy(""), 
    authenticate(":", "", type="gssnegotiate"))
chinsoon12
  • 25,005
  • 4
  • 25
  • 35
1

I have not found out how to do it with RCurl but with httr you can use

GET("https://host.domain/",authenticate("username","password","gssnegotiate"))

In case you are using a self signed certificate you can run the command

set_config( config( ssl.verifypeer = 0L ) )

To disable certificate validation for the underlying libcurl library

Community
  • 1
  • 1
Luxspes
  • 6,268
  • 2
  • 28
  • 31
1

With RCurl, for NEGOTIATE, use this:

getURL("https://yourAddress", userpwd=":", httpauth = 4)

The number 4 ist based on a bitmask of constants defined in curl.h. Valid options are defined here.

tine2k
  • 1,521
  • 1
  • 16
  • 21