[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Access network credentials using javascript

Posted on 2012-04-12
13
Medium Priority
?
862 Views
Last Modified: 2013-11-21
Is there anyway to access network credentials with javascript without having to manually set them? This is needed in order to pass the credentials dynamically to a webservice. The webservice is setup for windows authentication and the browser is IE8.
0
Comment
Question by:EntAppDevTeam
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
13 Comments
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 37841064
Try the code mentioned here.
http://www.ureader.com/msg/16721933.aspx
<script language=javascript>   
  function getNTUsername(){
  
var wshNetwork = new ActiveXObject("WScript.Network");   
        alert('domain ='+   wshNetwork.UserDomain);   
        alert('machine name = '+   wshNetwork.ComputerName);   
        alert('user name = '+   wshNetwork.UserName);
        document.getElementById('username').value = wshNetwork.UserName;
        document.getElementById('UsernameDiv').innerHTML = 
wshNetwork.UserName;
  }
</script>   

Open in new window


However your HTML has to be saved with extension .hta and has to be loaded from hard disk
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 37841301
mplungjan, just for curiosity: how would a local stored .hta file be loaded/used by a page send from anywhere without violating the SOP?
(sorry for the silly question, as I'm no IE and M$ guru ;-)
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 37841313
You will need to "save/open" it from the web or copy it to your intranet users if that is what you need.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 51

Assisted Solution

by:ahoffmann
ahoffmann earned 1000 total points
ID: 37841321
hmm, let's see if the author ask for an intranet solution which requires IE policies set to ignore any security ...
0
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 1000 total points
ID: 37841326
If not, then the answer is: not possible
0
 

Author Comment

by:EntAppDevTeam
ID: 37843327
This won't work.  At best, the user will be prompted to allow on every page load. Check it out http://forums.asp.net/t/1124769.aspx
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 37843387
question answered, isn't it?
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 37843846
hmm, mplungjan helped answering too, IMHO ...
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 37844158
I believe I did.

What you are trying to do is a security risk, hence it only works on the lowest security level - that is when the user started the HTA him/herself

this cannot be done from a web page from a web server
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 37844508
@all: I fully agree with mplungjan's comments and helped to point out the limits
sorry for beining a bit short in my comments, but mplungjan got them all:)
0

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question