# Bug OP-10387 - Global Basic Auth not working anymore

Project: OpenProject
Status: closed
URL: https://community.openproject.org/work_packages/OP-10387

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module |  |
| Target versions | 12.1.2 |
| Observed in versions | 12.1.0 |
| Sprint | 12.1.2 |
| Backlog bucket |  |
| Bug found in version (deprecated) | 12.1.x |
| Found in mobile app version |  |
| Follow-up feedback e-mail |  |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Developers |  |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Work |  |
| Labor costs |  |

## Description

### TLDR:

Starting with OpenProject 12.1.0 the global basic auth is not working anymore. Also not working in the actual 12.1.1. This is possibly related to <mention class="mention" data-id="41133" data-type="work_package" data-text="#41133">\#41133</mention>.

### **Environment**:

Your OpenProject Version: Self hosted 12.1.1 (Docker all in one container)  
Operating System / Browser / OpenProject language: Not a frontend issue, docker container on macOS host system

### **Logs**

No (useful) log output available.

### **Steps to reproduce:**

1.  Start docker all in one container with

<!-- end list -->

``` sh
docker run --rm --name openproject -d \
    -p 127.0.0.1:8080:80 \                    
    -eOPENPROJECT_AUTHENTICATION_GLOBAL__BASIC__AUTH_USER=admin \
    -eOPENPROJECT_AUTHENTICATION_GLOBAL__BASIC__AUTH_PASSWORD=admin \
    -eOPENPROJECT_AUTH__SOURCE__SSO_HEADER=X-Remote-User \
    -eOPENPROJECT_AUTH__SOURCE__SSO_SECRET=s3cr3t \
    -eOPENPROJECT_AUTH__SOURCE__SSO_OPTIONAL=true \
    -eOPENPROJECT_EMAIL__DELIVERY__METHOD=sendmail \
    openproject/community:12.1.0
```

1.   Check the current logged in user with

<!-- end list -->

``` sh
curl --request GET \                   
  --url http://localhost:8080/api/v3/users/me \
  --header 'Authorization: Basic YWRtaW46YWRtaW4='
```

This behaviour was also tested with the user "foo" and password "bar". To check if there is a possible problem with the default admin user is also named admin.

### **Actual Behavior**

The actual behaviour is that OpenProject denies the request with an unauthenticated error.

``` json
{"_type":"Error","errorIdentifier":"urn:openproject-org:api:v3:errors:Unauthenticated","message":"You did not provide the correct credentials."}
```

### **Expected Behavior**

It is expected that the answer from the curl request is the system user. OpenProject 12.0.10 for example delivers the following output:

``` json
{"_type":"User","id":1,"name":"System","createdAt":"2022-05-05T19:53:09Z","updatedAt":"2022-05-05T19:53:09Z","login":"","admin":true,"firstName":"","lastName":"System","avatar":"","status":"active","identityUrl":null,"language":"","_links":{"self":{"href":"/api/v3/users/1","title":"System"},"memberships":{"href":"/api/v3/memberships?filters=%5B%7B%22principal%22%3A%7B%22operator%22%3A%22%3D%22%2C%22values%22%3A%5B%221%22%5D%7D%7D%5D","title":"Members"},"showUser":{"href":"/users/1","type":"text/html"},"updateImmediately":{"href":"/api/v3/users/1","title":"Update ","method":"patch"},"lock":{"href":"/api/v3/users/1/lock","title":"Set lock on ","method":"post"}}
```
