The AuthenticationService
offers an alternative cookie based authentication
method. Using the AuthenticationService, you can request a cookie that can be included
with subsequent requests.
Requests can also be authenticated by passing in HTTP Basic
Authentication
headers, and in a subsequent release of the API we will
also support authentication by OAuth.
Using HTTP Basic Authentication
:
> curl --user login:pass https://data.cms.gov/api/users/login/views.json
Compliance Level: This method is a Socrata extension to the SODA standard
Use aPOST
request to retrieve an authentication cookie. The service will also respond with a User object for the authenticated user.
username
string (required)The user login you wish to authenticate as
password
string (required)The user's password to authenticate with
Authenticating in order to retreive an authentication cookie:
> curl --cookie-jar cookies.txt --data username=login --data password=pass https://data.cms.gov/api/authenticate
After you've requested an authentication cookie, you can reuse it to make further requests to private resources, such as rows in a private dataset:
> curl --cookie cookies.txt https://data.cms.gov/api/views/4haf-yu5g/rows.json