Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Automatically logging into another application
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01076697
Message ID:
01076713
Vues:
25
>I am working on a ASP.NET application where the user needs to be logged into a completely separate Internet application outside the company. Apparently, the separate application requires you to fill in a hidden form with username, password, etc., then POST to their login page.
>
>I have never done anything like this before, so I'm unsure how to do it. Can you create a hidden form within your ASP.NET page, then use JavaScript to post the form? Is there a better way?

Yes, this is a simple process. You would do it as if you would do it in a HTML page. When you build a HTML page having a form, there is no need to have absolutely visible fields. You can have hidden fields only, which could serve for such a purpose. So, once the form is defined with a form name, you can gain access to it by the use of javascript, for example. So, you can have something like this in the page:
<SCRIPT>
function PostForm(tcUsername,tcPassword)
{
   document.Login.Username.value=tcUsername
   document.Login.Password.value=tcPassword
   document.Login.submit()
}
</SCRIPT>
This would assume the page you access has a form named Login. Otherwise, simply adjust it to the proper name. Then, to call it, simply do the proper code in your ASP.NET page to execute a javascript function such as:
javascript:PostForm("MyUsername","MyPassword")
This does not do entirely what you need but it should provide you a basic idea of the functionality you need to implement. Based on what you said, you would probably do something like this in the background in order to have it properly authenticated.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform