jonmbake / discourse-ldap-auth

Discourse plugin to enable LDAP/Active Directory authentication.
MIT License
70 stars 53 forks source link

Skip "Create New Account" stage programmatically #50

Open Dawnkai opened 4 years ago

Dawnkai commented 4 years ago

I'm trying to automate LDAP user creation via this plugin using Python (so that the new user added to LDAP doesn't have to click the "Create New Account" button after first login). I searched Discourse API: https://docs.discourse.org/#tag/Users/paths/~1users/post in order to see if there are any specific options on user that are being detected upon login and then altering them but I haven't found anything.

There are no problems logging the LDAP user in and then creating new user (with the Create New Account window that appears upon first login) via the UI, but is there any way to do it via Python code? Like, with requests library or maybe I have missed something in Discourse documentation?

jonmbake commented 4 years ago

I don't think this is possible through the Discourse API. It might be worth posting something in https://meta.discourse.org/.

sefsh commented 4 years ago

Why can't the plugin itself do it?

sefsh commented 4 years ago

Seems like WP Discourse plugin has the ability to automatically create new Discourse users. Can this code be used as model?