c0c0n3 / kitt4sme.live

On a mission to bring AI to the shop floor: https://kitt4sme.eu/
MIT License
1 stars 28 forks source link

Adaptive Questionnaire SSO #307

Closed c0c0n3 closed 1 year ago

c0c0n3 commented 1 year ago

This PR upgrades Adaptive Questionnaire to version 1.6.6 to wrap up the SSO/RAMP setup.

c0c0n3 commented 1 year ago

Demo

  1. Browse to AQ: https://kitt4sme.collab-cloud.eu/aq
  2. You should get redirected to RAMP (https://ramp.eu/) where a login form should display
  3. Login with the RAMP test user man@test.com and password the RAMP guys gave you
  4. After successfully logging in, you should get redirected to AQ's start page
  5. Take the questionnaire
  6. When you get to the last page, right click on the "find a kit" button and copy out the URL
  7. Write down the sid param value, e.g. e4401cb4-d2e9-4aeb-a46b-addb1f6bd8aa
  8. Connect to the AQ Postgres DB, e.g.
    $ kubectl exec -it postgres-7d748cc46-6fn4g -- sh
    # psql -U postgres
    postgres=# \c adaptive
  9. Select the Session row having a token field equal to the sid value from earlier
    postgres=# select * from "Session" where token = 'e4401cb4-d2e9-4aeb-a46b-addb1f6bd8aa';
    id  |         accessCode         |          endTime           | groupId |      lastAnswerTime       |   remoteAddr   |         startTime          |                token                 |                                                       userAgent                                                       | fk_session_survey |    field     
    -----+----------------------------+----------------------------+---------+---------------------------+----------------+----------------------------+--------------------------------------+-----------------------------------------------------------------------------------------------------------------------+-------------------+--------------
    147 | k4s-adaptive-questionnaire | 2023-05-11 10:02:11.682672 |         | 2023-05-11 10:02:10.72817 | 130.188.160.88 | 2023-05-11 09:58:32.416811 | e4401cb4-d2e9-4aeb-a46b-addb1f6bd8aa | Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 |                 1 | man@test.com
  10. Check the field column has a value of man@test.com