opensearch-project / security-dashboards-plugin

🔐 Manage your internal users, roles, access control, and audit logs from OpenSearch Dashboards
https://opensearch.org/docs/latest/security-plugin/index/
Apache License 2.0
71 stars 159 forks source link

logging back in doesn't aways work #781

Closed drBenway closed 2 years ago

drBenway commented 3 years ago

Describe the bug When using the default docker compose file for the release candidate,I can't log back in after a logout, unless I switch to a new tab. I guess this is because of some local storage in the browser

To Reproduce Steps to reproduce the behavior:

  1. launch the default docker-compose for the release candidate ( I used only one node)
  2. Go to localhost:5601 and login with admin/admin
  3. Click your user icon at the top right and log out
  4. on the login page again try admin/admin. For me this just refreshes the page without loggin in.

Expected behavior be again logged in to the dashboard .

Plugins not applicable

Screenshots not applicable

Host/Environment (please complete the following information): Tested on Linux Mint 20.1 cinnamon with Firefox 89.0 and chrome 91. Macbook pro big sur 11.4 FF 89.0

Additional context when opening a new tab with localhost:5601 it does work

tlfeng commented 3 years ago

Thanks your your feedback! 👍 I can reproduce this issue. We are going to find out where the problem is.

Here is a screenshot of the broswer when prompt to login after logging out.

image

And logs from the console of opensearch-dashboards:

