mathworks / matlab-proxy

Python® package enables you to open a MATLAB® desktop in a web browser tab.
Other
47 stars 23 forks source link

Clicking "Show token" in "Status information" displays "null" #26

Closed kcgthb closed 11 months ago

kcgthb commented 12 months ago

Summary

The authentication token is not displayed when clicking on "Show token" in "Status information" panel. It is displayed as "null" instead : image image

Please note that the status correctly says "Authenticated!", as the correct token is passed as a URL parameter in http://localhost:8888/index.html?mwi_auth_token=mytoken. The server is started with:

$ env MWI_APP_PORT=8888 MWI_APP_HOST="0.0.0.0" MWI_ENABLE_TOKEN_AUTH="True" MWI_AUTH_TOKEN="mytoken" matlab-proxy-app

Browser(s) used

Chrome, Firefox

Script output

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                                                     MATLAB
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

matlab - /share/software/user/restricted/matlab/R2022b/bin/matlab OK

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                                                matlab-proxy-app
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

matlab-proxy-app - /share/software/user/open/py-matlab-proxy/0.9.1_py39/bin/matlab-proxy-app OK

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                                           Python and pip executables
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

python - /usr/bin/python OK

Python 2.7.5

pip - /share/software/user/open/python/3.9.0/bin/pip OK

pip 23.3.1 from /share/software/user/open/python/3.9.0/lib/python3.9/site-packages/pip (python 3.9)

python3 - /share/software/user/open/python/3.9.0/bin/python3 OK

Python 3.9.0

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                                                      Xvfb
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Xvfb - /share/software/user/open/x11/7.7/bin/Xvfb OK

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                                                 OS information
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Linux
3.10.0-1160.92.1.el7.x86_64
Linux-3.10.0-1160.92.1.el7.x86_64-x86_64-with-glibc2.17
uname_result(system='Linux', node='sh03-ln05.stanford.edu', release='3.10.0-1160.92.1.el7.x86_64', version='#1 SMP Tue Jun 20 11:48:01 UTC 2023', machine='x86_64')

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                                               Conda information
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

conda - None

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                                               Installed packages
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

/usr/bin/python: No module named pip

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                                                                             Environment variables
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

__LMOD_STACK_MATLABDIR=L3NoYXJlL3NvZnR3YXJlL3VzZXIvcmVzdHJpY3RlZC9tYXRsYWIvUjIwMjJi
MATLABPATH=/share/software/user/restricted/matlab/R2022b/toolbox/local/sherlock
MATLABDIR=/share/software/user/restricted/matlab/R2022b
__LMOD_STACK_MATLAB_JAVA=L3NoYXJlL3NvZnR3YXJlL3VzZXIvcmVzdHJpY3RlZC9tYXRsYWIvUjIwMjJiL3N5cy9qYXZhL2pyZS9nbG54YTY0L2pyZQ==
__LMOD_STACK_MATLABPATH=L3NoYXJlL3NvZnR3YXJlL3VzZXIvcmVzdHJpY3RlZC9tYXRsYWIvUjIwMjJiL3Rvb2xib3gvbG9jYWwvc2hlcmxvY2s=
MATLAB_PREFDIR=/lscratch/kilian/.matlab
MATLAB_JAVA=/share/software/user/restricted/matlab/R2022b/sys/java/jre/glnxa64/jre
__LMOD_STACK_MATLAB_PREFDIR=L2xzY3JhdGNoL2tpbGlhbi8ubWF0bGFi
prabhakk-mw commented 12 months ago

@kcgthb could you share which version of MATLAB proxy you are using?

kcgthb commented 12 months ago

Sure! It's 0.9.1

krisctl commented 12 months ago

Thanks for trying out matlab-proxy, @kcgthb!

Can you confirm if this issue is recoverable? For example, does the token start to show up if you click Hide token and then click View token once after null is displayed? This data point will help me to debug this issue faster. Thanks!

kcgthb commented 12 months ago

Thanks! As far as I can tell, when this happens, clicking alternatively on "hide token" and "view token" doesn't change the end result, the value displayed is always "null".

krisctl commented 11 months ago

Thanks for the information! I have been trying various scenarios to reproduce this locally and have largely been unsuccessful. To further diagnose this issue, I would require some more information from your end.

  1. Can you please share some details about your setup/environment? Is it configured in any special way? What is your use case and workflow etc?
  2. Please run the below steps to capture a specific HTTP request that gets sent out when you click the View token link.

Thank you and looking forward to your response.

kcgthb commented 11 months ago

Thanks for the instructions! I actually haven't been able to reproduce it after some tries, and so far it looks like it may have been related to a local cookies issue. I'm going to close this for now and will make sure to capture HTTP requests and provide them here if I see this happening again. Thanks!