Feature request: Allow “id” as a mapping field for auth_userkey login URL generation #112
Copy link
Copy link
Closed
Labels
Description
In the current auth_userkey workflow, external systems typically identify users via idnumber, email, or username. Many integrations set the user’s idnumber to an external identifier, and authentication is then performed using that field.
However, some external systems already know the internal Moodle userid and do not manage or rely on idnumber. In these cases, the ability to request a login URL directly using the real, internal Moodle id is both simpler and more reliable.
Use case
An external service holds a user’s Moodle userid (e.g. 90).
To generate a one-time login URL, it should be able to call:
/webservice/rest/server.php
?wstoken=SECRETWSTOKEN
&wsfunction=auth_userkey_request_login_url
&moodlewsrestformat=json
&user[id]=90
Why this is useful
- The internal userid is stable, cannot be changed, and does not require the external system to manage a separate identifier like idnumber.
- Reduces configuration complexity for integrations already tied to the Moodle user table.
- Matches how some other Moodle web services allow referencing users.
Reactions are currently unavailable
Activity
dmitriim commentedon Dec 3, 2025
Done as part of #111