RMS SDK for C++  0.2.1
A client library for using Microsoft RMS from Linux.
Constants.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 CONSTANTS
10 #define CONSTANTS
11 #include "types.h"
12 
13 namespace rmsauth {
14 
15 struct Constants
16 {
17  struct RmsauthError {
21  const String Unknown = "unknown_error";
22 
26  const String InvalidArgument = "invalid_argument";
27 
31  const String AuthenticationFailed = "authentication_failed";
32 
36  const String AuthenticationCanceled = "authentication_canceled";
37 
41  const String UnauthorizedResponseExpected = "unauthorized_response_expected";
42 
46  const String AuthorityNotInValidList = "authority_not_in_valid_list";
47 
51  const String AuthorityValidationFailed = "authority_validation_failed";
52 
56  const String AssemblyLoadFailed = "assembly_load_failed";
57 
61  const String InvalidOwnerWindowType = "invalid_owner_window_type";
62 
66  const String MultipleTokensMatched = "multiple_matching_tokens_detected";
67 
71  const String InvalidAuthorityType = "invalid_authority_type";
72 
76  const String InvalidCredentialType = "invalid_credential_type";
77 
81  const String InvalidServiceUrl = "invalid_service_url";
82 
86  const String FailedToAcquireTokenSilently = "failed_to_acquire_token_silently";
87 
91  const String CertificateKeySizeTooSmall = "certificate_key_size_too_small";
92 
96  const String IdentityProtocolLoginUrlNull = "identity_protocol_login_url_null";
97 
101  const String IdentityProtocolMismatch = "identity_protocol_mismatch";
102 
106  const String EmailAddressSuffixMismatch = "email_address_suffix_mismatch";
107 
111  const String IdentityProviderRequestFailed = "identity_provider_request_failed";
112 
116  const String StsTokenRequestFailed = "sts_token_request_failed";
117 
121  const String EncodedTokenTooLong = "encoded_token_too_long";
122 
126  const String ServiceUnavailable = "service_unavailable";
127 
131  const String ServiceReturnedError = "service_returned_error";
132 
136  const String FederatedServiceReturnedError = "federated_service_returned_error";
137 
141  const String StsMetadataRequestFailed = "sts_metadata_request_failed";
142 
146  const String NoDataFromSts = "no_data_from_sts";
147 
151  const String UserMismatch = "user_mismatch";
152 
156  const String UnknownUserType = "unknown_user_type";
157 
161  const String UnknownUser = "unknown_user";
162 
166  const String UserRealmDiscoveryFailed = "user_realm_discovery_failed";
167 
171  const String AccessingWsMetadataExchangeFailed = "accessing_ws_metadata_exchange_failed";
172 
176  const String ParsingWsMetadataExchangeFailed = "parsing_ws_metadata_exchange_failed";
177 
181  const String WsTrustEndpointNotFoundInMetadataDocument = "wstrust_endpoint_not_found";
182 
186  const String ParsingWsTrustResponseFailed = "parsing_wstrust_response_failed";
187 
191  const String NetworkNotAvailable = "network_not_available";
192 
196  const String AuthenticationUiFailed = "authentication_ui_failed";
197 
205  const String UserInteractionRequired = "user_interaction_required";
206 
210  const String PasswordRequiredForManagedUserError = "password_required_for_managed_user";
211 
215  const String GetUserNameFailed = "get_user_name_failed";
216 
220  const String MissingFederationMetadataUrl = "missing_federation_metadata_url";
221 
225  const String FailedToRefreshToken = "failed_to_refresh_token";
226 
230  const String IntegratedAuthFailed = "integrated_authentication_failed";
231 
235  const String DuplicateQueryParameter = "duplicate_query_parameter";
236  };
237 
238  static const RmsauthError& rmsauthError()
239  {
240  static const RmsauthError rmsauthError{};
241  return rmsauthError;
242  }
243 
245  const String AccessingMetadataDocumentFailed = "Accessing WS metadata exchange failed";
246  const String AssemblyLoadFailedTemplate = "Loading an assembly required for interactive user authentication failed. Make sure assembly '%' exists";
247  const String AuthenticationUiFailed = "The browser based authentication dialog failed to complete";
248  const String AuthorityInvalidUriFormat = "'authority' should be in Uri format";
249  const String AuthorityNotInValidList = "'authority' is not in the list of valid addresses";
250  const String AuthorityValidationFailed = "Authority validation failed";
251  const String AuthorityUriInsecure = "'authority' should use the 'https' scheme";
252  const String AuthorityUriInvalidPath = "'authority' Uri should have at least one segment in the path (i.e. https://<host>/<path>/...)";
253  const String AuthorizationServerInvalidResponse = "The authorization server returned an invalid response";
254  const String CertificateKeySizeTooSmallTemplate = "The certificate used must have a key size of at least % bits";
255  const String EmailAddressSuffixMismatch = "No identity provider email address suffix matches the provided address";
256  const String EncodedTokenTooLong = "Encoded token size is beyond the upper limit";
257  const String FailedToAcquireTokenSilently = "Failed to acquire token silently. Call method AcquireToken";
258  const String FailedToRefreshToken = "Failed to refresh token";
259  const String FederatedServiceReturnedErrorTemplate = "Federated serviced at % returned error: %";
260  const String IdentityProtocolLoginUrlNull = "The LoginUrl property in identityProvider cannot be null";
261  const String IdentityProtocolMismatch = "No identity provider matches the requested protocol";
262  const String IdentityProviderRequestFailed = "Token request to identity provider failed. Check InnerException for more details";
263  const String InvalidArgumentLength = "Parameter has invalid length";
264  const String InvalidAuthenticateHeaderFormat = "Invalid authenticate header format";
265  const String InvalidAuthorityTypeTemplate = "This method overload is not supported by ";
266  const String InvalidCredentialType = "Invalid credential type";
267  const String InvalidFormatParameterTemplate = "Parameter '%' has invalid format";
268  const String InvalidTokenCacheKeyFormat = "Invalid token cache key format";
269  const String MissingAuthenticateHeader = "WWW-Authenticate header was expected in the response";
270  const String MultipleTokensMatched = "The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements (e.g. UserId)";
271  const String NetworkIsNotAvailable = "The network is down so authentication cannot proceed";
272  const String NoDataFromSTS = "No data received from security token service";
273  const String NullParameterTemplate = "Parameter '%' cannot be null";
274  const String ParsingMetadataDocumentFailed = "Parsing WS metadata exchange failed";
275  const String ParsingWsTrustResponseFailed = "Parsing WS-Trust response failed";
276  const String PasswordRequiredForManagedUserError = "Password is required for managed user";
277  const String RedirectUriContainsFragment = "'redirectUri' must NOT include a fragment component";
278  const String ServiceReturnedError = "Serviced returned error. Check InnerException for more details";
279  const String StsMetadataRequestFailed = "Metadata request to Access Control service failed. Check InnerException for more details";
280  const String StsTokenRequestFailed = "Token request to security token service failed. Check InnerException for more details";
281  const String UnauthorizedHttpStatusCodeExpected = "Unauthorized Http Status Code (401) was expected in the response";
282  const String UnauthorizedResponseExpected = "Unauthorized http response (status code 401) was expected";
283  const String UnexpectedAuthorityValidList = "Unexpected list of valid addresses";
284  const String Unknown = "Unknown error";
285  const String UnknownUser = "Could not identify logged in user";
286  const String UnknownUserType = "Unknown User Type";
287  const String UnsupportedAuthorityValidation = "Authority validation is not supported for this type of authority";
288  const String UnsupportedMultiRefreshToken = "This authority does not support refresh token for multiple resources. Pass null as a resource";
289  const String AuthenticationCanceled = "User canceled authentication";
290  const String UserMismatch = "User '%' returned by service does not match user '%' in the request";
291  const String UserCredentialAssertionTypeEmpty = "credential.AssertionType cannot be empty";
292  const String UserInteractionRequired =
293  "One of two conditions was encountered: "\
294  "1. The PromptBehavior.Never flag was passed, but the constraint could not be honored, because user interaction was required. "\
295  "2. An error occurred during a silent web authentication that prevented the http authentication flow from completing in a short enough time frame";
296  const String UserRealmDiscoveryFailed = "User realm discovery failed";
297  const String WsTrustEndpointNotFoundInMetadataDocument = "WS-Trust endpoint not found in metadata document";
298  const String GetUserNameFailed = "Failed to get user name";
299  const String MissingFederationMetadataUrl = "Federation Metadata Url is missing for federated user. This user type is unsupported.";
300  const String SpecifyAnyUser = "If you do not need access token for any specific user, pass userId=UserIdentifier::anyUser() instead of userId=null.";
301  const String IntegratedAuthFailed = "Integrated authentication failed. You may try an alternative authentication method";
302  const String DuplicateQueryParameterTemplate = "Duplicate query parameter '%' in extraQueryParameters";
303  };
304 
305  static const RmsauthErrorMessage& rmsauthErrorMessage()
306  {
307  static const RmsauthErrorMessage rmsauthErrorMessage{};
308  return rmsauthErrorMessage;
309  }
310 
315  const String Product = "x-client-SKU";
316  const String ProductVal = "RMSAuth";
317 
321  const String Version = "x-client-Ver";
322  const String VersionVal = "0.1";
323 
327  const String CpuPlatform = "x-client-CPU";
328 
332  const String OS = "x-client-OS";
333 
337  const String UserAgent = "x-client-DM";
338 
339  const String DeviceModel = "RMSAuth";
340  };
341 
342  static const RmsauthIdParameter& rmsauthIdParameter()
343  {
344  static const RmsauthIdParameter rmsauthIdParameter{};
345  return rmsauthIdParameter;
346  }
347 };
348 
349 } // namespace rmsauth {
350 
351 #endif // CONSTANTS
352 
const String FailedToAcquireTokenSilently
failed_to_acquire_token_silently.
Definition: Constants.h:86
const String InvalidOwnerWindowType
Loading required assembly failed.
Definition: Constants.h:61
const String AssemblyLoadFailed
Loading required assembly failed.
Definition: Constants.h:56
const String StsTokenRequestFailed
STS token request failed.
Definition: Constants.h:116
const String UnknownUserType
Unknown User Type.
Definition: Constants.h:156
const String WsTrustEndpointNotFoundInMetadataDocument
WS-Trust Endpoint Not Found in Metadata Document.
Definition: Constants.h:181
Definition: Constants.h:311
const String DuplicateQueryParameter
Duplicate query parameter in extraQueryParameters
Definition: Constants.h:235
const String UserRealmDiscoveryFailed
User Realm Discovery Failed.
Definition: Constants.h:166
const String MultipleTokensMatched
MultipleTokensMatched were matched.
Definition: Constants.h:66
Definition: Constants.h:15
const String UserInteractionRequired
One of two conditions was encountered.
Definition: Constants.h:205
const String MissingFederationMetadataUrl
Federation Metadata Url is missing for federated user.
Definition: Constants.h:220
const String ServiceReturnedError
Service returned error.
Definition: Constants.h:131
const String AuthenticationUiFailed
The request could not be preformed because of an unknown failure in the UI flow.
Definition: Constants.h:196
const String AuthorityNotInValidList
'authority' is not in the list of valid addresses.
Definition: Constants.h:46
const String PasswordRequiredForManagedUserError
Password is required for managed user.
Definition: Constants.h:210
const String AuthenticationCanceled
Authentication canceled.
Definition: Constants.h:36
const String InvalidArgument
Invalid argument.
Definition: Constants.h:26
const String IdentityProtocolLoginUrlNull
Identity protocol login URL Null.
Definition: Constants.h:96
const String CpuPlatform
CPU platform with x86, x64 or ARM as value
Definition: Constants.h:327
const String InvalidCredentialType
Invalid credential type.
Definition: Constants.h:76
const String ServiceUnavailable
Service unavailable.
Definition: Constants.h:126
const String StsMetadataRequestFailed
STS metadata request failed.
Definition: Constants.h:141
const String IdentityProtocolMismatch
Identity protocol mismatch.
Definition: Constants.h:101
const String EncodedTokenTooLong
Encoded token too long.
Definition: Constants.h:121
const String InvalidAuthorityType
Invalid authority type.
Definition: Constants.h:71
const String OS
Version of the operating system. This will not be sent on WinRT
Definition: Constants.h:332
const String AuthenticationFailed
Authentication failed.
Definition: Constants.h:31
const String ParsingWsTrustResponseFailed
Parsing WS-Trust Response Failed.
Definition: Constants.h:186
const String InvalidServiceUrl
Invalid service URL.
Definition: Constants.h:81
const String UserMismatch
User Mismatch.
Definition: Constants.h:151
const String AccessingWsMetadataExchangeFailed
Accessing WS Metadata Exchange Failed.
Definition: Constants.h:171
const String Unknown
Unknown error.
Definition: Constants.h:21
Definition: Constants.h:244
Definition: AcquireTokenForClientHandler.h:14
const String AuthorityValidationFailed
Authority validation failed.
Definition: Constants.h:51
const String NoDataFromSts
No data from STS.
Definition: Constants.h:146
const String IntegratedAuthFailed
Integrated authentication failed. You may try an alternative authentication method.
Definition: Constants.h:230
const String UnauthorizedResponseExpected
Unauthorized response expected from resource server.
Definition: Constants.h:41
const String Product
RMSAUTH Flavor
Definition: Constants.h:315
const String Version
RMSAUTH assembly version
Definition: Constants.h:321
const String FailedToRefreshToken
Failed to refresh token.
Definition: Constants.h:225
const String UserAgent
Device model. This will not be sent on .NET
Definition: Constants.h:337
const String EmailAddressSuffixMismatch
Email address suffix mismatch.
Definition: Constants.h:106
const String ParsingWsMetadataExchangeFailed
Parsing WS Metadata Exchange Failed.
Definition: Constants.h:176
const String UnknownUser
Unknown User.
Definition: Constants.h:161
const String FederatedServiceReturnedError
Federated service returned error.
Definition: Constants.h:136
const String GetUserNameFailed
Failed to get user name.
Definition: Constants.h:215
const String NetworkNotAvailable
The request could not be preformed because the network is down.
Definition: Constants.h:191
Definition: Constants.h:17
const String IdentityProviderRequestFailed
Identity provider request failed.
Definition: Constants.h:111
const String CertificateKeySizeTooSmall
Certificate key size too small.
Definition: Constants.h:91