Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use login_hint to prefill user login #795

Merged
merged 2 commits into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions docs/config_general.rst
Original file line number Diff line number Diff line change
Expand Up @@ -259,14 +259,19 @@ Prefill user login
------------------

If Self Service Password is called from another application, you can
prefill the login but sending an HTTP header.
prefill the login by sending an HTTP header.

To enable this feature:
To enable this feature, configure the name of the HTTP header:

.. code-block:: php

$header_name_preset_login = "Auth-User";

It is also possible to prefill the login by using the ``login_hint``
GET or POST parameter. This method does not require any configuration.

Example: ``https://ssp.example.com/?actionresetbyquestions&login_hint=spiderman``

Captcha
-------

Expand Down
3 changes: 3 additions & 0 deletions htdocs/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@
"filter_by_ip" => isset($ratelimit_filter_by_ip_jsonfile) ? $ratelimit_filter_by_ip_jsonfile : ""
);

# Preset login with login_hint
if (isset($_REQUEST["login_hint"]) and $_REQUEST["login_hint"]) { $presetLogin = strval($_REQUEST["login_hint"]); }

#==============================================================================
# Route to action
#==============================================================================
Expand Down