Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to create users on Confluence problematically or using Ansible

Omar_Abdelrazik June 16, 2020

I have been looking for ways to create new users on Confluence using Ansible (or any scripting language) but couldn't find any documentation or a way around that. 

All I got was page and space management; which is not what I need. 

Is there a way to programatically create new users or is it not supported?

1 answer

1 accepted

0 votes
Answer accepted
Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 19, 2020

Hello Omar,

Welcome to Atlassian Community. It's nice to have you join us. In order to work with Confluence programmatically, you will need to use the API. However, the Confluence API doesn't include a way to create users at this time. There's a feature request for this below.

If you also have Jira hosted on your Atlassian Cloud site, then as a workaround you can use the Jira Cloud API to create the user, and then assign the Confluence license groups all via REST-API. This is not possible if you do not have Jira hosted on your site.

For more information:

If you need any assistance in the future with this, you can visit our Atlassian Developer support resources below.

I hope that helps, but do let us know if you have any questions.

Shannon

Omar_Abdelrazik June 19, 2020

Thank you, Shannon. 

I have Jira in fact but it's not JIRA cloud. Would this make a difference? 

And if it's possible, could you please tell me how to do it? Will it be through duplicating user directors? 

On JIRA, I wasn't able to find the JIRA User Server that facilities the connection. 

And while we're at it, assuming that I used the JIRA User Server configuration, what should count as the account name and password? 

 

Thanks a mil. 

Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 19, 2020

Hi Omar,

Unfortunately, in order for that to work, you would need to be able to do your user provisioning from Jira Server, which isn't possible in Confluence Cloud.

Atlassian Access, which is a paid extension to Cloud, has some ways to do external provisioning. You can read about from our document, User Provisioning with Atlassian Access. If you have Atlassian Access already, you can read more about how to configure that from Configure User Provisioning. Then, depending on which provider you choose, you may be able to do it that way, instead of through Confluence.

Even though it's not possible to use Jira Server in this particular case, if you still want to know how to connect to Jira Server via REST-API, have a look here: Jira Server REST-API Security Overview.

Let me know if you have any questions about that.

Take care,

Shannon

Omar_Abdelrazik June 19, 2020

@Shannon S I am sorry, I believe I didn't get what you said. 

In the first paragraph you mentioned that I need to do the user provisioning from Jira server. 

I already have Jira but I can't find the option User Management -> Jira User Server. 

Would this be due to a limitation or do I need to purchase a plugin/service for the Jira User Server feature to appear on my admin portal?

Also I am trying to access the link for the Jira Server Rest API Security overview but it looks to be broken. 

It would be very helpful to tell me why the Jira Server is not possible in my case and what could I do to make it happen (apart from subscribing for Atlassian Access).

Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 22, 2020

Hi Omar,

My apologies, allow me to clarify that for you.

In summary, Confluence Cloud does not have a REST-API endpoint that will allow you to create new users. The feature request for that can be found here: CONFCLOUD-54893.

Jira Cloud does have a REST-API endpoint to create new users. You can use this as a workaround to add new Confluence Cloud users, since Jira and Confluence Cloud share the same userbase. 

  1. Create the new user by using the Jira Cloud REST-API endpoint.
  2. Again using REST-API, assign the user to the required groups for the permissions they need to have (i.e. access to Confluence). You can check Update Product Access Settings for more information.

You asked about using Jira Server instead. Jira Server doesn't have the ability to control Confluence Cloud users, and it does not share the same userbase as Confluence Cloud. Using Jira Server as a Userbase only works with our other Server products.

Finally, the link I included to the security overview appeared to be malformed by the editor. I'm correcting it now and including that link again below.

I hope that helps clarify things for you, but let me know if you have any further questions.

Regards,

Shannon

Omar_Abdelrazik June 22, 2020

@Shannon S  Thank you Shannon for the clarification. 

I already have an application link between Jira and Confluence but I am unable to login to confluence with the Jira credentials until I add the user with the same credentials to Confluence. 

And on the Application Access page, I only see Jira Service Desk and Jira Software (no confluence).

Is there something I should do to make the seamless access happen?

Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 22, 2020

Hello Omar,

It is not possible to login to Confluence Cloud with your Jira Server credentials.

If you're not able to find Confluence on your Application Access page, then you are probably looking at your Jira site instead. Make sure you're on your Confluence site first, then proceed with the article.

For more information on the integration between Cloud and Server:

Atlassian Cloud uses either Atlassian account or its native directory for authentication (we are progressively migrating all sites to use Atlassian account where internal directory is used).  For Cloud authentication with external user directory see Google Apps integration and SAML (Beta) options.

I hope that helps, but please do let me know if you still have any further doubts.

Regards,

Shannon

Omar_Abdelrazik June 22, 2020

@Shannon S The Jira and Confluence implementation in our site are Server based not Cloud as they are hosted locally. I think the suggestion you provided above was for Jira and Confluence Cloud right?

In this case, if they are not Cloud, they won't share the same user base, right? if so, will the action plan above work or will I need to do it via this link?

I am sorry for asking too many questions. I am just new to the platform and I really appreciate the help you provide. 

Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 23, 2020

Hi Omar,

That's correct; I was providing you the details for Confluence Cloud. Your question is showing on my end to be related to Confluence Cloud. If you did not select Confluence Cloud as your product when asking the question, then it may because you only have a Cloud site associated with your email address. Since you're referring to Confluence Server, the above information does not apply to you. My apologies.

In terms of a solution for Confluence Server, there is also no REST-API for user management just yet. We have the following feature request for that:

As an unofficial workaround, you may still be able to use the deprecated SOAP API service. Review Stephen's suggestion below:

Please note that this is technically deprecated since Confluence version 5.5, but some aspects of SOAP may still work at this time.

Otherwise, you may be able to use a Command Line Interface add-on from Marketplace in order to add your users. You can find an example of how that would work from Bob Swift's documentation: How to add users to groups in bulk.

I hope that's clear, but let me know if you have any questions about that.

Shannon 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events