I requested an API key for Metra in Chicago as part of CUTR-at-USF/transit-feed-quality-calculator#29, and I found out that they use HTTP basic authentication for access credentials - they gave me a username and password.
Currently, we only support a URL, which can include an API key embedded in the URL as an HTTP request parameter. However, basic authentication is accomplished via setting the header, which we currently don't support.
So, we should add an option for HTTP basic authentication via a username and password.
Issue by barbeau Feb 13, 2018 Originally opened as https://github.com/CUTR-at-USF/gtfs-realtime-validator/issues/321
Summary:
I requested an API key for Metra in Chicago as part of CUTR-at-USF/transit-feed-quality-calculator#29, and I found out that they use HTTP basic authentication for access credentials - they gave me a username and password.
Currently, we only support a URL, which can include an API key embedded in the URL as an HTTP request parameter. However, basic authentication is accomplished via setting the header, which we currently don't support.
So, we should add an option for HTTP basic authentication via a username and password.
Here's a Java example: https://stackoverflow.com/a/7020054/937715
Here is their developer site (which as far as I can tell doesn't document this anywhere - I had to ask via email): https://metrarail.com/developers
Here is the sample code they gave me:
Steps to reproduce:
Try to download Metra's feeds via web interface or batch downloader: Host https://gtfsapi.metrarail.com
Raw GTFS Feeds • GET - /gtfs/raw/positionUpdates.dat • GET - /gtfs/raw/tripUpdates.dat • GET - /gtfs/raw/alerts.dat • GET - /gtfs/raw/schedule.zip
JSON GTFS Feeds • /gtfs/alerts • /gtfs/positions • /gtfs/tripUpdates
Additional API Information https://metrarail.com/developers/metra-gtfs-api
Expected behavior:
Give me a way to download the feeds using a username and password
Observed behavior:
You can't download feeds if the server requires a username and password via HTTP basic authentication
Platform:
N/A