c # – LDAP authentication service. Pass UPN with password

We have a bunch of projects where users connect with UPN. Several UPN suffixes are available:


We want to allow users to choose the upn suffix in a drop-down list so they do not type it all by themselves.

I've added an authentication service interface (the implementation uses the Novel dependency):

public interface ILdapAuthenticationService {
bool Authenticate (UserPrincipalName userPrincipalName, password of the string);

And the UserPrincipalName The class is as follows:

Public class UserPrincipalName {

public UserPrincipalName (string user name, string upnSuffix)
if (string.IsNullOrWhiteSpace (user name)) {
launch a new System.ArgumentNullException exception (paramName: "username");

if (string.IsNullOrWhiteSpace (upnSuffix)) {
throws a new System.ArgumentNullException exception (paramName: "upnSuffix");

this.Username = user name;
this.UpnSuffix = upnSuffix;
this.Name = $ "{username} @ {upnSuffix}";

public string Username {get; }
public channel UpnSuffix {get; }
public string Name {get; }

public override string ToString () => this.Name;


S & # 39; identify the action will accept LoginViewModel:

Public class LoginViewModel {

    public string Username {get; together; }

    public string Password {get; together; }

    public channel UpnSuffix {get; together; }


Am I over complicating things and passing the user name to the authentication service because a simple string is enough?