Authentication to all of Dydra’s APIs can be accomplished several ways. We recommend using one of the API authentication key methods referenced below.
- Your API Authentication Key
- HTTP Authentication With an API Authentication Key
- API Authentication Key as a Query String Parameter
- Standard HTTP Authentication
Your API Authentication Key
You API Authentication Key can be found by clicking on the “
Your API Key” button in the upper
right hand corner of you account page. This button will show you your current authentication
key and allow you to regenerate a new key should your current key become compromised.
HTTP Authentication With an API Authentication Key
The recommended authentication mechanism is using standard HTTP authentication in conjunction with your Dydra API authentication key. The recommended form for this variation is to provide the authentication key as the password without the username in an authorization header. Alternatively, the positions may be switched and the value can be incorporated into the request URL, but that practice can expose the key unnecessarily.
Example HTTP authentication using an API key as a header
curl -u ':XYZ123456' https://dydra.com/repositories
Example HTTP authentication using an API key in the URL
Since some HTTP clients require a password when using HTTP authentication, you can use a capital
X as the password.
Example HTTP authentication using an API key, with password
API Authentication Key as a Query String Parameter
You can also authenticate to the API with your authentication key by passing the key as a query
string parameter named
auth_token with your request.
Example authenticating using the authentication key as a query string parameter
Standard HTTP Authentication
You can also authenticate to the Dydra API without your API key using your username and password over standard HTTP authentication.
Example standard HTTP authentication using account username and password
curl -u "jhacker:password" https://dydra.com/repositories