error/forcepasswordchangenotice on New User Creation via web service

error/forcepasswordchangenotice on New User Creation via web service

by Neel Bhave -
Number of replies: 2

Hi Guys,
I am creating a new User via Webservice. 
My new user has following attributes -

{
"username":"newuser1",
"password":"Neel@123",
"firstname":"Neel",
"lastname":"Bhave",
"email":"b@c.com"
}

However, when I submit it through GET request, I get the following response -

{
    "exception": "moodle_exception",
    "errorcode": "forcepasswordchangenotice",
    "message": "error/forcepasswordchangenotice"
}

How do I solve this ? Thanks in advance.

Average of ratings: -
In reply to Neel Bhave

Re: error/forcepasswordchangenotice on New User Creation via web service

by Mayank Tyagi -

Hey Neel, 

Can you tell me the function which you are using for creating a new user? Are you using Moodle core function or moodle API webservice function? Because I have created users many time with webservices and core function but never get these errors. And share a bit of your code if possible.

In reply to Mayank Tyagi

Re: error/forcepasswordchangenotice on New User Creation via web service

by Neel Bhave -

Hi,
I have solved this issue. 
The issue was that the user that I was using for the web services had force password reset checked while creation. I had not logged in once the user was created and was only using it for the Webservice. Hence I was this error was showing up. I unchecked force password reset from my admin account and it was solved.

Average of ratings: Useful (1)