Beispiel #1
0
        /// <summary>
        /// Name: Save
        /// Description: Method to save an application
        /// </summary>
        /// <param name="tokenTracking">Application</param>
        internal void Save(TokenTracking tokenTracking)
        {
            // Define statement
            string statement = "insert into [Auth].[TokenTracking](TokenTrackingId, UserId, Token, RequestedDate)values(@TokenTrackingId, @UserId, @Token, @RequestedDate)";

            // Execute
            using (IDbConnection dbConnection = Data.DAO.GetInstance(Data.DbType.SqlServer))
            {
                // Get results
                dbConnection.Execute(statement, tokenTracking);
            }
        }
        #pragma warning restore 1998
        /// <summary>
        /// Name: ReceiveAsync
        /// Description: Method to receive async
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        #pragma warning disable 1998
        public async Task ReceiveAsync(AuthenticationTokenReceiveContext context)
        {
            /// Add header
            var allowedOrigin = context.OwinContext.Get <string>("as:clientAllowedOrigin");

            if (allowedOrigin == null)
            {
                allowedOrigin = "*";
            }
            context.OwinContext.Response.Headers.Add("Access-Control-Allow-Origin", new[] { allowedOrigin });
            // Retrive token
            TokenTracking tokenTracking = this.ITokenTrackingMgr.GetById(Guid.Parse(context.Token));

            this.ITokenTrackingMgr.Delete(tokenTracking.TokenTrackingId);
            context.DeserializeTicket(tokenTracking.Token);
        }
Beispiel #3
0
 /// <summary>
 /// Name: Save
 /// Descrpition: Method to save a token tracking
 /// </summary>
 /// <param name="tokenTracking">TokenTracking</param>
 public void Save(TokenTracking tokenTracking)
 {
     this.DAO.Save(tokenTracking);
 }