Skip to content

Feature request: Allow “id” as a mapping field for auth_userkey login URL generation #112

Closed

Description

@MagnusSamuelsson

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.

Activity

  1. dmitriim commented on Dec 3, 2025

    @dmitriim
    Member

    Done as part of #111

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions