Skip to content

Instantly share code, notes, and snippets.

@genewoo
Created April 28, 2013 07:19
Show Gist options
  • Save genewoo/5476175 to your computer and use it in GitHub Desktop.
Save genewoo/5476175 to your computer and use it in GitHub Desktop.
Login LDAP Authentication GitLab instance by CLI and Fetch RAW File by curl. Since LDAP authentication will create the account for you, so it's very useful to fetch file from GitLab.
#!/bin/sh
BASEURL=http://git
USERNAME=DOMAIN_USER
USERPASS=DOMAIN_PASSWORD
RAW_FILE=RAW_FILE_URI
# login
curl -s -c cookies.txt -d "username=$USERNAME&password=$USERPASS" $BASEURL/users/auth/ldap/callback -o /dev/null
curl -s -c cookies.txt -b cookies.txt $BASEURL$RAW_FILE
rm cookies.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment