Auto-assign random, anonymous usernames

Is there a way to auto assign an anonymous username without allowing users to create their own?

1 Like

I think they the easiest way would be to use an external authentication system and DiscourseConnect - Official Single-Sign-On for Discourse (sso). Otherwise you could do it with a plugin. Another solution (though you don’t say exactly why this is a problem) might be theme component that obscured the username.

Hi Jay,

Sorry I should have given more context. The forum is for victims of abuse so for safeguarding the users should be anonymous. So when registering rather than give them a load of things they can’t do I thought it might just be helpful to have a username generated for them if that makes sense?

Thanks

There is an anonymous mode option available in discourse but that is not a way to create anonymous accounts. One needs to be able to create an account then they could switch to anonymous profile and post from there. While this may not be the solution you’re looking for, a fully anonymous registration and posting solution doesn’t exist in discourse core. it may be possible to create a custom plugin that just lets someone click a button and populate all fields of the registration form with random anonymous data but then, how do they sign back in once they log out?

2 Likes

Sorry we’re happy with the level of anonymity we have set up, we know who the users are but they aren’t supposed be able to identify each other.

So the only functionality I’m after is setting a generic username automatically when people register and not allowing them to set their own

1 Like

I’m sure such a system doesn’t exist in discourse but I think it should be achievable in a plugin (or maybe a theme component) to automatically populate the username field. Such a plugin doesn’t exist either.

2 Likes

You could probably write a JavaScript theme component that would auto-enter the username field on the “create a new account” page with a random username, when that page appears.

(@osioke here’s an example of a good audition task for a technical community advocate, perhaps?)

3 Likes