示例#1
0
        public HttpResponseMessage Auth(string uporabnikID)
        {
            AuthServiceClient authService = new AuthServiceClient();

            DAuth dAuth = authService.GetSession(uporabnikID);

            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, dAuth);

            return(response);
        }
示例#2
0
        //Create new session and return session token
        public static DAuth CreateSession(string userNameOrRIFID)
        {
            DAuth auth = new DAuth()
            {
                SessionAuthToken = "invalid username in domain",
                IsUserValidInAD  = false
            };

            if (ValidateUserOrRIFID(userNameOrRIFID))
            {
                auth.SessionAuthToken = GetNewSessionToken(userNameOrRIFID);
                auth.IsUserValidInAD  = true;
            }
            ;

            return(auth);
        }