Username Generator - Simplelogin not working

When trying to configure the auto-generation of usernames in the web GUI, I keep getting “An error has occurred: Failed to fetch”.

I have generated a SimpleLogin API key and entered it. See screenshot.

I have looked at options within SimpleLogin but no dice. I have a paid-for sub, and the Chrome SimpleLogin extension works without issue.

I’m not an expert on these types of issues, but to get the ball rolling, could you please check what version of the Bitwarden Server software you are running?

2023.2.0

It was also included in the screenshot.

The screenshot shows the version of the Web Vault client app, not the version of your self-hosted server.

Gotcha - fortunately running the latest web and self-hosted server version.

That aside - do you have any idea why this error is happening?

The reason I asked is because this type of error has been known to occur for self-hosted users who are running Vaultwarden.

Hi @phillipmcmahon, are you still experiencing this issue? I saw a hiccup myself once yesterday, but a refresh of my browser (full close and re-launch) seemed to resolve it.

If you’re still having the problem, please open a support ticket, so we can help you troubleshoot this further.

Yep - still the same. I’ve refreshed the browser etc and still the same error.

I will raise a support ticket. Thanks.

Support ticket raised.

I just tried my API key on the bitwarden hosted instance and it works…

Something somewhere needs tweaked with my hosted version. Everything else looks to be operating as expected.

Any ideas where to start looking?

The web browser plugin and android application work, that’s great and serves my needs to be honest.

Just not via the web-ui hosted on my local docker instance. I checked my pihole logs, and the calls to simplelogin are not being blocked, which is a good start. But beyond that, I’ve no idea where else to look.

Hi @phillipmcmahon, I’m glad to hear you’ve opened a help ticket! Our support team will be the best experts to get to the bottom of this. :+1:

I think the issue is within the nginx default.conf file supplied for the self-hosted version

It’s missing https://app.simplelogin.io/api/alias/random/new as a connect-src in the Content-Security-Policy directive. Once added and restarted, the simplelogin setup works as expected. Otherwise a CSP policy violation is triggered, causing the fail to fetch error.

Seems I happened upon an already known bug, reported back in December.