curl
The curl utility is used on command-lines or in scripts to transfer data. It is also used in cars, television sets, routers, printers, audio equipment, mobile phones, tablets, set-top boxes, media players and is the preferred internet transfer software for thousands of software applications affecting billions of humans daily. See https://curl.haxx.se/ for more information.
Contents
1. Overview
curl (at least versions >= 7.38) natively supports Moonshot; you can use it to access to HTTP-based APIs from the command-line using Moonshot.
2. Compatibility
2.1. Key
In the tables below, the following icons have the following meanings:
- - This version of the software has been tested and verified as supporting Moonshot.
- - This version of the software has been tested and verified as not supporting Moonshot.
- - This version of the software has not yet been tested thoroughly and its status is not known. Let us know if you have tried it and whether it worked or not!
2.2. Compatibility List
Note that accessing supported versions of this software requires a Moonshot compatible client - see the the table below for details on which clients are supported.
Generally, curl versions that list GSS-API
as feature will be ok. GSS-Negotiate is not the same as GSS-API.
$ curl --version curl 7.43.0 (x86_64-apple-darwin15.0.0) libcurl/7.54.0 SecureTransport zlib/1.2.8 Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp Features: AsynchDNS IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz UnixSockets
Any versions not listed below have not yet been tested. If you do so, please let us know!
Version | Compatible? | Notes |
---|---|---|
curl 7.38.0 | Tested on Linux, macOS | |
curl 7.29.0 | Tested on CentOS 7 |
3. Installation Instructions
Install curl
using
(Debian-based systems) or apt
yum
(RH-based systems). curl
is included by default on macOS.
4. Usage Instructions
Just add the --negotiate
and -u ":"
to your command line. An example (use alice@demo-idp.moonshot.geant.org
as username and alicepwd
as password):
$> curl --negotiate -u ":" http://demo-rp.moonshot.geant.org/protected/list_json.cgi { "local-login-user": "student", "urn:ietf:params:gss:federated-saml-assertion": "<ns0:Assertion xmlns:ns0=\"urn:oasis:names:tc:SAML:2.0:assertion\" ID=\"181f1b8e-9377-4021-a5f1-218568569625\" IssueInstant=\"2018-02-07T09:56:53Z\" Version=\"2.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><ns0:Issuer>http://demo-idp.moonshot.geant.org/</ns0:Issuer><ns0:Subject><ns0:NameID Format=\"urn:oasis:names:tc:SAML:2.0:nameid-format:transient\">27e7e34a-18d0-4c7f-8132-dc2a86ff96e1</ns0:NameID><ns0:SubjectConfirmation Method=\"urn:ietf:params:abfab:cm:user\"/></ns0:Subject><ns0:Conditions NotBefore=\"2018-02-07T09:56:53Z\" NotOnOrAfter=\"2018-02-07T10:56:53Z\"/><ns0:AttributeStatement><ns0:Attribute Name=\"idp_software\" NameFormat=\"urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified\"><ns0:AttributeValue xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xsi:type=\"xs:string\">UMU/JISC IDP module for FreeRADIUS</ns0:AttributeValue></ns0:Attribute><ns0:Attribute Name=\"urn:oid:1.3.6.1.4.1.5923.1.1.1.1\" NameFormat=\"urn:oasis:names:tc:SAML:2.0:attrname-format:uri\"><ns0:AttributeValue xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xsi:type=\"xs:string\">student</ns0:AttributeValue></ns0:Attribute></ns0:AttributeStatement></ns0:Assertion>", "urn:ietf:params:gss:federated-saml-attribute urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified idp_software": "UMU/JISC IDP module for FreeRADIUS", "urn:ietf:params:gss:federated-saml-attribute urn:oasis:names:tc:SAML:2.0:attrname-format:uri urn:oid:1.3.6.1.4.1.5923.1.1.1.1": "student", "urn:ietf:params:gss:radius-attribute 1": "alice@demo-idp.moonshot.geant.org", "urn:ietf:params:gss:radius-attribute 24": "NzYwODE1NTQ1", "urn:ietf:params:gss:radius-attribute 26.25622.138": "YjQwNmRjNWEtNDBhZS01NmRkLWI4ZjctMGE3NTYyYzQyZDg1QGRlbW8taWRwLm1vb25zaG90LmdlYW50Lm9yZw==", "urn:ietf:params:gss:radius-attribute 79": "AwgABA==", "urn:ietf:params:gss:radius-attribute 80": "v+jV06dCFEB/Dhnhh6u+Og==" }