using System;
using System.Web;
using System.Collections;
using System.Configuration;
using System.Security.Cryptography;
using System.Web.Services;
using System.Web.Services.Protocols;

using BusinessBLL.Security;

/// <summary>
/// LoginService の概要の説明です
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class LoginService : System.Web.Services.WebService
{

    public LoginService()
    {

        //デザインされたコンポーネントを使用する場合、次の行をコメントを解除してください 
        //InitializeComponent(); 
    }

    [WebMethod]
    public LoginInformation GetTicket(string id, string password, string userData)
    {
        LoginInformation information;
        if (password == "Password")
        {
            information.Name = id;
            information.IssueDate = DateTime.Now;
            information.Expiration = DateTime.MaxValue;
            information.Roles = null;
            information.UserData = userData;
        }
        else
        {
            information.Name = null;
            information.IssueDate = DateTime.MinValue;
            information.Expiration = DateTime.MinValue;
            information.Roles = null;
            information.UserData = userData;
        }
        return information;
    }
}
