SCHEDULE JSON - 401 Unauthorized

89 views
Skip to first unread message

colin...@gmail.com

unread,
Nov 24, 2015, 2:52:54 PM11/24/15
to A gathering place for the Open Rail Data community
Hi, I am hoping someone can help me.

I am trying to extract the SCHEDULE information but keep getting a 401 (Unauthorized). The schedule feeds are set up correctly. Whilst logged into datafeeds.networkrail.co.uk, I can click on a schedule link in the nrod wiki and download the schedule file. However if I used curl or the C# app I created, I always get a 401, UnAuthorized.

Strangely, if I log out of datafeeds.networkrail.co.uk and click on the link in the schedule wiki, I am asked for my email and password, and then get Bad Credentials.

Please can you help?

Peter Hicks

unread,
Nov 24, 2015, 3:02:02 PM11/24/15
to colin...@gmail.com, A gathering place for the Open Rail Data community
Hi Colin

What's the exact URL you're trying to hit?  You'll need to make sure you're subscribed to the right schedule feed and, if you're using curl or a C# app, you'll need to pass the username/password otherwise the web server will redirect you to a login page.


Cheers,


Peter



--
You received this message because you are subscribed to the Google Groups "A gathering place for the Open Rail Data community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openraildata-t...@googlegroups.com.
To post to this group, send an email to openrail...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

colin...@gmail.com

unread,
Nov 24, 2015, 3:24:11 PM11/24/15
to A gathering place for the Open Rail Data community, colin...@gmail.com
Hi Peter, thanks for coming back to me. Re-reading my email apologies I left out the most important details.
I am subscribed to the following SCHEDULE feeds:
All Update Daily
All Full Daily

My curl command is:
curl -L -u xxxus...@gmail.com:xxxx -o file.gz "https://datafeeds.networkrail.co.uk/ntrod/CifFileAuthenticate?type=CIF_ALL_FULL_DAILY&day=toc-full" -v

Here are the details of my curl command line output (Just made the email address anon)

* - Conn 0 (0x8634e8) send_pipe: 1, recv_pipe: 0
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0*
About to connect() to datafeeds.networkrail.co.uk port 443 (#0)
* Trying 54.247.175.93...
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0*
Connected to datafeeds.networkrail.co.uk (54.247.175.93) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: C:\Program Files (x86)\Git\bin\curl-ca-bundle.crt
CApath: none
* SSLv3, TLS handshake, Client hello (1):
} [data not shown]
* SSLv3, TLS handshake, Server hello (2):
{ [data not shown]
* SSLv3, TLS handshake, CERT (11):
{ [data not shown]
* SSLv3, TLS handshake, Server key exchange (12):
{ [data not shown]
* SSLv3, TLS handshake, Server finished (14):
{ [data not shown]
* SSLv3, TLS handshake, Client key exchange (16):
} [data not shown]
* SSLv3, TLS change cipher, Client hello (1):
} [data not shown]
* SSLv3, TLS handshake, Finished (20):
} [data not shown]
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0*
SSLv3, TLS change cipher, Client hello (1):
{ [data not shown]
* SSLv3, TLS handshake, Finished (20):
{ [data not shown]
* SSL connection using DHE-RSA-AES256-SHA
* Server certificate:
* subject: C=GB; ST=UNITED KINGDOM; L=London; O=Network Rail Infrastructu
re Limited; OU=INFORMATION MANAGEMENT; CN=datafeeds.networkrail.co.uk
* start date: 2015-06-15 00:00:00 GMT
* expire date: 2017-06-20 23:59:59 GMT
* subjectAltName: datafeeds.networkrail.co.uk matched
* issuer: C=US; O=Symantec Corporation; OU=Symantec Trust Network; CN=Sym
antec Class 3 Secure Server CA - G4
* SSL certificate verify ok.
* Server auth using Basic with user 'xxxus...@gmail.com'
> GET /ntrod/CifFileAuthenticate?type=CIF_ALL_FULL_DAILY&day=toc-full HTTP/1.1
> Authorization: Basic Y29saW5rbG9lc0BnbWFpbC5jb206UmVkcm92ZXIyMqM=
> User-Agent: curl/7.30.0
> Host: datafeeds.networkrail.co.uk
> Accept: */*
>
< HTTP/1.1 401 Unauthorized
< Date: Tue, 24 Nov 2015 20:11:56 GMT
* Server Apache-Coyote/1.1 is not blacklisted
< Server: Apache-Coyote/1.1
* Authentication problem. Ignoring this.
< WWW-Authenticate: Basic realm="Spring Security Application"
< Content-Type: text/html;charset=utf-8
< Content-Length: 999
< Set-Cookie: JSESSIONID=BD2F43378419802E5F145CBC2EB51105; Path=/ntrod/; HttpOnl
y
< Connection: close
<
{ [data not shown]
100 999 100 999 0 0 688 0 0:00:01 0:00:01 --:--:-- 711
* Closing connection 0
* SSLv3, TLS alert, Client hello (1):
} [data not shown]
Reply all
Reply to author
Forward
0 new messages