Skip to content

[OpenSource] Authentification with OAuth. How to create an admin user. #7979

Discussion options

You must be logged in to vote

Hi @malte-baumann you can use the user service to create an admin email, something like:

await userService.createUser({
                'Your Name',
                'youremail@yourdomain.com',
                RoleName.ADMIN,
            });

The code is available here:

async createUser(
{ username, email, name, password, rootRole }: ICreateUser,
auditUser: IAuditUser = SYSTEM_USER_AUDIT,
): Promise<IUserWithRootRole> {

You see that you can also send in the password, but having it in code might be a security risk, but there are ways.

Let me know if that helps! Also, remember that you can us…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by gastonfournier
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants