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 :
13 : namespace Cqrs.Authentication
14 : {
15 : /// <summary>
16 : /// This is a <see cref="ISingleSignOnTokenWithCompanyRsn"/> and <see cref="ISingleSignOnTokenWithUserRsn"/>
17 : /// </summary>
18 : public class SingleSignOnTokenWithUserRsnAndCompanyRsn : SingleSignOnToken, ISingleSignOnTokenWithUserRsnAndCompanyRsn
19 1 : {
20 : /// <summary>
21 : /// The Rsn of the company the user doing the operation is operating on.
22 : /// When used in a system where a single user can have access to multiple companies, this is not the company the user belongs to, but the company it is operating on.
23 : /// When used by an external 3rd party this is the all in context of the person being impersonated, not the 3rd party system itself.
24 : /// </summary>
25 : [Required]
26 : [DataMember]
27 : public Guid CompanyRsn { get; set; }
28 :
29 : /// <summary>
30 : /// The Rsn of the user doing the operation. When used by an external 3rd party this is the person being impersonated, not the 3rd party system itself.
31 : /// </summary>
32 : [Required]
33 : [DataMember]
34 : public Guid UserRsn { get; set; }
35 :
36 : /// <summary>
37 : /// Returns <see cref="CompanyRsn"/> and <see cref="UserRsn"/>.
38 : /// </summary>
39 : /// <returns><see cref="CompanyRsn"/> and <see cref="UserRsn"/>.</returns>
40 1 : public override string Serialise()
41 : {
42 : return string.Format("{0:N}/{1:N}", CompanyRsn, UserRsn);
43 : }
44 : }
45 : }
|