Skip to content

Basic auth disabled if username or password not set #325

@rojopolis

Description

@rojopolis

The check for basic auth verifies that both username and password are set, however at least one API requires username, but no password.
For example the API for cronitor: https://cronitor.io/docs/api

Authentication to the API is performed via [HTTP Basic Auth](http://en.wikipedia.org/wiki/Basic_access_authentication). 
Provide your API key as the basic auth username value. You do not need to provide a password.

In my provider configuration I set a username, but no password and the result was that no auth was sent at all. If both are required to send auth, then it seems like it should be an error to set one but not both.

It's easy enough to work around for this particular case because the password can be set to any value and is ignored by the API. I just thought I'd open an issue in case anyone else runs into it.

https://github.com/Mastercard/terraform-provider-restapi/blob/master/restapi/api_client.go#L298-L300

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions