RMS SDK for C++  0.2.1
A client library for using Microsoft RMS from Linux.
Entities.h
1 /*
2  * ======================================================================
3  * Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
4  * Licensed under the MIT License.
5  * See LICENSE.md in the project root for license information.
6  * ======================================================================
7 */
8 
9 #ifndef ENTITIES_H
10 #define ENTITIES_H
11 
12 #include "types.h"
13 #include "OAuthConstants.h"
14 
15 namespace rmsauth {
16 
18 {
19  struct JsonNames {
20 
21  const String tokenType = OAuthConstants::oAuthReservedClaim().TokenType;
22  const String accessToken = OAuthConstants::oAuthReservedClaim().AccessToken;
23  const String refreshToken = OAuthConstants::oAuthReservedClaim().RefreshToken;
24  const String resource = OAuthConstants::oAuthReservedClaim().Resource;
25  const String idToken = OAuthConstants::oAuthReservedClaim().IdToken;
26  const String createdOn = OAuthConstants::oAuthReservedClaim().CreatedOn;
27  const String expiresOn = OAuthConstants::oAuthReservedClaim().ExpiresOn;
28  const String expiresIn = OAuthConstants::oAuthReservedClaim().ExpiresIn;
29  const String correlationId = "correlation_id";
30  const String error = OAuthConstants::oAuthReservedClaim().Error;
31  const String errorDescription = OAuthConstants::oAuthReservedClaim().ErrorDescription;
32  const String errorCodes = OAuthConstants::oAuthReservedClaim().ErrorCodes;
33 
34  };
35 
36  static const JsonNames& jsonNames()
37  {
38  static const JsonNames jsonNames{};
39  return jsonNames;
40  }
41 
42  String tokenType;
43  String accessToken;
44  String refreshToken;
45  String resource;
46  String idToken;
47  long createdOn;
48  long expiresOn;
49  long expiresIn;
50  String correlationId;
51 
52  String error;
53  String errorDescription;
54  IntArray errorCodes;
55 };
56 using TokenResponsePtr = ptr<TokenResponse>;
57 
58 struct IdToken
59 {
60  struct JsonNames {
61  const String objectId= OAuthConstants::idTokenClaim().ObjectId;
62  const String subject = OAuthConstants::idTokenClaim().Subject;
63  const String tenantId = OAuthConstants::idTokenClaim().TenantId;
64  const String UPN = OAuthConstants::idTokenClaim().UPN;
65  const String givenName = OAuthConstants::idTokenClaim().GivenName;
66  const String familyName = OAuthConstants::idTokenClaim().FamilyName;
67  const String email = OAuthConstants::idTokenClaim().Email;
68  const String passwordExpiration = OAuthConstants::idTokenClaim().PasswordExpiration;
69  const String passwordChangeUrl = OAuthConstants::idTokenClaim().PasswordChangeUrl;
70  const String identityProvider = OAuthConstants::idTokenClaim().IdentityProvider;
71  const String issuer = OAuthConstants::idTokenClaim().Issuer;
72  };
73 
74  static const JsonNames& jsonNames()
75  {
76  static const JsonNames jsonNames{};
77  return jsonNames;
78  }
79 
80 
81  String objectId;
82  String subject;
83  String tenantId;
84  String UPN;
85  String givenName;
86  String familyName;
87  String email;
88  long passwordExpiration;
89  String passwordChangeUrl;
90  String identityProvider;
91  String issuer;
92 };
93 using IdTokenPtr = ptr<IdToken>;
94 
96 {
97  struct JsonNames {
98  const String tenantDiscoveryEndpoint= "tenant_discovery_endpoint";
99  };
100 
101  static const JsonNames& jsonNames()
102  {
103  static const JsonNames jsonNames{};
104  return jsonNames;
105  }
106 
107 
108  String tenantDiscoveryEndpoint;
109 };
110 using InstanceDiscoveryResponsePtr = ptr<InstanceDiscoveryResponse>;
111 
113 {
114  struct JsonNames {
115  const String error = OAuthConstants::oAuthReservedClaim().Error;
116  const String errorDescription = OAuthConstants::oAuthReservedClaim().ErrorDescription;
117  const String errorCodes = OAuthConstants::oAuthReservedClaim().ErrorCodes;
118  };
119 
120  static const JsonNames& jsonNames()
121  {
122  static const JsonNames jsonNames{};
123  return jsonNames;
124  }
125 
126  String error;
127  String errorDescription;
128  IntArray errorCodes;
129 };
130 
131 using ErrorResponsePtr = ptr<ErrorResponse>;
132 
133 } // namespace rmsauth {
134 
135 #endif // ENTITIES_H
Definition: Entities.h:95
Definition: Entities.h:60
Definition: Entities.h:58
Definition: Entities.h:112
Definition: Entities.h:114
Definition: AcquireTokenForClientHandler.h:14
Definition: Entities.h:19
Definition: Entities.h:17