# Bug OP-6818 - missing www-authenticate in http 401 header for api/v3/time_entries/form

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

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module |  |
| Target versions | 10.5.0 |
| Observed in versions | 10.4.0 |
| Sprint | 10.5.0 |
| Backlog bucket |  |
| Bug found in version (deprecated) | 10.4.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

### **Environment**:

Your OpenProject Version: Cloud Edition (10.4)

Operating System / Browser / Language:

Using Java 11 native HttpClient (on MacOS).

### **Logs**

See attached images.

### **Steps to reproduce:**

1.  Use Basic Authentication Scheme
2.  http post request on api/v3/time\_entries/form with body:  
    {"\_links": {"workPackage": {"href": "/api/v3/work\_packages/1"}}}
3.  Check Response Header

### **Actual Behavior**

From 10.4 OpenProject provides a form and schema end points for time entries.  But OpenProject is not sending www-authenticate challenge string for this new path: api/v3/time\_entries/form.

### **Expected Behavior**

Although the spec [rfc2617](https://tools.ietf.org/html/rfc2617) does not force a server to send a www-authenticate challenge string (and therefore it is not really a bug), but OpenProject is sending www-authenticate challenge string for other paths. And therefore for https connections **OpenProject should send www-authenticate challenge string in http 401 unauthorized header.**

I am using Java HttpClient in a Client Application (Mobile Time Logger) and as of the current JDK's 11-13, HttpClient does not send Basic credentials until challenged for them with a WWW-Authenticate header from the server - it has no option for preemptive authentication. The workaround to manually manipulate http headers has drawbacks, when code gets generated by OpenAPI/Swagger.
