nextcloud / nextcloud/desktop

Set a client certificate even when encountering an AuthenticationRequiredError (error code 401)

Open
#6,772 1 comment 0 reactions 0 assignees View on GitHub
0. Needs triage
Dominant language
C++
Stars
3.9k
Forks
1k
Avg merge
1d 21h
Merged PRs (30d)
127

Description

### ⚠️ Before submitting, please verify the following: ⚠️

- [X] This is a **bug**, not a question or a configuration issue.
- [X] This issue is **not** already reported on Github (I've searched it).
- [X] Nextcloud Server and Desktop Client are **up to date**. See [Server Maintenance and Release Schedule](https://github.com/nextcloud/server/wiki/Maintenance-and-Release-Schedule) and [Desktop Releases](https://nextcloud.com/install/#install-clients) for supported versions.
- [X] I agree to follow Nextcloud's [Code of Conduct](https://nextcloud.com/contribute/code-of-conduct/)

### Bug description

We have set up an in-house Nextcloud server and require client certificate verification for access from the internet.
As expected, if a client certificate is not set in the web browser, a "401 Authorization Required" error will be displayed. And, once we set up the client certificate, we can access Nextcloud correctly.
![image](https://github.com/nextcloud/desktop/assets/95729964/6a0647af-7e92-4a53-a9d5-043ccf49c8fe)
However, when attempting to access the Nextcloud server using Nextcloud Desktop, the option to add a client certificate is not available.

### Steps to reproduce

Nextcloud Desktop is unable to set the client certificate in the case of an AuthenticationRequiredError (error code 401).
![image](https://github.com/nextcloud/desktop/assets/95729964/787f4472-8baa-4dc4-8b41-16d0b69325ad)

### Expected behavior

We would like to have the ability to set a client certificate even when encountering an AuthenticationRequiredError (error code 401).
We understand that Nextcloud Desktop has the ability to configure client certificates.
![image](https://github.com/nextcloud/desktop/assets/95729964/0e0fad6f-8dc3-4a00-86a2-9175e46deefd)
![image](https://github.com/nextcloud/desktop/assets/95729964/f300e2ce-1eda-4434-81cb-a35d2c04aeb3)
However, Nextcloud Desktop is unable to set the client certificate in the case of an AuthenticationRequiredError (error code 401).
![image](https://github.com/nextcloud/desktop/assets/95729964/c452adee-925d-4119-b72d-52a95f69133e)
We have removed the following line of code from the case statement to avoid the aforementioned error screen and display the screen for adding the client certificate.
https://github.com/nextcloud/desktop/blob/v3.12.5/src/gui/owncloudsetupwizard.cpp#L448
`case QNetworkReply::AuthenticationRequiredError:`
We believe there are other users with similar needs, so we would like to request the implementation of a feature that allows setting the client certificate even in the case of an AuthenticationRequiredError (error code 401).
Alternatively, if there is already another method available to add a client certificate, please inform us.

### Which files are affected by this bug

null

### Operating system

Windows

### Which version of the operating system you are running.

Windows 10

### Package

Distro package manager

### Nextcloud Server version

24.0.3

### Nextcloud Desktop Client version

3.12.50

### Is this bug present after an update or on a fresh install?

Fresh desktop client install

### Are you using the Nextcloud Server Encryption module?

Encryption is Enabled

### Are you using an external user-backend?

- [ ] Default internal user-backend
- [ ] LDAP/ Active Directory
- [ ] SSO - SAML
- [ ] Other

### Nextcloud Server logs

_No response_

### Additional info

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.