简体   繁体   中英

Is there a way to get current username and password in javascript

When I login to a webpage using Basic Auth, is there a way to get the username and password I used to log in with during the session?

I am connecting to a websocket from that page and want to re-use username and password to make sure the ws connection is coming from this user.

No. That information is not exposed to JS.

In Simple word "NO". If you are able to do that in your application or any application then that a big security concern.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM