2015-07-23 6 views
0

Je développe une application MVC4 et je veux authentifier mon application en utilisant windows live id. J'ai développé une page où je peux inviter des utilisateurs, donc je veux vérifier si l'identifiant d'email de l'utilisateur est Windows Live ID ou non?Vérifiez si l'identifiant d'email est windows live id ou non

J'ai essayé différentes choses, mais elles ne font que valider si l'identifiant d'email est un identifiant gmail ou non.

J'ai essayé le code ci-dessous. mais il fonctionne pour Gmail, pas pour Windows ID en direct

  TcpClient tClient = new TcpClient("gmail-smtp-in.l.google.com", 25); 
      string CRLF = "\r\n"; 
      byte[] dataBuffer; 
      string ResponseString; 
      NetworkStream netStream = tClient.GetStream(); 
      StreamReader reader = new StreamReader(netStream); 
      ResponseString = reader.ReadLine(); 
      /* Perform HELO to SMTP Server and get Response */ 
      dataBuffer = BytesFromString("HELO KirtanHere" + CRLF); 
      netStream.Write(dataBuffer, 0, dataBuffer.Length); 
      ResponseString = reader.ReadLine(); 
      dataBuffer = BytesFromString("MAIL FROM:<[email protected]>" + CRLF); 
      netStream.Write(dataBuffer, 0, dataBuffer.Length); 
      ResponseString = reader.ReadLine(); 
      /* Read Response of the RCPT TO Message to know from google if it exist or not */ 
      dataBuffer = BytesFromString("RCPT TO:<" + email.Trim() + ">" + CRLF); 
      netStream.Write(dataBuffer, 0, dataBuffer.Length); 
      ResponseString = reader.ReadLine(); 
      if (GetResponseCode(ResponseString) == 550) 
      { 
       IsExist = false; 
       //Response.Write("Mai Address Does not Exist !<br/><br/>"); 
       //Response.Write("<B><font color='red'>Original Error from Smtp Server :</font></b>" + ResponseString); 
      } 
      /* QUITE CONNECTION */ 
      dataBuffer = BytesFromString("QUITE" + CRLF); 
      netStream.Write(dataBuffer, 0, dataBuffer.Length); 
      tClient.Close(); 

Y at-il un autre moyen que je peux y parvenir?

Répondre

0

Cela dépend de la façon dont vous choisissez d'authentifier vos utilisateurs. Si vous utilisez des applications Microsoft 2.0 pour l'authentification, un compte en direct a une réclamation "tid" de "" 9188040d-6c67-4c5b-b112-36a304b66dad "alors que les comptes professionnels ou scolaires ont des revendications 'tid' uniques

Vous pouvez également voir cette question pour plus d'informations: How to determine if an email address is a Microsoft 'Work or School' account or a Microsoft Account