Changes between Version 8 and Version 9 of udg/ecoms/RPackage/authentication
- Timestamp:
- Feb 14, 2014 1:31:01 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
udg/ecoms/RPackage/authentication
v8 v9 1 1 == Authentication 2 2 3 The SPECS-EUPORIAS Data Portal is based on a password-protected THREDDS data server providing metadata and data access to a set of geo-referenced atmospheric variables using OPeNDAP and other remote data access protocols. Therefore, before accessing the data, authentication is required at the SPECS-EUPORIAS Data Portal. To this aim, user's must be registered and activate their role as EUPORIAS/SPECS users, following [wiki:EcomsUdg/DataServer/Registration these steps].3 The '''ECOMS-UDG''' is based on a password-protected THREDDS using OPeNDAP and other remote data access protocols. Therefore, before accessing the data, authentication is required. To this aim, user's must be registered and activate the required roles, as described in the [wiki:EcomsUdg/DataServer/Registration Registration section]. 4 4 5 Once registered as users, the registration within the R session can be easily accomplished assuming that we already have a valid username, role and password . To this aim, in the following lines we illustrate how to proceed using the R-to-Java interface provided by the package `rJava` (For more information on the authentication procedure click on [http://www.unidata.ucar.edu/software/netcdf-java/v4.3/javadocAll/ucar/nc2/util/net/HTTPBasicProvider.html the help page]).5 Once registered as users, the registration within the R session can be easily accomplished assuming that we already have a valid username, role and password, with a simple call to the function `loginECOMS_UDG`, providing HTPP authentication: 6 6 7 {{{#!comment To this aim, in the following lines we illustrate how to proceed using the R-to-Java interface provided by the package `rJava` (For more information on the authentication procedure click on [http://www.unidata.ucar.edu/software/netcdf-java/v4.3/javadocAll/ucar/nc2/util/net/HTTPBasicProvider.html the help page]). 8 }}} 7 9 8 10 {{{ 9 11 > username <- "myUsername" # This is a character string with the username 10 12 > password <- "myPassword" # This is a character string with the password 11 > aux <- .jnew("ucar/nc2/util/net/HTTPBasicProvider", username, password) 12 > J("ucar.nc2.util.net.HTTPSession")$setGlobalCredentialsProvider(aux) 13 13 > loginECOMS_UDG("myUsername", "myPassword") 14 14 }}} 15 16 17 == IMPORTANT: proxy server connections18 15 19 16 In case the connection is performed via a proxy, it is necessary to set up the proxy prior to the authentication step, in order to connect to the server. … … 22 19 > proxyHost <- "proxy.host.com" # Your institution Proxy configuration: host 23 20 > proxyPort <- as.integer(1234) # and port 24 > J("ucar.nc2.util.net.HTTPSession")$setGlobalProxy(proxyHost,proxyPort) 25 21 > loginECOMS_UDG("myUsername", "myPassword", proxy.host = proxyHost, proxy.port = proxyPort) 26 22 }}} 27 23