Document how to use TFA with REST

Created on 26 April 2025, 2 months ago

Problem/Motivation

It took a bit of digging to follow ✨ Allow TFA authentication through REST routes Active and πŸ“Œ Decorate the user.auth service Fixed to figure out how to instruct users to use TFA and REST.

Steps to reproduce

Try as a new dev never having used before

Proposed resolution

Make it easier by documenting on the configuration page if REST is enabled.

Maybe in the README too? Though that duplicates homepage at the moment and maybe its too edge case for homepage?

Remaining tasks

MR

User interface changes

Configuration page has helptext if REST is enabled.

API changes

N/A

Data model changes

N/A

✨ Feature request
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom scott_euser

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @scott_euser
  • Merge request !126Resolve #3521300 "Document tfa and rest" β†’ (Closed) created by scott_euser
  • Pipeline finished with Failed
    2 months ago
    Total: 613s
    #482426
  • Pipeline finished with Canceled
    2 months ago
    Total: 309s
    #482435
  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    Small change, but will at least be helpful for future me and perhaps other devs

    phpstan issue unrelated and occurs on 2.x

  • Pipeline finished with Success
    2 months ago
    Total: 345s
    #482437
  • πŸ‡ΊπŸ‡ΈUnited States cmlara

    For the 2.x we are embracing using GitLab Pages for the documentation/manual. This is rendered by mkdocs from the markdown files in the docs folder and published on each 2.x pipeline execution. It is also currently included in each download for offline viewing.

    We likely should place this somewhere in the docs (there may be no great location for it at the moment as they are sparsly populated, a new section may be necessary).

    I'm going to set back to NW for including in the

    For REST logins I would suggest sites I would recommend the site owner consider using an API token auth provider (unless we are talking about the post login to obtain a cookie).

    This will impact password access that uses the user.auth service to validate a use. Known scenarios this is relevant for:

    • Password confirmation forms that do not check the database directly
    • HTTP Post to /user/login (this is always enabled in Drupal Core).
    • http_basic authentication

    Given the above not sure it if makes sense to limit this to just the rest module enabled.

    To me it feels a bit unusual to inline this, though at the moment it is indeed not documented anywhere except in the deep issues logs.

  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    scott_euser β†’ changed the visibility of the branch 3521300-document-tfa-and-rest to hidden.

  • Merge request !129Document how to use TFA with REST β†’ (Merged) created by scott_euser
  • Pipeline finished with Success
    about 2 months ago
    Total: 598s
    #487862
  • Pipeline finished with Canceled
    about 2 months ago
    Total: 401s
    #487867
  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    Makes sense and thank you for the detailed explanation. I added a documentation page nested within configuration with options + tried to capture your recommendation with examples.

  • Pipeline finished with Success
    about 2 months ago
    Total: 331s
    #487872
  • πŸ‡ΊπŸ‡ΈUnited States cmlara

    Looks good.

    I did add the new page to the menu above exempting authentication provides.

    Minor suggestion on possible text change to be a bit more agnostic on providers provided in text.

  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    Sorry was slow getting back to you here! Thanks for resolving, after the changes the wording is clear and would help future travellers trying to figure out how it works.

    And thanks for the great module overall, much appreciated!

  • πŸ‡ΊπŸ‡ΈUnited States cmlara

    Thanks for the confirmation you find the suggested tweaks acceptable.

    Committing MR!129 to Dev (should show up on GitLab pages in a few minutes).

    Do you find the documentation pages sufficient that we can also close out MR!126?

  • πŸ‡¬πŸ‡§United Kingdom scott_euser

    Yes thank you :) Closed the MR.

  • πŸ‡ΊπŸ‡ΈUnited States cmlara

    Thank you for confirming.

    Closing the issue out as fixed.

    Thank you again for the primary work on this commit.

    This is the rendered page:
    https://project.pages.drupalcode.org/tfa/configuration/tfa-with-rest/

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024