Effected DB table when new user is created in confluence
Asked by ICICI Bank Atlassian Support Team:

Hi,

we are trying to integrate confluence with our access management tool and looking for below details which Atlassian is unable to provide.

<br />

At DB end is there any stored procedure available for user creation in the confluence application(If yes, kindly provide the name of procedure).

If not, please provide below details

1.List of affected tables while creating a new user in confluence.  
2.How primary key ID is incrementing (is it by sequence or by any other approach).  
3.In CWD_USER table what should be the value of column 'credential' and when it should get updated.


Answers:
author: Nic Brough -Adaptavist-
body: Ok, I'll start with the standard points.

* Stop reading the database, it is not designed for you to report off
* More importantly, you should almost certainly never be writing to it, so there's no need for you to ask any of these questions.

But, on to the answers to your questions:

\>At DB end is there any stored procedure available for user creation

No. Atlassian applications use databases as a data store, nothing more, they do not have stored procedures you would trigger or use, the logic is **all** done in the application

\> List of affected tables while creating a new user in confluence.

Primarily the CWD_ tables, but it can affect others, depending on what you're doing, Apps and external directories. The application logic will handle it for you if you do it properly.

\> .How primary key ID is incrementing (is it by sequence or by any other approach).

It is sequenced, but it's done in non-single steps to avoid clashes. You can not predict what the next sequence will be unless the system is completely shut down, then you'll be able to create what you want and make sure the sequence counter is above it.

\> In CWD_USER table what should be the value of column 'credential' and when it should get updated.

It's the hash of the user's password for internal users and a flag for non-internal users. It needs updating when an internal user changes their password. It is a value that you should never touch, unless you are the user changing their password.

comments: author: ICICI Bank Atlassian Support Team
body: Hi Nic,

Thanks for the revert.

Actually it is mandatory to integrate our Access tool with confluence for user creation that's why we are looking for help.

Can we create users from DB end by inserting DB queries or any other way to create users from using Web services or JSON approach.

Kindly help on this as this compliance issue at BANK.


author: Nic Brough -Adaptavist-
body: If it's down to Compliance, I think your Compliance regulations would mandate you absolutely not touching the database...

What you do with this is up to how you are provisioning users. I would strongly recommend not using Confluence's "internal" users, and hooking it up to your internal directory for a global list of users across various applications. Your user directory is going to be already compliant, and the connection means you don't have to worry about Confluence users, you'll maintain them in the directory. For a lot of directories, Confluence has support built in - if for example, you've got an LDAP one, click add directory, choose LDAP, give it the connection details and the rules for what users and groups to import and that's it.

If you do not use a directory, then you're going to need some scripting and code to manipluate the users.


Tags: confluence-server

server