CSharpJSharp
Messages postés98Date d'inscriptionsamedi 17 septembre 2005StatutMembreDernière intervention24 mai 2010
-
14 nov. 2007 à 10:07
alinounet -
24 févr. 2015 à 10:58
Bonjour tout le monde;
Mon problème est de récupérer le User (Session Windows) appartenant à
un Domaine sur la machine locale. Exemple : NomDomaine\NomSession
Quand je codais mon site, il me récupèrait le nom de ma
session Windows, mais quand je l'ai publié et j'accède à mon site (localhost oubien à partir d'une autre
machine) il me récupère l'information à partir de IIS et il me retourne
ASPNET comme ceci : NomDuServeur\ASPNET
CSharpJSharp
Messages postés98Date d'inscriptionsamedi 17 septembre 2005StatutMembreDernière intervention24 mai 20101 6 mars 2008 à 08:53
Bonjour ;
Effectivement, j'ai réglé le problème mais tout se joue sur les propriétés de ton application publiée sous IIS.
Suis les étapes suivantes et tour est joué.
Tu agis comme suit :
Sous IIS --> Local computer --> Web Sites --> Default Web Site --> (Nom de l'application)
Properties --> Onglet Directory Security --> Edit Authentification and access control
Décocher : Enabled anonymous access
Pour IIS 6.0 :
Pour Authentification access
Cocher : Integrated Windows authentification
Décocher : Digest authentification for Windows domain servers
Cocher : Basic authentification (password is sent in clear text)
Décocher : .NET Passport authentification
Pour IIS 5.x :
Pour Authentification access
Décocher : Digest authentification for Windows domain servers
Décocher : Basic authentification (password is sent in clear text)
Cocher : Integrated Windows authentification
A présent, l'instruction :
String Login = Environment.UserName;
récupère la bonne information et non pas NomDuServeur\ASPNET.
olemarrec
Messages postés14Date d'inscriptionmardi 27 février 2007StatutMembreDernière intervention28 novembre 2008 6 mars 2008 à 09:50
Merci de tes indications (qui ont l'air de marcher!!!).
J'ai trouvé une autre solution sans changer les options de IIS : HttpContext.Current.User.Identity.Name;
Ceci permet bien de récupérer mon login Windows et non l'utilisateur ASPNET.
trabox
Messages postés4Date d'inscriptionmardi 3 juillet 2007StatutMembreDernière intervention 4 juillet 2008 4 juil. 2008 à 12:18
car moi je programme en ASP et je ne peux pas insérer ton code comme cela dans ma page... je dois mettre "<%......%>" !!!!!!
Mais quand je fais cela j'ai une erreur :
"Erreur de compilation Microsoft VBScripterror '800a0401'
Fin d'instruction attendue
/iisHelp/common/500-100.asp, line 11
Dim objASPError, blnErrorWritten, strServername, strServerIP, strRemoteIP Dim strMethod, lngPos, datNow, strQueryString, strURL
--------------------------------------------------------------------------^
Erreur d'exécution Microsoft VBScripterror '800a01a8'