2

I'm pretty sure it does not get it from AD, although we are using AD internally. THe issue I am having is with an app that gets the current users name with user.identity.name, and tacks on the @mycompany.com then uses it to send emails from within the app. The problem is some folks with over 20 char names are failing to send email because their name gets cut off. So I am assuming user.identity.name is grabbing the SAMAccountName. I am going to fix it by grabbing the userPrincipalName from AD, but I am hoping to verify whether or not user.identity.name gets its value from the samaccountname.

EDIT to add more info. In this particular case, it is a WinForms app running on an internal server. We use Forms Authentication to authenticate against AD (at least that is how it was explained to me ). So if user.identity.name is in fact pulling from AD in this case, is there a way to specify the UPN instead of sam account name?

BattlFrog
  • 3,370
  • 8
  • 56
  • 86

1 Answers1

1

Depend on where you are using it. In a standard (WinForms) application, it come from the OS based on who's logging in. That may have come from AD if the user is part of a domain. Or it may be just from the OS's internal list of defined users.

For a Web application, it comes from the AuthenticationProvider, which may also get it from AD, or from a database, et al.

James Curran
  • 101,701
  • 37
  • 181
  • 258