Using the API to create a user on an SSO only system

(Alexander Wright) #1

Is it possible to create users via the API with disable local login and SSO enabled?

I’m getting error 500 in response to my API REST calls. other functions work fine.

Create SSO Users, Adding To Group, Subscribing to Category via API
(Felix Freiberger) #2

No, SSO disables user creation.

Why do you want to create the users? With SSO, they will be created automatically when they try to log in.

(Alexander Wright) #3

I’m migrating a bunch of users who currently use yahoo email groups to message.

I’ve lists of their email addresses and want to add them to a set of Discourse groups. Obviously, I can’t till they log in.

So far I’ve had people complaining that they can’t see their private category when they register, as they are not a member of the group yet. If I could create them as users and assign them to the relevant groups first, it would make it a lot easier!

(Jeff Atwood) #4

These should be staged users, as that’s the purpose of staging a user – participation in prior emails that may or may not turn into a web login.

(Alexander Wright) #5

Ahh. How do I do that?

(Jeff Atwood) #6

Let’s ask @zogstrip!

(Alexander Wright) #7

I have the same use case as this topic: Adding new users vs inviting them

(Régis Hanol) #8

Creating staged users using the API is now possible :deciduous_tree:


(Alexander Wright) #9

Thank you!

So I would call create user with name, email, password, username, active = false, staged = true?

(Régis Hanol) #10

That’s right :thumbsup:

(Alexander Wright) #11

Right, this is working on a development site that does not have SSO switched on, but fails as soon as it is.
Should I be trying to do this a different way? Via a plugin, maybe?

(Rana Muhammad Ahsan) #12

@Alexander_Wright how did you solve this problem ?