[OpenSource] Authentification with OAuth. How to create an admin user. #7979
-
I am implementing an auth-hook in my case with keycloak. Similar to your Examples. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
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: unleash/src/lib/services/user-service.ts Lines 212 to 215 in 064744b 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 use our community slack: https://unleash-community.slack.com/ |
Beta Was this translation helpful? Give feedback.
Hi @malte-baumann you can use the user service to create an admin email, something like:
The code is available here:
unleash/src/lib/services/user-service.ts
Lines 212 to 215 in 064744b
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…