opensearch-dashboards  | {"type":"response","@timestamp":"2021-06-11T20:19:39Z","tags":[],"pid":1,"method":"post","statusCode":200,"req":{"url":"/auth/login","method":"post","headers":{"host":"localhost:5601","connection":"keep-alive","content-length":"39","sec-ch-ua":"\" Not;A Brand\";v=\"99\", \"Google Chrome\";v=\"91\", \"Chromium\";v=\"91\"","sec-ch-ua-mobile":"?0","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36","osd-version":"1.0.0-rc1","content-type":"application/json","accept":"*/*","origin":"http://localhost:5601","sec-fetch-site":"same-origin","sec-fetch-mode":"cors","sec-fetch-dest":"empty","referer":"http://localhost:5601/app/login?nextUrl=","accept-encoding":"gzip, deflate, br","accept-language":"zh-CN,zh;q=0.9"},"remoteAddress":"172.18.0.1","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36","referer":"http://localhost:5601/app/login?nextUrl="},"res":{"statusCode":200,"responseTime":409,"contentLength":9},"message":"POST /auth/login 200 409ms - 9.0B"}
opensearch-dashboards  | {"type":"response","@timestamp":"2021-06-11T20:19:39Z","tags":[],"pid":1,"method":"get","statusCode":200,"req":{"url":"/app/login?nextUrl=","method":"get","headers":{"host":"localhost:5601","connection":"keep-alive","sec-ch-ua":"\" Not;A Brand\";v=\"99\", \"Google Chrome\";v=\"91\", \"Chromium\";v=\"91\"","sec-ch-ua-mobile":"?0","upgrade-insecure-requests":"1","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36","accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","sec-fetch-site":"same-origin","sec-fetch-mode":"navigate","sec-fetch-user":"?1","sec-fetch-dest":"document","referer":"http://localhost:5601/app/login?nextUrl=","accept-encoding":"gzip, deflate, br","accept-language":"zh-CN,zh;q=0.9"},"remoteAddress":"172.18.0.1","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36","referer":"http://localhost:5601/app/login?nextUrl="},"res":{"statusCode":200,"responseTime":69,"contentLength":9},"message":"GET /app/login?nextUrl= 200 69ms - 9.0B"}
opensearch-dashboards  | {"type":"response","@timestamp":"2021-06-11T20:19:39Z","tags":["api"],"pid":1,"method":"get","statusCode":304,"req":{"url":"/bootstrap.js","method":"get","headers":{"host":"localhost:5601","connection":"keep-alive","sec-ch-ua":"\" Not;A Brand\";v=\"99\", \"Google Chrome\";v=\"91\", \"Chromium\";v=\"91\"","sec-ch-ua-mobile":"?0","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36","accept":"*/*","sec-fetch-site":"same-origin","sec-fetch-mode":"no-cors","sec-fetch-dest":"script","referer":"http://localhost:5601/app/login?nextUrl=","accept-encoding":"gzip, deflate, br","accept-language":"zh-CN,zh;q=0.9","if-none-match":"\"24d72b5874eb2a5b75f5798df9da6b26b4f45041-gzip\""},"remoteAddress":"172.18.0.1","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36","referer":"http://localhost:5601/app/login?nextUrl="},"res":{"statusCode":304,"responseTime":19,"contentLength":9},"message":"GET /bootstrap.js 304 19ms - 9.0B"}
opensearch-dashboards  | {"type":"response","@timestamp":"2021-06-11T20:19:39Z","tags":[],"pid":1,"method":"get","statusCode":200,"req":{"url":"/ui/favicons/favicon.ico","method":"get","headers":{"host":"localhost:5601","connection":"keep-alive","sec-ch-ua":"\" Not;A Brand\";v=\"99\", \"Google Chrome\";v=\"91\", \"Chromium\";v=\"91\"","sec-ch-ua-mobile":"?0","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36","accept":"image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8","sec-fetch-site":"same-origin","sec-fetch-mode":"no-cors","sec-fetch-dest":"image","referer":"http://localhost:5601/app/login?nextUrl=","accept-encoding":"gzip, deflate, br","accept-language":"zh-CN,zh;q=0.9"},"remoteAddress":"172.18.0.1","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36","referer":"http://localhost:5601/app/login?nextUrl="},"res":{"statusCode":200,"responseTime":10,"contentLength":9},"message":"GET /ui/favicons/favicon.ico 200 10ms - 9.0B"}
opensearch-dashboards  | {"type":"response","@timestamp":"2021-06-11T20:19:40Z","tags":[],"pid":1,"method":"get","statusCode":304,"req":{"url":"/translations/en.json","method":"get","headers":{"host":"localhost:5601","connection":"keep-alive","sec-ch-ua":"\" Not;A Brand\";v=\"99\", \"Google Chrome\";v=\"91\", \"Chromium\";v=\"91\"","sec-ch-ua-mobile":"?0","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36","accept":"*/*","sec-fetch-site":"same-origin","sec-fetch-mode":"cors","sec-fetch-dest":"empty","referer":"http://localhost:5601/app/login?nextUrl=","accept-encoding":"gzip, deflate, br","accept-language":"zh-CN,zh;q=0.9","if-none-match":"\"37992637719f97813c3068cfbf877b2d3bb43b97\""},"remoteAddress":"172.18.0.1","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36","referer":"http://localhost:5601/app/login?nextUrl="},"res":{"statusCode":304,"responseTime":1,"contentLength":9},"message":"GET /translations/en.json 304 1ms - 9.0B"}
opensearch-dashboards  | {"type":"response","@timestamp":"2021-06-11T20:19:40Z","tags":[],"pid":1,"method":"get","statusCode":200,"req":{"url":"/node_modules/@osd/ui-framework/dist/kui_light.css","method":"get","headers":{"host":"localhost:5601","connection":"keep-alive","sec-ch-ua":"\" Not;A Brand\";v=\"99\", \"Google Chrome\";v=\"91\", \"Chromium\";v=\"91\"","sec-ch-ua-mobile":"?0","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36","accept":"text/css,*/*;q=0.1","sec-fetch-site":"same-origin","sec-fetch-mode":"no-cors","sec-fetch-dest":"style","referer":"http://localhost:5601/app/login?nextUrl=","accept-encoding":"gzip, deflate, br","accept-language":"zh-CN,zh;q=0.9"},"remoteAddress":"172.18.0.1","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36","referer":"http://localhost:5601/app/login?nextUrl="},"res":{"statusCode":200,"responseTime":9,"contentLength":9},"message":"GET /node_modules/@osd/ui-framework/dist/kui_light.css 200 9ms - 9.0B"}
opensearch-dashboards  | {"type":"response","@timestamp":"2021-06-11T20:19:40Z","tags":[],"pid":1,"method":"get","statusCode":200,"req":{"url":"/ui/legacy_light_theme.css","method":"get","headers":{"host":"localhost:5601","connection":"keep-alive","sec-ch-ua":"\" Not;A Brand\";v=\"99\", \"Google Chrome\";v=\"91\", \"Chromium\";v=\"91\"","sec-ch-ua-mobile":"?0","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36","accept":"text/css,*/*;q=0.1","sec-fetch-site":"same-origin","sec-fetch-mode":"no-cors","sec-fetch-dest":"style","referer":"http://localhost:5601/app/login?nextUrl=","accept-encoding":"gzip, deflate, br","accept-language":"zh-CN,zh;q=0.9"},"remoteAddress":"172.18.0.1","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36","referer":"http://localhost:5601/app/login?nextUrl="},"res":{"statusCode":200,"responseTime":11,"contentLength":9},"message":"GET /ui/legacy_light_theme.css 200 11ms - 9.0B"}
opensearch-dashboards  | {"type":"response","@timestamp":"2021-06-11T20:19:40Z","tags":[],"pid":1,"method":"get","statusCode":401,"req":{"url":"/api/v1/restapiinfo","method":"get","headers":{"host":"localhost:5601","connection":"keep-alive","sec-ch-ua":"\" Not;A Brand\";v=\"99\", \"Google Chrome\";v=\"91\", \"Chromium\";v=\"91\"","sec-ch-ua-mobile":"?0","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36","osd-version":"1.0.0-rc1","content-type":"application/json","accept":"*/*","sec-fetch-site":"same-origin","sec-fetch-mode":"cors","sec-fetch-dest":"empty","referer":"http://localhost:5601/app/login?nextUrl=","accept-encoding":"gzip, deflate, br","accept-language":"zh-CN,zh;q=0.9"},"remoteAddress":"172.18.0.1","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36","referer":"http://localhost:5601/app/login?nextUrl="},"res":{"statusCode":401,"responseTime":1,"contentLength":9},"message":"GET /api/v1/restapiinfo 401 1ms - 9.0B"}
opensearch-dashboards  | {"type":"response","@timestamp":"2021-06-11T20:19:40Z","tags":[],"pid":1,"method":"get","statusCode":401,"req":{"url":"/api/v1/configuration/account","method":"get","headers":{"host":"localhost:5601","connection":"keep-alive","sec-ch-ua":"\" Not;A Brand\";v=\"99\", \"Google Chrome\";v=\"91\", \"Chromium\";v=\"91\"","sec-ch-ua-mobile":"?0","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36","osd-version":"1.0.0-rc1","content-type":"application/json","accept":"*/*","sec-fetch-site":"same-origin","sec-fetch-mode":"cors","sec-fetch-dest":"empty","referer":"http://localhost:5601/app/login?nextUrl=","accept-encoding":"gzip, deflate, br","accept-language":"zh-CN,zh;q=0.9"},"remoteAddress":"172.18.0.1","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36","referer":"http://localhost:5601/app/login?nextUrl="},"res":{"statusCode":401,"responseTime":1,"contentLength":9},"message":"GET /api/v1/configuration/account 401 1ms - 9.0B"}
opensearch-dashboards  | {"type":"response","@timestamp":"2021-06-11T20:19:41Z","tags":[],"pid":1,"method":"post","statusCode":200,"req":{"url":"/api/core/capabilities","method":"post","headers":{"host":"localhost:5601","connection":"keep-alive","content-length":"397","sec-ch-ua":"\" Not;A Brand\";v=\"99\", \"Google Chrome\";v=\"91\", \"Chromium\";v=\"91\"","sec-ch-ua-mobile":"?0","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36","osd-version":"1.0.0-rc1","content-type":"application/json","accept":"*/*","origin":"http://localhost:5601","sec-fetch-site":"same-origin","sec-fetch-mode":"cors","sec-fetch-dest":"empty","referer":"http://localhost:5601/app/login?nextUrl=","accept-encoding":"gzip, deflate, br","accept-language":"zh-CN,zh;q=0.9"},"remoteAddress":"172.18.0.1","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36","referer":"http://localhost:5601/app/login?nextUrl="},"res":{"statusCode":200,"responseTime":8,"contentLength":9},"message":"POST /api/core/capabilities 200 8ms - 9.0B"}
opensearch-dashboards  | {"type":"response","@timestamp":"2021-06-11T20:19:41Z","tags":[],"pid":1,"method":"get","statusCode":200,"req":{"url":"/ui/fonts/inter_ui/Inter-UI-Regular.woff2","method":"get","headers":{"host":"localhost:5601","connection":"keep-alive","sec-ch-ua":"\" Not;A Brand\";v=\"99\", \"Google Chrome\";v=\"91\", \"Chromium\";v=\"91\"","origin":"http://localhost:5601","sec-ch-ua-mobile":"?0","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36","accept":"*/*","sec-fetch-site":"same-origin","sec-fetch-mode":"cors","sec-fetch-dest":"font","referer":"http://localhost:5601/app/login?nextUrl=","accept-encoding":"gzip, deflate, br","accept-language":"zh-CN,zh;q=0.9"},"remoteAddress":"172.18.0.1","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36","referer":"http://localhost:5601/app/login?nextUrl="},"res":{"statusCode":200,"responseTime":4,"contentLength":9},"message":"GET /ui/fonts/inter_ui/Inter-UI-Regular.woff2 200 4ms - 9.0B"}
opensearch-dashboards  | {"type":"response","@timestamp":"2021-06-11T20:19:41Z","tags":[],"pid":1,"method":"get","statusCode":401,"req":{"url":"/api/v1/configuration/account","method":"get","headers":{"host":"localhost:5601","connection":"keep-alive","sec-ch-ua":"\" Not;A Brand\";v=\"99\", \"Google Chrome\";v=\"91\", \"Chromium\";v=\"91\"","sec-ch-ua-mobile":"?0","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36","osd-version":"1.0.0-rc1","content-type":"application/json","accept":"*/*","sec-fetch-site":"same-origin","sec-fetch-mode":"cors","sec-fetch-dest":"empty","referer":"http://localhost:5601/app/login?nextUrl=","accept-encoding":"gzip, deflate, br","accept-language":"zh-CN,zh;q=0.9"},"remoteAddress":"172.18.0.1","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36","referer":"http://localhost:5601/app/login?nextUrl="},"res":{"statusCode":401,"responseTime":1,"contentLength":9},"message":"GET /api/v1/configuration/account 401 1ms - 9.0B"}
opensearch-dashboards  | {"type":"response","@timestamp":"2021-06-11T20:19:41Z","tags":[],"pid":1,"method":"get","statusCode":401,"req":{"url":"/api/v1/multitenancy/tenant","method":"get","headers":{"host":"localhost:5601","connection":"keep-alive","sec-ch-ua":"\" Not;A Brand\";v=\"99\", \"Google Chrome\";v=\"91\", \"Chromium\";v=\"91\"","sec-ch-ua-mobile":"?0","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36","osd-version":"1.0.0-rc1","content-type":"application/json","accept":"*/*","sec-fetch-site":"same-origin","sec-fetch-mode":"cors","sec-fetch-dest":"empty","referer":"http://localhost:5601/app/login?nextUrl=","accept-encoding":"gzip, deflate, br","accept-language":"zh-CN,zh;q=0.9"},"remoteAddress":"172.18.0.1","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36","referer":"http://localhost:5601/app/login?nextUrl="},"res":{"statusCode":401,"responseTime":1,"contentLength":9},"message":"GET /api/v1/multitenancy/tenant 401 1ms - 9.0B"}
tlfeng commented 3 years ago

Seems the PR can fix this bug: https://github.com/opensearch-project/security-dashboards-plugin/pull/780 I will transfer this issue to https://github.com/opensearch-project/security-dashboards-plugin for the developers there to take a look.

davidlago commented 2 years ago

This seems to have been fixed. I'm not able to reproduce in OpenSearch 2.1.0.