I am working on a bash script to get data from the github by hitting the API using curl and this is quite straight forward. However the authentication mechanism we have in our github servers makes this intricate.
Here is the situation :
* The github uses SSO / SAML / opensso for authentication.
* When a user tries to authenticate, it redirects the user to the SSO page and it uses the system certificate to authenticate
* After successfully authenticating, it redirects back to the github page
When I try "curl'ing" the URL, it redirects to SSO. So I passed the -L but that too didn't help.
I have also tried passing the cert and key using --cacert and --key but no luck.
Then I accessed the git using firefox, turned-on the developer tools and copied the "CURL URL" from the network tab which gave me something like below.
This worked! and I believe its the user_session key which got me in.
Please can someone help to find how I can generate this user_session using the curl? so that I can use it and curl again to authenticate and get the data.
I have generate a Personal Access Token from the GIT and passed to curl but that too didnt help. Below are my system details.
Kind Regards,
Kochappa.
Last edited by jim mcnamara; 04-02-2017 at 01:16 PM..
Reason: extra code tags
Hello all.
I have an incredible number of servers that I need to change a parameter on using a web interface. I'd like to be able to do this via curl, but I'm having some trouble. I filled out the form and hit update while snooping (tcpdump) my interface. That gave the the following as what is... (0 Replies)
Hi
I wish to "develop" for brew. It is hosted on GitHub. What book (or online documentation) do you recommend me for GitHub and/or Git?
Prefer small physical book. (1 Reply)
Hi Experts,
Problem statement :
We have an URL for which we need to read the data and get parsed inside the shell scripts.
My Aix has very limited perl utility, i cant install any utility as well.
Precisely, wget,cURL,Lynx,w3m and Lwp cant be used as i got these utilities only when i googled... (0 Replies)
Hi Experts,
Problem statement :
We have an URL for which we need to read the data and get parsed inside the shell scripts.My Aix has very limited perl utility, i cant install any utility as well.
Precisely, wget,cURL,Lynx,w3m and Lwp cant be used as i got these utilities only when i googled it.... (12 Replies)
Hi All,
I am trying to post an xml file (utf-16 encoded) using curl to a REST service. The REST service is expecting 'multipart/form-data' content type.
curl -k -i -H "Content-Type=multipart/form-data" -F "filename=@file.xml;type=text/xml" -X POST -u <username>:<password> <endPointURL>
... (0 Replies)
how to make the bash script ?
http://server.com/mysql.php
POST /mysql.php HTTP/1.1
Host: server.com
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:26.0) Gecko/20100101 Firefox/26.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language:... (1 Reply)
i'm using this command to post data to a remote host:
wget --post-data="My Data" http://<my-ip>:80 -O /dev/null -q
and
curl --data "My Data" http://<my-ip>:80
however, when i run the above, i see the following in my access log on the remote host:
Wget:
10.10.10.10 - - "POST /... (1 Reply)
HI All,
i want to asking about my case , how to post content file of data using curl.
currently if i wanna post data file , i can use this command below :
curl --cacert maxaj.cer -X POST -F 'fileupload=@/data/report_3300_xxx/log/traffic_3300_20180319_1051.txt'... (0 Replies)
Another opensource bastion goes to Microsoft.
Confirmed—Microsoft Buys GitHub For $7.5 Billion
It's official: Microsoft buys open-source coding community GitHub for a reported $7.5 billion | Alphr
Microsoft Is Buying GitHub. Here'''s Why. | Fortune
Why Microsoft is buying GitHub: It's all... (2 Replies)
Discussion started by: MadeInGermany
2 Replies
LEARN ABOUT DEBIAN
net::github::v2
Net::GitHub::V2(3pm) User Contributed Perl Documentation Net::GitHub::V2(3pm)NAME
Net::GitHub::V2 - Perl Interface for github.com (V2)
SYNOPSIS
Prefer:
use Net::GitHub;
my $github = Net::GitHub->new(
version => 2, # optional, default as 2
owner => 'fayland', repo => 'perl-net-github'
);
Or:
use Net::GitHub::V2;
# for http://github.com/fayland/perl-net-github/tree/master
my $github = Net::GitHub::V2->new( owner => 'fayland', repo => 'perl-net-github' );
DESCRIPTION
NOTE: Github will terminate API v1 and API v2 on May 1st, 2012
<http://develop.github.com/>
For those (authentication required), you must set login and token (in <https://github.com/account>). If no login and token are provided,
your .gitconfig will be loaded: if the github.user and github.token keys are defined, they will be used.
my $github = Net::GitHub::V2->new(
owner => 'fayland', repo => 'perl-net-github',
login => 'fayland', token => '54b5197d7f92f52abc5c7149b313cf51', # faked
);
If you want to work with private repo, you can set always_Authorization.
To disable call rate limiting (e.g. if your account is whitelisted), set api_throttle to 0.
By default, error responses are propagated to the user as they are received from the API. By switching throw_errors on you can make the be
turned into exceptions instead, so that you don't have to check for error response after every call.
my $github = Net::GitHub::V2->new(
owner => 'fayland', repo => 'perl-net-github',
login => 'fayland', token => '54b5197d7f92f52abc5c7149b313cf51', # faked
always_Authorization => 1,
api_throttle => 0,
throw_errors => 0,
);
METHODS
repos
$github->repos->create( 'sandbox3', 'Sandbox desc', 'http://fayland.org/', 1 );
$github->repos->show();
Net::GitHub::V2::Repositories
user
my $followers = $github->user->followers();
$github->user->update( name => 'Fayland Lam' );
Net::GitHub::V2::Users
commit
my $commits = $github->commit->branch();
my $commits = $github->commit->file( 'master', 'lib/Net/GitHub.pm' );
my $co_detail = $github->commit->show( $sha1 );
Net::GitHub::V2::Commits
issue
my $issues = $github->issue->list('open');
my $issue = $github->issue->open( 'Bug title', 'Bug detail' );
$github->issue->close( $number );
Net::GitHub::V2::Issues
object
my $tree = $github->obj_tree( $tree_sha1 ); # alias object->tree
my $blob = $github->obj_blob( $tree_sha1, 'lib/Net/GitHub.pm' ); # alias object->blob
my $raw = $github->obj_raw( $sha1 ); # alias object->raw
Net::GitHub::V2::Object
network
$github->network_meta; # alias ->network->network_meta
$github->network_data_chunk( $net_hash ); # alias network->network_data_chunk
Net::GitHub::V2::Network
organization
my $organization = $github->organization->organizations('github');
my $teams = $github->organization->teams('PerlChina');
Net::GitHub::V2::Organizations
pull_request
my $pull = $github->pull_request->pull_request();
Net::GitHub::V2::PullRequest
SEE ALSO
Any::Moose
AUTHOR
Fayland Lam, "<fayland at gmail.com>"
More on Changes
COPYRIGHT & LICENSE
Copyright 2009-2011 Fayland Lam, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.2 2012-03-30 Net::GitHub::V2(3pm)