Create a user in Open Edx from third party website

Hi :slight_smile:

Can i create/register a user in Open Edx from an external domain? Is this possible? I mean, create it in one click, retrieving data from a form.

I have tested the creation using mysql externally already and it works, but i want something more elegant.

I have seen a post in StackOverflow that recommend using user_api/v1/account/registration/ url and a POST method, can anyone confirm this? Link to the post related

Thanks a lot :slight_smile:

Hi,

Try the following

Create the applications at: https://lms_domain_name/admin/oauth2_provider/application/

  • Client 1:

    • Client ID: [generated client id]

    • Client Type: Confidential

    • Authorization grant type: Authorization Code

    • Client Secret: [generated client secret]

  • Client 2:

    • Client ID: [generate client id]

    • Client Type: Confidential

    • Authorization grant type: Client Credentials

    • Client Secret: [generated client secret]

API Endpoints:

Access Token:

  • https://lms_domain_name/oauth2/access_token

  • grant_type=client_credentials

  • client_id=

  • client_secret=

  • token_type=jwt

User Registration:

  • https://lms_domain_name/user_api/v1/account/registration/

  • Authorization: Bearer (access token retrieved)

  • parameters:

    • name

    • username

    • password

    • terms_of_service=true

    • honor_code=true

    • country=LB

    • email

Login

  • https://lms_domain_name/user_api/v1/account/login_session/

  • Authorization: Bearer (access token retrieved)

  • parameters:

    • password

    • email

3 Likes

Also don’t forget to change configuration as follows:

In edx/app/edxapp/lms.env.json file:

“FEATURES” : {
…
“ENABLE_OAUTH2_PROVIDER”: true,
“ENABLE_COMBINED_LOGIN_REGISTRATION”: true
}

1 Like