Skip to content

Unable to login anymore with LDAP #7021

Discussion options

You must be logged in to vote

Try the following script to create a user and add it to groups,

**-- insert/create new user
WITH new_user AS (
INSERT INTO public.users (email, name, password, "isActive", "isVerified", "mustChangePwd", "createdAt", "updatedAt")
VALUES ('[email protected]', 'useriam', '$2a$12$R1byD/SYMOMFA.3CDkC74eD.N3ANTXeOTj6DfjSL4aqpqQsn6dKd6', true, true, true, now(), now())
RETURNING id
),
-- insert useriam in usergroups
admin_group AS (
INSERT INTO "userGroups" (id, "userId", "groupId")
VALUES ('3', '3', 1)
ON CONFLICT (id) DO NOTHING
)

SELECT 'Users created and assigned to administrator group' AS status;**

where VALUES ('3', '3', 1) is id, userid and groupid, 1 is admin group, where '$2a$12$R1byD…

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
7 replies
@gabrielctn
Comment options

@asbayevy
Comment options

@gabrielctn
Comment options

@asbayevy
Comment options

Answer selected by gabrielctn
@gabrielctn
Comment options

@gabrielctn
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants