Exemple #1
0
        /// <summary>
        /// Gets a logged in user with a specified identity.
        /// </summary>
        /// <returns>A user instance if a logged in user with that id exists, <c>null</c> otherwise.</returns>
        /// <param name="identity">The identity of the user.</param>
        /// <param name="serverUri">The URI of the server that the user is authenticated against.</param>
        public static User GetLoggedInUser(string identity, Uri serverUri)
        {
            SharedRealmHandleExtensions.DoInitialFileSystemConfiguration();

            if (SyncUserHandle.TryGetLoggedInUser(identity, serverUri.AbsoluteUri, out var userHandle))
            {
                return(new User(userHandle));
            }

            return(null);
        }
Exemple #2
0
        public static User GetLoggedInUser(string identity, Uri serverUri)
        {
            Argument.NotNull(identity, nameof(identity));
            Argument.NotNull(serverUri, nameof(serverUri));

            SharedRealmHandleExtensions.DoInitialMetadataConfiguration();

            if (SyncUserHandle.TryGetLoggedInUser(identity, serverUri.AbsoluteUri, out var userHandle))
            {
                return(new User(userHandle));
            }

            return(null);
        }