开发者

Get username of logged in user in os via browser

is there any possibility to get the username (loginname) from os x via webbrowser? my requiremnets are: a webform should send the name of the logged in user via email. it is for an intranet to subscribe for开发者_开发技巧 courses. (no login on the website)

is this possible or not?


Definitely not in a way that is compatible with all browsers on all operating systems.


Nope, that would be somewhat of an invasion of privacy. You need to ask the user for that information on your website using a form.


Check your web server configuration documentation. With many of them, you can enable authentication that integrates with your domain or LDAP services, Kerberos and similar. This may well allow you to do the kind of "single sign-on" you're talking about, at least with browsers that support the method you choose (and this being intranet, presumably you can constrain browser choice a bit — at least for convenience features like not having to log in again). Once authenticated, you should have the username or similar available.

You can only do that if you're both (server and client) authenticating against the same authentication host (or hosts that are allied), which is what keeps this from being a privacy nightmare — this is an intranet thing.

You may want to drop a question over at serverfault.com listing your server software, server operating environment, and the browsers you want to support, and see if anyone can help you with single sign-on.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