Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-22163

As a REST User I need to re authenticate existing session on login

    XMLWordPrintable

Details

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: High High
    • 5.3
    • 5.1, 5.2
    • Platform > REST API v2
    • Ventoux Sprint 6

    Description

      The current REST spec hints of a missing GET /user/sessions/<sessionId>, however this resource was left out for security concerns. So this story is about changing the existing POST /user/sessions to allow for common use case needed by session based REST clients, re authenticate a user when he comes back to application but while session cookie is still existing (session cookie might not be available to javascript for security reasons btw).

      Suggestion for change made in PR 682:

      • POST /user/sessions with a correct login / pass with session cookie gives:
        • If no session exists, 201 like now (or other response code as we can't provide Location header)
        • If the corresponding session exists, 200 with the same response as for the previous case
          • 13.03.14: If user is different, and if previously anonymous session->migration( true), if previously logged in 409 as already in spec
      • POST /user/sessions/<sessionId>/refresh A new resource where you can POST with session cookie and csrf token
        • If the session is valid => 200 (204 would work if we don't provide a body)
        • 404 if the session is not valid

      vnd.ez.api.Session might also benefit from also containing expiry information(how long the session is valid on inactivity most likely).
      POST /user/sessions/<sessionId>/refresh might not be needed if all resources gives a common error if CSRF is wrong or session has expired.

      Attachments

        Activity

          People

            Unassigned Unassigned
            bertrand.dunogier@ibexa.co Bertrand Dunogier
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 3 days
                3d
                Remaining:
                Time Spent - 3 hours, 50 minutes Remaining Estimate - 2 days, 10 minutes
                2d 10m
                Logged:
                Time Spent - 3 hours, 50 minutes Remaining Estimate - 2 days, 10 minutes Time Not Required
                3h 50m