Exemplo n.º 1
0
        public static bool AddChildIdentity(string ParentLRI, string username, string ChildUserLRI, string passwordhash, string ChildPinHash, string KeyFromChild, IDRequestInfo request, bool IsGroup=false)
        {
            if (RequestedIDs[request.GUID].ReservationKey == request.ReservationKey)
            {
                LRI parentParsedLRI = new LRI(ParentLRI);
                LRI childParsedLRI = new LRI(ChildUserLRI);
                UserInfo info = new UserInfo();
                info.Identity.DomainLRI = DomainLRI;
                info.Identity.OwnerDomainLRI = DomainLRI;
                info.Identity.ParentDomainLRI = parentParsedLRI.LRIDomain;
                info.Identity.ParentUserID = parentParsedLRI.DocumentID;
                info.Identity.UserID = childParsedLRI.DocumentID;
                info.Identity.Username = username;
                info.Identity.UserLRI = childParsedLRI.LRIString;
                info.passwordHash = passwordhash;
                info.pinHash = ChildPinHash;
                info.Identity.KeyForParent = KeyFromChild;
                Identities[info.Identity.UserLRI] = info;
                Usernames.Add(username);
                RequestedIDs.Remove(request.GUID);

                SaveIdentity(childParsedLRI);
                return true;
            }
            return false;
        }
Exemplo n.º 2
0
 public static void AddChildToParent(UserInfo info, string KeyFromChild, string ChildUserLRI)
 {
     ChildIdentity cident = new ChildIdentity();
     cident.ChildGeneratedKey = KeyFromChild;
     cident.ChildLRI = ChildUserLRI;
     cident.ParentLRI = info.Identity.UserLRI;
     info.Children[ChildUserLRI] = cident;
     SaveIdentity(new LRI(info.Identity.UserLRI));
 }