public GetPersonalProfile ( ) : |
||
Результат |
/// <summary> /// Create a MeshClient for the specified portal and request the specified /// account. /// </summary> /// <param name="Portal">Mesh Portal.</param> /// <param name="Account">Mesh Account.</param> /// <returns>UDF of the personal profile.</returns> public string GetAccount (string Portal, string Account) { // Attempt to connect to portal and connect to account. this.Portal = Portal; this.AccountName = Account; MeshClient = new MeshClient(Portal, AccountID); SignedPersonalProfile = MeshClient.GetPersonalProfile(); if (SignedPersonalProfile == null) return null; return SignedPersonalProfile.UDF; }
/// <summary> /// Attempt to complete the connection /// </summary> /// <returns></returns> public bool CompleteConnect () { var Connected = MeshClient.ConnectStatus(DevProfile.UDF); // Success? // Pull the new profile from the mesh. MeshClient = new MeshClient(Portal, AccountID); SignedPersonalProfile = MeshClient.GetPersonalProfile(); // extract the personal profile var PersonalProfile = SignedPersonalProfile.Signed; PersonalProfile.SignedDeviceProfile = DevProfile; // extract the mail profile(s) foreach (var AppProfile in PersonalProfile.Applications) { if (AppProfile.Type == "MailProfile") { InstallMail(PersonalProfile, AppProfile.Identifier); } } // Create WLM accounts. return true; }
public void MeshStoreAPI() { if (DoLocal) { File.Delete(Store); File.Delete(Portal); MeshPortal.Default = new MeshPortalDirect(Store, Portal); } else { JPCProvider.LocalLoopback = false; var Portal = new MeshPortalRemote(); MeshPortal.Default = Portal; } MeshClient1 = new MeshClient(Service); var valid = MeshClient1.Validate(AccountID); if (!valid.Status.StatusSuccess()) { Console.WriteLine("Validate failed"); } var DevProfile = new SignedDeviceProfile(Device1, Device1Description); var UserProfile = new PersonalProfile(DevProfile); var SignedProfile = UserProfile.Signed; MeshClient1.CreatePersonalProfile(AccountID, SignedProfile); // Create a password profile //var PasswordProfile = new PasswordProfile(UserProfile); //var SignedPasswordProfile = PasswordProfile.Signed; //SignedProfile = UserProfile.Signed; //MeshClient1.Publish(SignedPasswordProfile); //MeshClient1.Publish(SignedProfile); MeshClient2 = new MeshClient(Service, AccountID); MeshClient2.SignedDeviceProfile = DevProfile; MeshClient2.GetPersonalProfile(); // Read back the password profile and add entry var AccountPasswordProfile = MeshClient2.GetPasswordProfile(); AccountPasswordProfile.Add(PWDSite, PWDUser, PWDPassword); var AccountSignedPassword = AccountPasswordProfile.Signed; // Publish updates to both profiles. MeshClient2.Publish(AccountSignedPassword); // Create a new device profile. var DevProfile2 = new SignedDeviceProfile(Device2, Device2Description); MeshClient3 = new MeshClient(Service, AccountID); MeshClient3.ConnectRequest(DevProfile2); MeshClient2.ConnectStatus(DevProfile2.UniqueID); var PendingResponse = MeshClient1.ConnectPending(); foreach (var Request in PendingResponse.Pending) { MeshClient1.ConnectClose(Request, ConnectionStatus.Accepted); } MeshClient3.ConnectStatus(DevProfile2.UniqueID); MeshClient3.GetPasswordProfile(); }