Line data Source code
1 : #region Copyright
2 : // // -----------------------------------------------------------------------
3 : // // <copyright company="Chinchilla Software Limited">
4 : // // Copyright Chinchilla Software Limited. All rights reserved.
5 : // // </copyright>
6 : // // -----------------------------------------------------------------------
7 : #endregion
8 :
9 : using System;
10 : using System.ComponentModel.DataAnnotations;
11 : using System.Runtime.Serialization;
12 : using Cqrs.MongoDB.Entities;
13 : using Cqrs.Authentication;
14 :
15 : namespace Cqrs.MongoDB.Repositories.Authentication
16 : {
17 : /// <summary>
18 : /// An <see cref="ISingleSignOnToken"/> designed to work with MongoDB.
19 : /// </summary>
20 : [Serializable]
21 : [DataContract]
22 : public class SingleSignOnToken : MongoEntity, ISingleSignOnToken
23 1 : {
24 : /// <summary>
25 : /// The authentication token.
26 : /// </summary>
27 : [Required]
28 : [DataMember]
29 : public string Token { get; set; }
30 :
31 : /// <summary>
32 : /// The <see cref="DateTime"/> this token should expire.
33 : /// </summary>
34 : [Required]
35 : [DataMember]
36 : public DateTime TimeOfExpiry { get; set; }
37 :
38 : /// <summary>
39 : /// The <see cref="DateTime"/> this token was issued.
40 : /// </summary>
41 : [Required]
42 : [DataMember]
43 : public DateTime DateIssued { get; set; }
44 :
45 : /// <summary>
46 : /// Returns <see cref="Token"/>.
47 : /// </summary>
48 : /// <returns><see cref="Token"/>.</returns>
49 1 : public string Serialise()
50 : {
51 : return Token;
52 : }
53 : }
54 : }
|