Bitbucket Data Center allows REST clients to authenticate themselves with a user name and password using basic authentication.
Most client software provides a simple mechanism for supplying a user name and
password and will build the required authentication headers automatically. For
example you can specify the -u
argument with curl
as follows
1 2curl -D- -u fred:fred -X GET -H "Content-Type: application/json" http://localhost:7990/rest/api/1.0/projects
If you need to you may construct and send basic auth headers yourself. To do this you need to perform the following steps:
Basic YWRtaW46YWRtaW4=
1 2```sh
1 2curl -D- -X GET -H "Authorization: Basic ZnJlZDpmcmVk" -H "Content-Type: application/json" http://localhost:7990/rest/api/1.0/projects ```
Some http client software expects to receive an authentication challenge before it will send an authorization header and this may mean that it may not behave as expected. In this case you may need to configure it to supply the authorization header as described above rather than relying on its default mechanism.
Rate this page: