What is Curl?

Curl is a command line utility to transfer data from or to a server designed to work without user interaction. With Curl, you can download or upload data or files using one of the supported protocols including HTTP, HTTPS, SCP, SFTP, and FTP. Curl provides a number of options allowing you to resume transfers, limit the bandwidth, proxy support, user authentication and much more.

Example

Download SharePoint Online Files using MAC CURL Command

Cause

SharePoint Online uses claims-based authentication and direct NTLM based Curl commands are not allowed.

Resolution

SPOL allows remote applications to call the REST API with user impersonation. This article demonstrates how to access SPOL REST API and download the files from a tenant using Apple Bash Script and Curl commands. However, outside of .NET the authentication piece is not so straightforward. App authentication solves this issue for registered apps but in this document you will see how remote user authentication can be achieved, regardless of platform.

The below diagram illustrates the HTTP requests which need to be made in order to authenticate SharePoint Online.

Download SharePoint Online Files using MAC CURL Command

Applies To

Office 365 Tenant connected with Active Directory Federated Service(ADFS) and MAC OS

Execution Steps

Download SharePoint Online Files using MAC CURL Command

Note
The username & password provided should have access to download the file from SharePoint Online.

Failure Chances

I hope you will find this information useful. Please let me know if you have any questions.