public InitiateSessionResponse InitiateSession(InitiateSessionRequest request)
        {
            bool ok = Membership.ValidateUser(request.UserName, request.Password);
            if (ok)
            {
                Guid tokenId = Guid.NewGuid();
                var token = new SessionToken(tokenId.ToString(), Platform.Time + ServerPlatform.WebSessionTimeout);
                string[] authority = Roles.GetRolesForUser(request.UserName);
                string displayName = request.UserName;

#if STANDALONE
                var list = new List<string>();
                list.AddRange(authority);
                list.Add(Enterprise.Authentication.AuthorityTokens.Study.ViewImages);
                list.Add("Viewer/Visible");
                list.Add("Viewer/Clinical");
                authority = list.ToArray();
#endif

                var rsp = new InitiateSessionResponse(token, authority, new Guid[0], displayName,string.Empty);

                SessionTokenManager.Instance.AddSession(token);

                return rsp;
            }
            throw new FaultException<UserAccessDeniedException>(new UserAccessDeniedException());
        }
Exemplo n.º 2
0
        public InitiateSessionResponse InitiateSession(InitiateSessionRequest request)
        {
            bool ok = Membership.ValidateUser(request.UserName, request.Password);
            if (ok)
            {
                Guid tokenId = Guid.NewGuid();
                var token = new SessionToken(tokenId.ToString(), Platform.Time + ServerPlatform.WebSessionTimeout);
                string[] authority = Roles.GetRolesForUser(request.UserName);
                string displayName = request.UserName;

                var rsp = new InitiateSessionResponse(token, authority, new Guid[0], displayName,string.Empty);

                SessionTokenManager.Instance.AddSession(token);

                return rsp;
            }
            throw new FaultException<UserAccessDeniedException>(new UserAccessDeniedException());
        }