├── .gitignore ├── LICENSE ├── README.md ├── SecureAuth.Admin.Sdk.UnitTests └── SecureAuth.Admin.Sdk.UnitTests │ ├── App.config │ ├── Constants.cs │ ├── Properties │ └── AssemblyInfo.cs │ ├── RealmServiceTests.cs │ ├── SecureAuth.Admin.Sdk.UnitTests.csproj │ └── packages.config ├── SecureAuth.Admin.Sdk └── SecureAuth.Admin.Sdk │ ├── ApiClient.cs │ ├── ConfigService.cs │ ├── Configuration.cs │ ├── Enums.cs │ ├── HashTool.cs │ ├── HmacBasicAuthenticationHelper.cs │ ├── HmacSigningHandler.cs │ ├── IConfigService.cs │ ├── IRealmService.cs │ ├── IRealmServiceV2.cs │ ├── ISecureAuthAdminService.cs │ ├── IVersionService.cs │ ├── JsonCreationConverter.cs │ ├── JsonSerializer.cs │ ├── Models │ ├── AdaptiveAuth │ │ ├── AdaptiveAuthBase.cs │ │ ├── AdaptiveAuthUserGroupSetting.cs │ │ ├── AdaptiveAuthentication.cs │ │ ├── GeoVelocity.cs │ │ ├── IpCountrySetting.cs │ │ ├── IpReputationThreatData.cs │ │ ├── UserRisk.cs │ │ └── v2 │ │ │ ├── AdaptiveAuthentication.cs │ │ │ ├── UserRisk.cs │ │ │ └── UserRiskProvider.cs │ ├── Api │ │ └── ApiSetting.cs │ ├── AssemblyVersion.cs │ ├── Data │ │ ├── AzureDataStore.cs │ │ ├── CarrierCountry.cs │ │ ├── CyberArkVault.cs │ │ ├── Data.cs │ │ ├── DataStoreBase.cs │ │ ├── LdapDataStore.cs │ │ ├── Membership.cs │ │ ├── OracleDataStore.cs │ │ ├── Profile.cs │ │ ├── ProfileField.cs │ │ ├── RestDataStore.cs │ │ ├── SqlDataStore.cs │ │ └── WebServiceDataStore.cs │ ├── Logs │ │ ├── LogSetting.cs │ │ └── SyslogSetting.cs │ ├── MultiFactor │ │ ├── EmailSetting.cs │ │ ├── HelpDeskSetting.cs │ │ ├── HelpDeskSettings.cs │ │ ├── KnowledgeBasedSetting.cs │ │ ├── MultiFactorSetting.cs │ │ ├── Multifactor.cs │ │ ├── Oath.cs │ │ ├── PhoneBlocking.cs │ │ ├── PhoneCarrier.cs │ │ ├── PhoneSetting.cs │ │ ├── PinSetting.cs │ │ ├── PushNotification.cs │ │ └── YubiKeySettings.cs │ ├── Overview │ │ ├── Email.cs │ │ ├── Overview.cs │ │ └── Smtp.cs │ ├── PostAuth │ │ ├── CustomSetting.cs │ │ ├── ExtendedSamlAttribute.cs │ │ ├── PostAuthCookie.cs │ │ ├── PostAuthFormsAuthentication.cs │ │ ├── PostAuthMachineKey.cs │ │ ├── PostAuthentication.cs │ │ ├── RedirectBase.cs │ │ ├── SamlSetting.cs │ │ ├── SamlWsFedAttribute.cs │ │ ├── UserIdMapping.cs │ │ ├── WsFedSamlAssertion.cs │ │ ├── WsFedSetting.cs │ │ ├── WsTrustEndpoint.cs │ │ ├── WsTrustEndpointConfiguration.cs │ │ └── WsTrustRequestBlocking.cs │ ├── Realm.cs │ └── Workflow │ │ ├── BrowserProfileSetting.cs │ │ ├── CustomIdentityConsumer.cs │ │ ├── DeviceRecognitionMethod.cs │ │ ├── FbaWebService.cs │ │ ├── LoginScreen.cs │ │ ├── MobileProfileSetting.cs │ │ ├── PasswordThrottle.cs │ │ ├── ProfileSetting.cs │ │ ├── Redirect.cs │ │ ├── SessionTimeout.cs │ │ ├── TerminationPoint.cs │ │ ├── TokenPersistence.cs │ │ └── Workflow.cs │ ├── Properties │ └── AssemblyInfo.cs │ ├── RealmService.cs │ ├── RealmServiceV2.cs │ ├── Requests │ ├── AdaptiveAuthRequest.cs │ ├── AdaptiveAuthRequestV2.cs │ ├── ApiSettingRequest.cs │ ├── BaseRequest.cs │ ├── DataGlobalAuxRequest.cs │ ├── DataMembershipRequest.cs │ ├── DataProfileRequest.cs │ ├── LogSettingRequest.cs │ ├── MultifactorRequest.cs │ ├── OverviewRequest.cs │ ├── PostAuthRequest.cs │ ├── UserRiskProviderRequest.cs │ └── WorkflowRequest.cs │ ├── Responses │ ├── BaseResponse.cs │ ├── PhoneCarrierResponse.cs │ ├── RealmApiResponse.cs │ ├── RealmResponse.cs │ ├── TestConnectionResponse.cs │ └── VersionResponse.cs │ ├── SecureAuth.Admin.Sdk.csproj │ ├── SecureAuth.Admin.Sdk.sln │ ├── SecureAuthAdminService.cs │ ├── VersionService.cs │ └── packages.config ├── SecureAuth.Sdk.Examples └── SACustomAPI │ ├── LICENSE │ ├── README.md │ ├── SACustomAPI.sln │ └── SACustomAPI │ ├── App_Start │ ├── BundleConfig.cs │ ├── FilterConfig.cs │ ├── RouteConfig.cs │ ├── Startup.Auth.cs │ └── Startup.cs │ ├── Content │ ├── Images │ │ └── logo.png │ ├── Site.css │ ├── bootstrap-theme.css │ ├── bootstrap-theme.css.map │ ├── bootstrap-theme.min.css │ ├── bootstrap-theme.min.css.map │ ├── bootstrap.css │ ├── bootstrap.css.map │ ├── bootstrap.min.css │ └── bootstrap.min.css.map │ ├── Controllers │ ├── AuthorizedController.cs │ └── LoginController.cs │ ├── Global.asax │ ├── Global.asax.cs │ ├── Models │ ├── AdaptViewModel.cs │ ├── ApiJsonModel.cs │ ├── AuthenticationServiceModel.cs │ ├── AuthorizedViewModel.cs │ ├── ConfigurationModel.cs │ ├── HardstopViewModel.cs │ ├── LoginViewModel.cs │ ├── OtpViewModel.cs │ ├── Persona.cs │ └── SelectViewModel.cs │ ├── Properties │ └── AssemblyInfo.cs │ ├── SACustomAPI.csproj │ ├── Scripts │ ├── _references.js │ ├── ai.0.22.9-build00167.js │ ├── ai.0.22.9-build00167.min.js │ ├── bootstrap.js │ ├── bootstrap.min.js │ ├── jquery-3.1.0.intellisense.js │ ├── jquery-3.1.0.js │ ├── jquery-3.1.0.min.js │ ├── jquery-3.1.0.min.map │ ├── jquery-3.1.0.slim.js │ ├── jquery-3.1.0.slim.min.js │ ├── jquery-3.1.0.slim.min.map │ ├── jquery.validate-vsdoc.js │ ├── jquery.validate.js │ ├── jquery.validate.min.js │ ├── jquery.validate.unobtrusive.js │ ├── jquery.validate.unobtrusive.min.js │ ├── modernizr-2.8.3.js │ ├── respond.js │ ├── respond.matchmedia.addListener.js │ ├── respond.matchmedia.addListener.min.js │ └── respond.min.js │ ├── Utilities │ ├── ApiHelpers.cs │ ├── AuthorizeEnum.cs │ ├── Constants.cs │ ├── CustomAuthorize.cs │ └── SessionBag.cs │ ├── Views │ ├── Authorized │ │ └── Index.cshtml │ ├── Login │ │ ├── Adapt.cshtml │ │ ├── Fraud.cshtml │ │ ├── Hardstop.cshtml │ │ ├── Index.cshtml │ │ ├── Otp.cshtml │ │ └── Select.cshtml │ ├── Shared │ │ ├── EmailSelect.cshtml │ │ ├── Error.cshtml │ │ ├── HelpDeskSelect.cshtml │ │ ├── KbqEntry.cshtml │ │ ├── KbqSelect.cshtml │ │ ├── OathSelect.cshtml │ │ ├── PhoneSelect.cshtml │ │ ├── PinEntry.cshtml │ │ ├── PushCheck.cshtml │ │ ├── PushSelect.cshtml │ │ └── _Layout.cshtml │ ├── Web.config │ └── _ViewStart.cshtml │ ├── Web.Debug.config │ ├── Web.Release.config │ ├── Web.config │ ├── favicon.ico │ ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 │ └── packages.config ├── SecureAuth.Sdk.UnitTests ├── App.config ├── AuthenticationServiceTests.cs ├── BehavioralBiometricsServiceTest.cs ├── Constants.cs ├── DeviceFingerprintServiceTests.cs ├── EnvironmentAuthenticationServiceTest.cs ├── EnvironmentBehavioralBiometricsServiceTest.cs ├── EnvironmentDeviceFingerprintServiceTest.cs ├── EnvironmentGroupServiceTest.cs ├── EnvironmentUserServiceTest.cs ├── GroupServiceTest.cs ├── Properties │ └── AssemblyInfo.cs ├── SecureAuth.Sdk.UnitTests.csproj ├── SecureAuth.Sdk.UnitTests.snk └── UserServiceTests.cs ├── SecureAuth.Sdk.sln └── SecureAuth.Sdk ├── AccessHistoryService.cs ├── AdaptiveAuthService.cs ├── ApiClient.cs ├── AuthenticationService.cs ├── BehavioralBiometricsService.cs ├── Configuration.cs ├── DeviceFingerprintService.cs ├── GroupService.cs ├── HashTool.cs ├── HmacBasicAuthenticationHelper.cs ├── HmacSigningHandler.cs ├── IAccessHistoryService.cs ├── IAdaptiveAuthService.cs ├── IAuthenticationService.cs ├── IBehavioralBiometricsService.cs ├── IDeviceFingerprintService.cs ├── IGroupService.cs ├── IIpEvaluationService.cs ├── INumberProfileService.cs ├── ISecureAuthService.cs ├── IUserService.cs ├── IpEvaluationService.cs ├── JsonSerializer.cs ├── Models ├── AccessHistory.cs ├── ApiVersion.cs ├── BiometricType.cs ├── FactorDescription.cs ├── Factoring.cs ├── Fingerprint.cs ├── FingerprintWrapper.cs ├── GeoLocation.cs ├── IpEvaluation.cs ├── KbProperty.cs ├── MultiFactorOption.cs ├── NumberProfileResult.cs ├── PushAcceptDetails.cs ├── TouchSupport.cs ├── UaBrowser.cs ├── UaCpu.cs ├── UaDevice.cs ├── UaEngine.cs ├── UaOs.cs └── UserProfileProperty.cs ├── NumberProfileService.cs ├── Properties └── AssemblyInfo.cs ├── Requests ├── AccessHistoryRequest.cs ├── AdHocEmailLinkOtpRequest.cs ├── AdHocEmailOtpRequest.cs ├── AdHocPhonecallOtpRequest.cs ├── AdHocSmsLinkOtpRequest.cs ├── AdHocSmsOtpRequest.cs ├── AdaptiveAuthRequest.cs ├── BaseRequest.cs ├── ChangePasswordRequest.cs ├── ConfirmDfpRequest.cs ├── CreateUserRequest.cs ├── EmailLinkOTPRequest.cs ├── EmailOtpRequest.cs ├── GroupAssociateRequest.cs ├── HelpDeskOtpRequest.cs ├── IpRiskRequest.cs ├── NumberProfileRequest.cs ├── OathTokenRequest.cs ├── PhonecallOtpRequest.cs ├── PushAcceptRequest.cs ├── PushAcceptSymbolRequest.cs ├── PushBiometricRequest.cs ├── PushOtpRequest.cs ├── ResetBehavioralBioRequest.cs ├── ResetPasswordRequest.cs ├── SaveDfpRequest.cs ├── ScoreDfpRequest.cs ├── SendBehavioralBioRequest.cs ├── SetUserStatusRequest.cs ├── SmsLinkOTPRequest.cs ├── SmsOtpRequest.cs ├── UpdateProfileRequest.cs ├── ValidateDfpRequest.cs ├── ValidateKbaRequest.cs ├── ValidateOathRequest.cs ├── ValidateOtpRequest.cs ├── ValidatePasswordRequest.cs ├── ValidatePinRequest.cs └── ValidateUserIdRequest.cs ├── Responses ├── AdaptiveAuthResponse.cs ├── BaseResponse.cs ├── BiometricsJavascriptLinkResponse.cs ├── DfpJavascriptLinkResponse.cs ├── DfpResponse.cs ├── EmailLinkResponse.cs ├── GetFactorsResponse.cs ├── GetProfileResponse.cs ├── GroupAssociateResponse.cs ├── IpRiskResponse.cs ├── NumberProfileResponse.cs ├── OathTokenResponse.cs ├── PushAcceptResponse.cs ├── PushAcceptSymbolResponse.cs ├── PushBiometricResponse.cs ├── SendOtpResponse.cs ├── SmsLinkResponse.cs ├── ThrottleResponse.cs └── UserStatusResponse.cs ├── SecureAuth.Sdk.csproj ├── SecureAuth.Sdk.snk ├── SecureAuthService.cs └── UserService.cs /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, SecureAuth 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 5 | 6 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | 8 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | 10 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 11 | 12 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 13 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 14 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # saidp-sdk-csharp 2 | C# SDK for SecureAuth IdP API 3 | 4 | ## Usage: 5 | ```csharp 6 | // Setup the configuration object with your 7 | // SecureAuth API ID, API Key, and URL 8 | Configuration saApiConfig = new Configuration() 9 | { 10 | AppId = "af1b351845ec47968b27debd9cd4ce53", 11 | AppKey = "101db0347fdf71dab63cd965b8782ff6ba0f8f1c91e8cf52f970d1267e0fb453", 12 | SecureAuthRealmUrl = "https://company.secureauth.com/SecureAuth1/" 13 | }; 14 | 15 | // Instantiate a service object. Passing in the configuration. 16 | SecureAuthService saService = new SecureAuthService(saApiConfig); 17 | 18 | // Instantiate a request object for sending 19 | // one-time passcodes via SMS. 20 | SmsOtpRequest request = new SmsOtpRequest 21 | { 22 | UserId = "userId", 23 | FactorId = "Phone1" 24 | }; 25 | 26 | // Execute the request. Storing results into 27 | // a response object. 28 | SendOtpResponse response = saService.Authenticate.SendSmsOtp(request); 29 | 30 | ``` 31 | 32 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk.UnitTests/SecureAuth.Admin.Sdk.UnitTests/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk.UnitTests/SecureAuth.Admin.Sdk.UnitTests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | [assembly: AssemblyTitle("SecureAuth.Admin.Sdk.UnitTests")] 6 | [assembly: AssemblyDescription("")] 7 | [assembly: AssemblyConfiguration("")] 8 | [assembly: AssemblyCompany("")] 9 | [assembly: AssemblyProduct("SecureAuth.Admin.Sdk.UnitTests")] 10 | [assembly: AssemblyCopyright("Copyright © 2018")] 11 | [assembly: AssemblyTrademark("")] 12 | [assembly: AssemblyCulture("")] 13 | 14 | [assembly: ComVisible(false)] 15 | 16 | [assembly: Guid("7388f373-fc11-4c9a-8772-74736002fccf")] 17 | 18 | // [assembly: AssemblyVersion("1.0.*")] 19 | [assembly: AssemblyVersion("1.0.0.0")] 20 | [assembly: AssemblyFileVersion("1.0.0.0")] 21 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk.UnitTests/SecureAuth.Admin.Sdk.UnitTests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/ConfigService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using SecureAuth.Admin.Sdk.Models; 3 | 4 | namespace SecureAuth.Admin.Sdk 5 | { 6 | public class ConfigService : IConfigService 7 | { 8 | private readonly ApiClient _apiClient; 9 | 10 | protected internal ConfigService(ApiClient apiClient) 11 | { 12 | this._apiClient = apiClient; 13 | } 14 | 15 | 16 | /// 17 | /// Encrypt the web.config file used by the Admin API 18 | /// 19 | /// VersionResponse 20 | public BaseResponse EncryptConfig() 21 | { 22 | string endpoint = "/api/v2/config/encrypt"; ; 23 | 24 | return this._apiClient.Patch(endpoint); 25 | } 26 | 27 | /// 28 | /// Decrypt the web.config file used by the Admin API 29 | /// 30 | /// VersionResponse 31 | public BaseResponse DecryptConfig() 32 | { 33 | string endpoint = "/api/v2/config/decrypt"; ; 34 | 35 | return this._apiClient.Patch(endpoint); 36 | } 37 | 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Configuration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace SecureAuth.Admin.Sdk 4 | { 5 | public class Configuration 6 | { 7 | private string _secureAuthUrl; 8 | public string SecureAuthUrl 9 | { 10 | get { return this._secureAuthUrl; } 11 | set { this._secureAuthUrl = value.TrimEnd(new char[] {'/'}); } 12 | } 13 | 14 | public string AppId { get; set; } 15 | public string AppKey { get; set; } 16 | public bool BypassCertValidation { get; set; } 17 | 18 | public Configuration() 19 | { 20 | } 21 | 22 | public Configuration(string secureAuthUrl, string appId, string appKey, bool isDevelopment = false) 23 | { 24 | if (secureAuthUrl == null) 25 | { 26 | throw new ArgumentNullException("secureAuthUrl", "A SecureAuth URL is required."); 27 | } 28 | if (string.IsNullOrEmpty(appId)) 29 | { 30 | throw new ArgumentNullException("appId", "An application ID is required."); 31 | } 32 | if (string.IsNullOrEmpty(appKey)) 33 | { 34 | throw new ArgumentNullException("appKey", "An application key is required."); 35 | } 36 | 37 | this._secureAuthUrl = secureAuthUrl.TrimEnd(new char[] { '/' }); 38 | this.AppId = appId; 39 | this.AppKey = appKey; 40 | this.BypassCertValidation = isDevelopment; 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/HashTool.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Security.Cryptography; 3 | using System.Text; 4 | 5 | namespace SecureAuth.Admin.Sdk 6 | { 7 | internal class HashTool 8 | { 9 | internal static string SHA256HashToBase64(string key, string value) 10 | { 11 | string result = ""; 12 | var keyBytes = HexStringToByteArray(key); 13 | var valueBytes = Encoding.UTF8.GetBytes(value); 14 | 15 | using (var hmac = new HMACSHA256(keyBytes)) 16 | { 17 | var hash = hmac.ComputeHash(valueBytes); 18 | result = Convert.ToBase64String(hash); 19 | } 20 | return result; 21 | } 22 | 23 | internal static string SHA256HashToHex(string key, string value) 24 | { 25 | string result = ""; 26 | var keyBytes = HexStringToByteArray(key); 27 | var valueBytes = Encoding.UTF8.GetBytes(value); 28 | 29 | using (var hmac = new HMACSHA256(keyBytes)) 30 | { 31 | var hash = hmac.ComputeHash(valueBytes); 32 | result = BitConverter.ToString(hash).Replace("-", ""); 33 | } 34 | return result; 35 | } 36 | 37 | internal static byte[] HexStringToByteArray(String hex) 38 | { 39 | int numberChars = hex.Length; 40 | byte[] bytes = new byte[numberChars / 2]; 41 | for (int i = 0; i < numberChars; i += 2) 42 | bytes[i / 2] = Convert.ToByte(hex.Substring(i, 2), 16); 43 | return bytes; 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/HmacSigningHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net.Http; 3 | using System.Net.Http.Headers; 4 | using System.Text; 5 | using System.Threading; 6 | using System.Threading.Tasks; 7 | 8 | namespace SecureAuth.Admin.Sdk 9 | { 10 | public class HmacSigningHandler : WebRequestHandler 11 | { 12 | public string AppId { get; set; } 13 | public string AppKey { get; set; } 14 | 15 | public HmacSigningHandler() 16 | { 17 | } 18 | 19 | public HmacSigningHandler(string appId, string appKey) 20 | { 21 | AppId = appId; 22 | AppKey = appKey; 23 | } 24 | 25 | protected override Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) 26 | { 27 | request.Headers.Date = new DateTimeOffset(DateTime.Now, DateTime.Now - DateTime.UtcNow); 28 | var hash = HmacBasicAuthenticationHelper.BuildAuthorizationHeaderParameter(AppId, AppKey, request); 29 | 30 | var headerValue = Convert.ToBase64String(Encoding.UTF8.GetBytes(string.Format("{0}:{1}", AppId, hash))); 31 | var header = new AuthenticationHeaderValue("Basic", headerValue); 32 | 33 | request.Headers.Authorization = header; 34 | 35 | return base.SendAsync(request, cancellationToken); 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/IConfigService.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Admin.Sdk 2 | { 3 | public interface IConfigService 4 | { 5 | BaseResponse EncryptConfig(); 6 | BaseResponse DecryptConfig(); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/IRealmService.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Admin.Sdk 2 | { 3 | public interface IRealmService 4 | { 5 | RealmResponse GetRealm(string realmId); 6 | RealmResponse CreateRealm(); 7 | BaseResponse UpdateOverview(OverviewRequest request); 8 | BaseResponse UpdateDataMembership(DataMembershipRequest request); 9 | BaseResponse UpdateDataProfile(DataProfileRequest request); 10 | BaseResponse UpdateDataGlobalAux(DataGlobalAuxRequest request); 11 | BaseResponse UpdateWorkflow(WorkflowRequest request); 12 | BaseResponse UpdateAdaptiveAuth(AdaptiveAuthRequest request); 13 | BaseResponse UpdateMultifactor(MultifactorRequest request); 14 | BaseResponse UpdatePostAuth(PostAuthRequest request); 15 | BaseResponse UpdateLogSettings(LogSettingRequest request); 16 | BaseResponse UpdateApi(ApiSettingRequest request); 17 | RealmApiResponse GenerateApiCredentials(string realmId); 18 | PhoneCarrierResponse GetPhoneCarriers(string realmId); 19 | BaseResponse UploadCompanyLogo(OverviewRequest request); 20 | BaseResponse UploadApplicationLogo(OverviewRequest request); 21 | BaseResponse UploadEmailLogo(OverviewRequest request); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/IRealmServiceV2.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Admin.Sdk 2 | { 3 | public interface IRealmServiceV2 4 | { 5 | RealmResponse GetRealm(string realmId); 6 | RealmResponse CreateRealm(); 7 | BaseResponse UpdateOverview(OverviewRequest request); 8 | BaseResponse UpdateDataMembership(DataMembershipRequest request); 9 | BaseResponse UpdateDataProfile(DataProfileRequest request); 10 | BaseResponse UpdateDataGlobalAux(DataGlobalAuxRequest request); 11 | BaseResponse UpdateWorkflow(WorkflowRequest request); 12 | BaseResponse UpdateAdaptiveAuth(AdaptiveAuthRequestV2 request); 13 | BaseResponse UpdateMultifactor(MultifactorRequest request); 14 | BaseResponse UpdatePostAuth(PostAuthRequest request); 15 | BaseResponse UpdateLogSettings(LogSettingRequest request); 16 | BaseResponse UpdateApi(ApiSettingRequest request); 17 | RealmApiResponse GenerateApiCredentials(string realmId); 18 | PhoneCarrierResponse GetPhoneCarriers(string realmId); 19 | BaseResponse UploadCompanyLogo(OverviewRequest request); 20 | BaseResponse UploadApplicationLogo(OverviewRequest request); 21 | BaseResponse UploadEmailLogo(OverviewRequest request); 22 | TestConnectionResponse TestUserRiskProviderConnection(UserRiskProviderRequest request); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/ISecureAuthAdminService.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Admin.Sdk 2 | { 3 | public interface ISecureAuthAdminService 4 | { 5 | Configuration Configuration { get; set; } 6 | string AppId { get; set; } 7 | string AppKey { get; set; } 8 | string SecureAuthUrl { get; set; } 9 | IRealmService Realm { get; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/IVersionService.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Admin.Sdk 2 | { 3 | public interface IVersionService 4 | { 5 | VersionResponse GetVersion(); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/JsonCreationConverter.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Linq; 3 | using System; 4 | 5 | namespace SecureAuth.Admin.Sdk 6 | { 7 | /// 8 | /// Custom JSON to .NET object converter 9 | /// 10 | /// 11 | public abstract class JsonCreationConverter : JsonConverter 12 | { 13 | public override bool CanWrite 14 | { 15 | get { return false; } 16 | } 17 | 18 | protected abstract T Create(Type objectType, JObject jObject); 19 | 20 | public override bool CanConvert(Type objectType) 21 | { 22 | return typeof(T).IsAssignableFrom(objectType); 23 | } 24 | 25 | public override object ReadJson(JsonReader reader, Type objectType, object existingValue, Newtonsoft.Json.JsonSerializer serializer) 26 | { 27 | if(reader.TokenType == JsonToken.Null) 28 | { 29 | return null; 30 | } 31 | JObject jObject = JObject.Load(reader); 32 | 33 | T target = Create(objectType, jObject); 34 | 35 | serializer.Populate(jObject.CreateReader(), target); 36 | 37 | return target; 38 | } 39 | 40 | public override void WriteJson(JsonWriter writer, object value, Newtonsoft.Json.JsonSerializer serializer) 41 | { 42 | throw new NotImplementedException(); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/JsonSerializer.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace SecureAuth.Admin.Sdk 4 | { 5 | internal static class JsonSerializer 6 | { 7 | internal static string Serialize(object model) 8 | { 9 | string jsonString = JsonConvert.SerializeObject(model); 10 | 11 | return jsonString; 12 | } 13 | 14 | internal static T Deserialize(string jsonString) 15 | { 16 | T obj = JsonConvert.DeserializeObject(jsonString); 17 | 18 | return obj; 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/AdaptiveAuth/AdaptiveAuthBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Newtonsoft.Json; 3 | using Newtonsoft.Json.Linq; 4 | 5 | namespace SecureAuth.Admin.Sdk.Models 6 | { 7 | [JsonConverter(typeof(CustomAdaptiveAuthJsonConverter))] 8 | public class AdaptiveAuthBase 9 | { 10 | private class CustomAdaptiveAuthJsonConverter : JsonCreationConverter 11 | { 12 | 13 | protected override AdaptiveAuthentication Create(Type objectType, JObject jObject) 14 | { 15 | 16 | 17 | AdaptiveAuthentication adaptiveAuth = new AdaptiveAuthentication(); 18 | 19 | // Test for the version 20 | try 21 | { 22 | var version = jObject.Value("version"); 23 | if (version != null && !string.IsNullOrWhiteSpace(version)) 24 | { 25 | if (version.ToLower() == "v2") 26 | { 27 | adaptiveAuth = new Models.v2.AdaptiveAuthentication(); 28 | } 29 | } 30 | } 31 | catch (Exception ex) 32 | { 33 | 34 | } 35 | 36 | return adaptiveAuth; 37 | } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/AdaptiveAuth/AdaptiveAuthUserGroupSetting.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | using System.Collections.Generic; 4 | 5 | namespace SecureAuth.Admin.Sdk.Models 6 | { 7 | public class AdaptiveAuthUserGroupSetting 8 | { 9 | public bool? Enabled { get; set; } 10 | [JsonConverter(typeof(StringEnumConverter))] 11 | public Enums.AdaptiveAuthUserGroupRestrictionType? RestrictionType { get; set; } 12 | [JsonConverter(typeof(StringEnumConverter))] 13 | public Enums.AdaptiveAuthInListAction? InListAction { get; set; } 14 | public List UserGroupList { get; set; } 15 | [JsonConverter(typeof(StringEnumConverter))] 16 | public Enums.AdaptiveAuthAction? FailureAction { get; set; } 17 | public string FailureActionRedirect { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/AdaptiveAuth/AdaptiveAuthentication.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | using System.Collections.Generic; 4 | 5 | namespace SecureAuth.Admin.Sdk.Models 6 | { 7 | public class AdaptiveAuthentication : AdaptiveAuthBase 8 | { 9 | public IpCountrySetting IpCountrySetting { get; set; } 10 | public AdaptiveAuthUserGroupSetting UserGroupSetting { get; set; } 11 | public IpReputationThreatDataSetting IpReputationThreatData { get; set; } 12 | public GeoVelocitySetting GeoVelocity { get; set; } 13 | public UserRiskSetting UserRisk { get; set; } 14 | [JsonProperty(ItemConverterType = typeof(StringEnumConverter))] 15 | public List AnalyzeOrder { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/AdaptiveAuth/GeoVelocity.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | 4 | namespace SecureAuth.Admin.Sdk.Models 5 | { 6 | public class GeoVelocitySetting 7 | { 8 | public bool? Enabled { get; set; } 9 | public int? VelocityLimit { get; set; } 10 | [JsonConverter(typeof(StringEnumConverter))] 11 | public Enums.AdaptiveAuthAction? FailureAction { get; set; } 12 | public string FailureActionRedirect { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/AdaptiveAuth/IpCountrySetting.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | using System.Collections.Generic; 4 | 5 | namespace SecureAuth.Admin.Sdk.Models 6 | { 7 | public class IpCountrySetting 8 | { 9 | public bool? Enabled { get; set; } 10 | [JsonConverter(typeof(StringEnumConverter))] 11 | public Enums.AdaptiveAuthIpCountryRestrictionType? RestrictionType { get; set; } 12 | [JsonConverter(typeof(StringEnumConverter))] 13 | public Enums.AdaptiveAuthInListAction? InListAction { get; set; } 14 | public List IpCountryList { get; set; } 15 | [JsonConverter(typeof(StringEnumConverter))] 16 | public Enums.AdaptiveAuthAction? FailureAction { get; set; } 17 | public string FailureActionRedirect { get; set; } 18 | public bool? RequireUsernameBeforeAdaptive { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/AdaptiveAuth/IpReputationThreatData.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | 4 | namespace SecureAuth.Admin.Sdk.Models 5 | { 6 | public class IpReputationThreatDataSetting 7 | { 8 | public bool? Enabled { get; set; } 9 | [JsonConverter(typeof(StringEnumConverter))] 10 | public Enums.AdaptiveAuthAction? ExtremeRiskAction { get; set; } 11 | public string ExtremeRiskRedirect { get; set; } 12 | [JsonConverter(typeof(StringEnumConverter))] 13 | public Enums.AdaptiveAuthAction? HighRiskAction { get; set; } 14 | public string HighRiskRedirect { get; set; } 15 | [JsonConverter(typeof(StringEnumConverter))] 16 | public Enums.AdaptiveAuthAction? MediumRiskAction { get; set; } 17 | public string MediumRiskRedirect { get; set; } 18 | [JsonConverter(typeof(StringEnumConverter))] 19 | public Enums.AdaptiveAuthAction? LowRiskAction { get; set; } 20 | public string LowRiskRedirect { get; set; } 21 | public string IpWhitelist { get; set; } 22 | public bool? RequireUsernameBeforeAdaptiveAuth { get; set; } 23 | public bool? HasValidLicense { get; set; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/AdaptiveAuth/UserRisk.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | 4 | namespace SecureAuth.Admin.Sdk.Models 5 | { 6 | public class UserRiskSetting 7 | { 8 | public bool? Enabled { get; set; } 9 | public int? HighRiskFrom { get; set; } 10 | [JsonConverter(typeof(StringEnumConverter))] 11 | public Enums.AdaptiveAuthAction? HighRiskAction { get; set; } 12 | public string HighRiskRedirect { get; set; } 13 | public int? MediumRiskFrom { get; set; } 14 | [JsonConverter(typeof(StringEnumConverter))] 15 | public Enums.AdaptiveAuthAction? MediumRiskAction { get; set; } 16 | public string MediumRiskRedirect { get; set; } 17 | public int? LowRiskFrom { get; set; } 18 | [JsonConverter(typeof(StringEnumConverter))] 19 | public Enums.AdaptiveAuthAction? LowRiskAction { get; set; } 20 | public string LowRiskRedirect { get; set; } 21 | [JsonConverter(typeof(StringEnumConverter))] 22 | public Enums.AdaptiveAuthAction? NoScoreAction { get; set; } 23 | public string NoScoreRedirect { get; set; } 24 | [JsonConverter(typeof(StringEnumConverter))] 25 | public Enums.AdaptiveAuthUserRiskProfileField? ProfileField { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/AdaptiveAuth/v2/AdaptiveAuthentication.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SecureAuth.Admin.Sdk.Models.v2 8 | { 9 | public class AdaptiveAuthentication : Models.AdaptiveAuthentication 10 | { 11 | public new v2.UserRiskSetting UserRisk { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/AdaptiveAuth/v2/UserRisk.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | using System.Collections.Generic; 4 | 5 | namespace SecureAuth.Admin.Sdk.Models.v2 6 | { 7 | public class UserRiskSetting 8 | { 9 | public bool? Enabled { get; set; } 10 | public List Providers { get; set; } 11 | [JsonConverter(typeof(StringEnumConverter))] 12 | public Enums.AdaptiveAuthAction? HighRiskAction { get; set; } 13 | public string HighRiskRedirect { get; set; } 14 | [JsonConverter(typeof(StringEnumConverter))] 15 | public Enums.AdaptiveAuthAction? MediumRiskAction { get; set; } 16 | public string MediumRiskRedirect { get; set; } 17 | [JsonConverter(typeof(StringEnumConverter))] 18 | public Enums.AdaptiveAuthAction? LowRiskAction { get; set; } 19 | public string LowRiskRedirect { get; set; } 20 | [JsonConverter(typeof(StringEnumConverter))] 21 | public Enums.AdaptiveAuthAction? NoScoreAction { get; set; } 22 | public string NoScoreRedirect { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/AdaptiveAuth/v2/UserRiskProvider.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace SecureAuth.Admin.Sdk.Models.v2 3 | { 4 | public class UserRiskProvider 5 | { 6 | public string Name { get; set; } 7 | public string BaseUrl { get; set; } 8 | public string ProfileRelativeUrl { get; set; } 9 | public string AuthenticationMethod { get; set; } 10 | public string Username { get; set; } 11 | public string Password { get; set; } 12 | public string CookieUrl { get; set; } 13 | public string RequestIdField { get; set; } 14 | public string RequestJson { get; set; } 15 | public string RiskScoreJsonPath { get; set; } 16 | public int? RangeMax { get; set; } 17 | public int? RangeMin { get; set; } 18 | public int? HighRisk { get; set; } 19 | public int? MediumRisk { get; set; } 20 | public bool? DeleteProvider { get; set; } 21 | public bool? Enabled { get; set; } 22 | public bool? IsFixedConnectionSetting { get; set; } 23 | 24 | public bool ShouldSerializeDeleteProvider() 25 | { 26 | return false; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/Api/ApiSetting.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Admin.Sdk.Models 4 | { 5 | public class ApiSetting 6 | { 7 | public bool? EnableApi { get; set; } 8 | public string ApplicationId { get; set; } 9 | public string ApplicationKey { get; set; } 10 | public bool? EnableAuthenticationApi { get; set; } 11 | public bool? EnableIdentityManagementUserProperties { get; set; } 12 | public bool? EnableIdentityManagementAdminInitiatedPasswordReset { get; set; } 13 | public bool? EnableIdentityManagementUserSelfServicePasswordChange { get; set; } 14 | public bool? EnableIdentityManagementUserGroupAssociation { get; set; } 15 | public bool? EnableSecureAuthCredentialProviderApi { get; set; } 16 | public bool? EnableLoginForWindowsApi { get; set; } 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/AssemblyVersion.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Admin.Sdk.Models 2 | { 3 | public class AssemblyVersion 4 | { 5 | public string ApiAssemblyVersion { get; set; } 6 | public string ApiFileVersion { get; set; } 7 | public string ServiceAssemblyVersion { get; set; } 8 | public string ServiceFileVersion { get; set; } 9 | public string DataAssemblyVersion { get; set; } 10 | public string DataFileVersion { get; set; } 11 | public string ModelAssemblyVersion { get; set; } 12 | public string ModelFileVersion { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/Data/AzureDataStore.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Admin.Sdk.Models 2 | { 3 | public class AzureMembershipDataStore : DataStoreBase 4 | { 5 | public string UserName { get; set; } 6 | public string Password { get; set; } 7 | public string TenantDomain { get; set; } 8 | public string ClientId { get; set; } 9 | public string AllowedGroups { get; set; } 10 | public string DeniedGroups { get; set; } 11 | } 12 | 13 | public class AzureProfileDataStore : DataStoreBase 14 | { 15 | public string Username { get; set; } 16 | public string Password { get; set; } 17 | public string TenantDomain { get; set; } 18 | public string ClientId { get; set; } 19 | public string AppKey { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/Data/CarrierCountry.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace SecureAuth.Admin.Sdk.Models 4 | { 5 | public class CarrierCountry 6 | { 7 | public string CountryName { get; set; } 8 | public string CountryCode { get; set; } 9 | public List Carriers { get; set; } 10 | } 11 | 12 | public class Carrier 13 | { 14 | public string CarrierName { get; set; } 15 | public string CarrierCode { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/Data/CyberArkVault.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace SecureAuth.Admin.Sdk.Models 4 | { 5 | public class CyberArkVault 6 | { 7 | public string Username { get; set; } 8 | public string Address { get; set; } 9 | public string Safe { get; set; } 10 | public string Folder { get; set; } 11 | [JsonProperty(PropertyName = "Caobject")] 12 | public string Object { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/Data/Data.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Admin.Sdk.Models 2 | { 3 | public class Data 4 | { 5 | public Membership Membership { get; set; } 6 | public Profile Profile { get; set; } 7 | public string GlobalAux1 { get; set; } 8 | public string GlobalAux2 { get; set; } 9 | public string GlobalAux3 { get; set; } 10 | public string GlobalAux4 { get; set; } 11 | public string GlobalAux5 { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/Data/DataStoreBase.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Admin.Sdk.Models 2 | { 3 | public abstract class DataStoreBase 4 | { 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/Data/OracleDataStore.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | 4 | 5 | namespace SecureAuth.Admin.Sdk.Models 6 | { 7 | public class OracleMembershipDataStore : DataStoreBase 8 | { 9 | public string ConnectionString { get; set; } 10 | [JsonConverter(typeof(StringEnumConverter))] 11 | public Enums.OracleMembershipPasswordFormat? PasswordFormat { get; set; } 12 | public string PasswordSalt { get; set; } 13 | public string AllowedGroups { get; set; } 14 | public string DeniedGroups { get; set; } 15 | public string SprocGetUser { get; set; } 16 | public string SprocGetPassword { get; set; } 17 | public string SprocUpdateUser { get; set; } 18 | public string SprocResetPassword { get; set; } 19 | public string SprocChangePassword { get; set; } 20 | public string SprocCreateUser { get; set; } 21 | public string SprocLockUser { get; set; } 22 | public string SprocUnlockUser { get; set; } 23 | public bool? UseCyberArkVault { get; set; } 24 | public CyberArkVault CyberArkVault { get; set; } 25 | } 26 | 27 | public class OracleProfileDataStore : DataStoreBase 28 | { 29 | public string ConnectionString { get; set; } 30 | public bool? UseCyberArkVault { get; set; } 31 | public CyberArkVault CyberArkVault { get; set; } 32 | public string SprocGetProfile { get; set; } 33 | public string SprocUpdateProfile { get; set; } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/Data/Profile.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | using System.Collections.Generic; 4 | 5 | 6 | namespace SecureAuth.Admin.Sdk.Models 7 | { 8 | public class Profile 9 | { 10 | [JsonConverter(typeof(StringEnumConverter))] 11 | public Enums.ProfileProviderName? DefaultProvider { get; set; } 12 | [JsonConverter(typeof(StringEnumConverter))] 13 | public Enums.ProfileIndex? DataStoreType { get; set; } 14 | public LdapProfileDataStore LdapDataStore { get; set; } 15 | public SqlProfileDataStore SqlDataStore { get; set; } 16 | public OracleProfileDataStore OracleDataStore { get; set; } 17 | public AzureProfileDataStore AzureDataStore { get; set; } 18 | public WebServiceProfileDataStore WebServiceDataStore { get; set; } 19 | public List RestServiceDataStores { get; set; } 20 | public List ProfileFields { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/Data/ProfileField.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | 4 | 5 | namespace SecureAuth.Admin.Sdk.Models 6 | { 7 | public class ProfileField 8 | { 9 | public string PropertyName { get; set; } 10 | [JsonConverter(typeof(StringEnumConverter))] 11 | public Enums.ProfileFieldSource? Source { get; set; } 12 | public string Field { get; set; } 13 | [JsonConverter(typeof(StringEnumConverter))] 14 | public Enums.ProfileFieldDataFormat? DataFormat { get; set; } 15 | public bool? IsWritable { get; set; } 16 | public bool? DeleteField { get; set; } 17 | 18 | public bool ShouldSerializeDeleteField() 19 | { 20 | return false; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/Data/RestDataStore.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | 4 | namespace SecureAuth.Admin.Sdk.Models 5 | { 6 | public class RestServiceProfileDataStore : DataStoreBase 7 | { 8 | public string Name { get; set; } 9 | public string BaseUrl { get; set; } 10 | public string Username { get; set; } 11 | public string Password { get; set; } 12 | [JsonConverter(typeof(StringEnumConverter))] 13 | public Enums.RestServiceProfileAuthenticationMethod? AuthenticationMethod { get; set; } 14 | public string GetProfileUrl { get; set; } 15 | public string UpdateProfileUrl { get; set; } 16 | public string CookieUrl { get; set; } 17 | public bool? ClearProfile { get; set; } 18 | public bool? DeleteProvider { get; set; } 19 | 20 | public bool ShouldSerializeDeleteProvider() 21 | { 22 | return false; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/Data/SqlDataStore.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | 4 | 5 | namespace SecureAuth.Admin.Sdk.Models 6 | { 7 | public class SqlMembershipDataStore : DataStoreBase 8 | { 9 | public string ConnectionString { get; set; } 10 | public bool? UseCyberArkVault { get; set; } 11 | public CyberArkVault CyberArkVault { get; set; } 12 | [JsonConverter(typeof(StringEnumConverter))] 13 | public Enums.SqlMembershipPasswordFormat? PasswordFormat { get; set; } 14 | public string AllowedGroups { get; set; } 15 | public string DeniedGroups { get; set; } 16 | public int? MaxInvalidPasswordAttempts { get; set; } 17 | public string SprocGetUser { get; set; } 18 | public string SprocGetPassword { get; set; } 19 | public string SprocResetPassword { get; set; } 20 | public string SprocCreateUser { get; set; } 21 | } 22 | 23 | public class SqlProfileDataStore : DataStoreBase 24 | { 25 | public string SprocGetUserProfile { get; set; } 26 | public string SprocUpdateProfile { get; set; } 27 | public string AllowedGroups { get; set; } 28 | public string ConnectionString { get; set; } 29 | public bool? UseCyberArkVault { get; set; } 30 | public CyberArkVault CyberArkVault { get; set; } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/Data/WebServiceDataStore.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace SecureAuth.Admin.Sdk.Models 4 | { 5 | public class WebServiceMembershipDataStore : DataStoreBase 6 | { 7 | public string Username { get; set; } 8 | public string Password { get; set; } 9 | public bool? Failover { get; set; } 10 | public List MainUrls { get; set; } 11 | } 12 | 13 | public class WebServiceProfileDataStore : DataStoreBase 14 | { 15 | public string Username { get; set; } 16 | public string Password { get; set; } 17 | public string AllowedUserGroups { get; set; } 18 | public bool? Failover { get; set; } 19 | public List MainUrls { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/Logs/LogSetting.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | using Newtonsoft.Json; 3 | using Newtonsoft.Json.Converters; 4 | using System.Web.Configuration; 5 | 6 | namespace SecureAuth.Admin.Sdk.Models 7 | { 8 | public class LogSetting 9 | { 10 | public string LogInstanceId { get; set; } 11 | public bool? EnableAuditSyslog { get; set; } 12 | public bool? EnableAuditEventLog { get; set; } 13 | public bool? EnableAuditTextLog { get; set; } 14 | public bool? EnableAuditDatabaseLog { get; set; } 15 | public bool? EnableAuditExtendedOtpLog { get; set; } 16 | public bool? EnableDebugSyslog { get; set; } 17 | public bool? EnableDebugEventLog { get; set; } 18 | public bool? EnableDebugTextLog { get; set; } 19 | public bool? EnableErrorSyslog { get; set; } 20 | public bool? EnableErrorEventLog { get; set; } 21 | public bool? EnableErrorTextLog { get; set; } 22 | [JsonConverter(typeof(StringEnumConverter))] 23 | public CustomErrorsMode? CustomErrorMode { get; set; } 24 | public string CustomErrorRedirect { get; set; } 25 | public SyslogSetting SyslogSetting { get; set; } 26 | public string LogDatabaseConnectionString { get; set; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/Logs/SyslogSetting.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | 4 | 5 | namespace SecureAuth.Admin.Sdk.Models 6 | { 7 | public class SyslogSetting 8 | { 9 | public string Server { get; set; } 10 | public int? Port { get; set; } 11 | [JsonConverter(typeof(StringEnumConverter))] 12 | public Enums.SyslogRfcSpec? RfcSpec { get; set; } 13 | public int? PrivateEnterpriseNumber { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/MultiFactor/EmailSetting.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | 4 | namespace SecureAuth.Admin.Sdk.Models 5 | { 6 | public class EmailSetting 7 | { 8 | [JsonConverter(typeof(StringEnumConverter))] 9 | public Enums.MultiFactorEmailField? Field1 { get; set; } 10 | [JsonConverter(typeof(StringEnumConverter))] 11 | public Enums.MultiFactorEmailField? Field2 { get; set; } 12 | [JsonConverter(typeof(StringEnumConverter))] 13 | public Enums.MultiFactorEmailField? Field3 { get; set; } 14 | [JsonConverter(typeof(StringEnumConverter))] 15 | public Enums.MultiFactorEmailField? Field4 { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/MultiFactor/HelpDeskSetting.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Admin.Sdk.Models 2 | { 3 | public class HelpDeskSetting 4 | { 5 | public bool? Enabled { get; set; } 6 | public string Phone { get; set; } 7 | public string Email { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/MultiFactor/HelpDeskSettings.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Admin.Sdk.Models 2 | { 3 | public class HelpDeskSettings 4 | { 5 | public HelpDeskSetting HelpDesk1 { get; set; } 6 | public HelpDeskSetting HelpDesk2 { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/MultiFactor/KnowledgeBasedSetting.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | 4 | namespace SecureAuth.Admin.Sdk.Models 5 | { 6 | public class KnowledgeBasedSetting 7 | { 8 | public bool? EnableQuestions { get; set; } 9 | [JsonConverter(typeof(StringEnumConverter))] 10 | public Enums.MultiFactorKbFormat? Format { get; set; } 11 | public int? QuestionCount { get; set; } 12 | public bool? DoConversion { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/MultiFactor/MultiFactorSetting.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | 4 | namespace SecureAuth.Admin.Sdk.Models 5 | { 6 | public class MultiFactorSetting 7 | { 8 | public bool? InlineInitializeMissingPhone { get; set; } 9 | public bool? InlineInitializeMissingEmail { get; set; } 10 | public bool? InlineInitializeMissingKbAnswers { get; set; } 11 | public bool? InlineInitializeMissingPin { get; set; } 12 | public bool? EnableAutoSubmitWhenAvailable { get; set; } 13 | public int? OtpLength { get; set; } 14 | public bool? EnableThrottling { get; set; } 15 | public int? ThrottleMaxFailedAttempts { get; set; } 16 | public int? ThrottleInterval { get; set; } 17 | [JsonConverter(typeof(StringEnumConverter))] 18 | public Enums.TimeUnit? ThrottleTimeUnit { get; set; } 19 | [JsonConverter(typeof(StringEnumConverter))] 20 | public Enums.MultiFactorThrottleAction? ThrottleAction { get; set; } 21 | [JsonConverter(typeof(StringEnumConverter))] 22 | public Enums.MultiFactorThrottleStorage? ThrottleStorageLocation { get; set; } 23 | public int? OtpValidateThrottleMaxFailedAttempts { get; set; } 24 | public int? OtpValidateThrottleInterval { get; set; } 25 | public Enums.TimeUnit? OtpValidateThrottleTimeUnit { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/MultiFactor/Multifactor.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | using System.Collections.Generic; 4 | 5 | namespace SecureAuth.Admin.Sdk.Models 6 | { 7 | public class MultiFactor 8 | { 9 | public PhoneSetting PhoneSetting { get; set; } 10 | public PhoneBlocking PhoneBlocking { get; set; } 11 | public EmailSetting EmailSetting { get; set; } 12 | public KnowledgeBasedSetting KnowledgeBasedSetting { get; set; } 13 | public HelpDeskSettings HelpDeskSettings { get; set; } 14 | public PinSetting PinSetting { get; set; } 15 | public Oath Oath { get; set; } 16 | public PushNotification PushNotification { get; set; } 17 | public YubiKeySettings YubiKeySetting { get; set; } 18 | public MultiFactorSetting MultiFactorSetting { get; set; } 19 | [JsonProperty (ItemConverterType = typeof(StringEnumConverter))] 20 | public List RegistrationMethodOrder { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/MultiFactor/Oath.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Admin.Sdk.Models 2 | { 3 | public class Oath 4 | { 5 | public bool? Enabled { get; set; } 6 | public int? PasscodeLength { get; set; } 7 | public int? PasscodeChangeInterval { get; set; } 8 | public int? PasscodeOffset { get; set; } 9 | public int? CacheLockoutDuration { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/MultiFactor/PhoneBlocking.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | using System.Collections.Generic; 4 | 5 | namespace SecureAuth.Admin.Sdk.Models 6 | { 7 | public class PhoneBlocking 8 | { 9 | [JsonProperty (ItemConverterType = typeof(StringEnumConverter))] 10 | public List BlockedSources { get; set; } 11 | public bool? BlockRecentlyChangedCarrier { get; set; } 12 | public bool? AllowApproveDeleteRecentlyChangedCarrier { get; set; } 13 | [JsonConverter(typeof(StringEnumConverter))] 14 | public Enums.MultiFactorCarrierStorageField? CarrierStorageField { get; set; } 15 | public bool? EnableBlockAllowList { get; set; } 16 | [JsonConverter(typeof(StringEnumConverter))] 17 | public Enums.MultiFactorListAction? ListAction { get; set; } 18 | public List PhoneCarriers { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/MultiFactor/PhoneCarrier.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Admin.Sdk.Models 2 | { 3 | public class PhoneCarrier 4 | { 5 | public string Country { get; set; } 6 | public string Code { get; set; } 7 | public string Name { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/MultiFactor/PhoneSetting.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | 4 | namespace SecureAuth.Admin.Sdk.Models 5 | { 6 | public class PhoneSetting 7 | { 8 | [JsonConverter(typeof(StringEnumConverter))] 9 | public Enums.MultiFactorPhoneField? Field1 { get; set; } 10 | [JsonConverter(typeof(StringEnumConverter))] 11 | public Enums.MultiFactorPhoneField? Field2 { get; set; } 12 | [JsonConverter(typeof(StringEnumConverter))] 13 | public Enums.MultiFactorPhoneField? Field3 { get; set; } 14 | [JsonConverter(typeof(StringEnumConverter))] 15 | public Enums.MultiFactorPhoneField? Field4 { get; set; } 16 | [JsonConverter(typeof(StringEnumConverter))] 17 | public Enums.MultiFactorPhoneSmsSelect? PhoneSmsSelected { get; set; } 18 | public bool? IsVisible { get; set; } 19 | public int? DefaultCountryCode { get; set; } 20 | public string Mask { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/MultiFactor/PinSetting.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Admin.Sdk.Models 2 | { 3 | public class PinSetting 4 | { 5 | public bool? Enabled { get; set; } 6 | public bool? OpenPin { get; set; } 7 | public bool? OneTimeUse { get; set; } 8 | public bool? ShowWhenEmpty { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/MultiFactor/PushNotification.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | 4 | namespace SecureAuth.Admin.Sdk.Models 5 | { 6 | public class PushNotification 7 | { 8 | [JsonConverter(typeof(StringEnumConverter))] 9 | public Enums.MultiFactorPushNotificationRequestType? RequestType { get; set; } 10 | public int? LoginRequestTimeout { get; set; } 11 | [JsonConverter(typeof(StringEnumConverter))] 12 | public Enums.MultifactorPushNotificationAcceptMethod? AcceptMethod { get; set; } 13 | public string CompanyName { get; set; } 14 | public string ApplicationName { get; set; } 15 | public int? MaxDeviceCount { get; set; } 16 | [JsonConverter(typeof(StringEnumConverter))] 17 | public Enums.MultiFactorPushNotificationExceedMaxCountAction? ExceedingMaxCountAction { get; set; } 18 | [JsonConverter(typeof(StringEnumConverter))] 19 | public Enums.MultiFactorPushNotificationReplaceOrderBy? ReplaceOrderBy { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/MultiFactor/YubiKeySettings.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | 4 | namespace SecureAuth.Admin.Sdk.Models 5 | { 6 | public class YubiKeySettings 7 | { 8 | public bool? EnableYubiKeyAuthentication { get; set; } 9 | public bool? ValidateYubiKey { get; set; } 10 | [JsonConverter(typeof(StringEnumConverter))] 11 | public Enums.MultiFactorYubiKeyStorage? StorageLocation { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/Overview/Email.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Admin.Sdk.Models 2 | { 3 | public class Email 4 | { 5 | public string LogoFile { get; set; } 6 | public string Subject { get; set; } 7 | public string ShowPasscodeInSubject { get; set; } 8 | public string SenderAddress { get; set; } 9 | public string SenderName { get; set; } 10 | public string Template { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/Overview/Overview.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | 4 | namespace SecureAuth.Admin.Sdk.Models 5 | { 6 | public class Overview 7 | { 8 | public string RealmName { get; set; } 9 | public string RealmDescription { get; set; } 10 | public string CompanyLogoFile { get; set; } 11 | public string ApplicationLogoFile { get; set; } 12 | public string DocumentTitle { get; set; } 13 | public string PageHeader { get; set; } 14 | public string Theme { get; set; } 15 | [JsonConverter(typeof(StringEnumConverter))] 16 | public Enums.UsernameDisplayField? UsernameDisplay { get; set; } 17 | [JsonConverter(typeof(StringEnumConverter))] 18 | public Enums.UsernameLocation? UsernameLocation { get; set; } 19 | public string ForgotUsernameUrl { get; set; } 20 | [JsonConverter(typeof(StringEnumConverter))] 21 | public Enums.ForgotUsernameUrlLocation? ForgotUsernamePageLocation { get; set; } 22 | public string ForgotPasswordUrl { get; set; } 23 | [JsonConverter(typeof(StringEnumConverter))] 24 | public Enums.ForgotPasswordUrlLocation? ForgotPasswordPageLocation { get; set; } 25 | public string RestartLoginUrl { get; set; } 26 | [JsonConverter(typeof(StringEnumConverter))] 27 | public Enums.RestartLoginUrlLocation? RestartLoginPageLocation { get; set; } 28 | public string CopyrightInformation { get; set; } 29 | public string EulaUrl { get; set; } 30 | [JsonConverter(typeof(StringEnumConverter))] 31 | public Enums.DisclaimerLocation? DisclaimerPageLocation { get; set; } 32 | public Smtp Smtp { get; set; } 33 | public Email Email { get; set; } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/Overview/Smtp.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Admin.Sdk.Models 2 | { 3 | public class Smtp 4 | { 5 | public string ServerAddress { get; set; } 6 | public int? Port { get; set; } 7 | public string Username { get; set; } 8 | public string Password { get; set; } 9 | public string Domain { get; set; } 10 | public bool? UseSsl { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/PostAuth/CustomSetting.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Admin.Sdk.Models 2 | { 3 | public class CustomSetting : RedirectBase 4 | { 5 | public string RedirectPage { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/PostAuth/ExtendedSamlAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Admin.Sdk.Models 2 | { 3 | public class ExtendedSamlAttribute 4 | { 5 | public string Name { get; set; } 6 | public string Format { get; set; } 7 | public string Value { get; set; } 8 | public string GroupFilterExpression { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/PostAuth/PostAuthCookie.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Admin.Sdk.Models 2 | { 3 | public class PostAuthCookie 4 | { 5 | public string PreAuthenticationCookie { get; set; } 6 | public string PostAuthenticationCookie { get; set; } 7 | public bool? IsPersistent { get; set; } 8 | public bool? CleanUpAuthCookie { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/PostAuth/PostAuthFormsAuthentication.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | using System.Web; 4 | 5 | namespace SecureAuth.Admin.Sdk.Models 6 | { 7 | public class PostAuthFormsAuthentication 8 | { 9 | public string Name { get; set; } 10 | public string LoginUrl { get; set; } 11 | public string Domain { get; set; } 12 | public bool? RequireSsl { get; set; } 13 | [JsonConverter(typeof(StringEnumConverter))] 14 | public HttpCookieMode? CookieMode { get; set; } 15 | public bool? IsSlidingExpiration { get; set; } 16 | public int? Timeout { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/PostAuth/PostAuthMachineKey.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | using System.Web.Configuration; 4 | 5 | namespace SecureAuth.Admin.Sdk.Models 6 | { 7 | public class PostAuthMachineKey 8 | { 9 | [JsonConverter(typeof(StringEnumConverter))] 10 | public MachineKeyValidation? Validation { get; set; } 11 | [JsonConverter(typeof(StringEnumConverter))] 12 | public Enums.PostAuthMachineKeyDecryption? Decryption { get; set; } 13 | public string ValidationKey { get; set; } 14 | public string DecryptionKey { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/PostAuth/RedirectBase.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Admin.Sdk.Models 2 | { 3 | public class RedirectBase 4 | { 5 | public string RedirectPage { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/PostAuth/SamlSetting.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace SecureAuth.Admin.Sdk.Models 4 | { 5 | public class SamlSetting : RedirectBase 6 | { 7 | public UserIdMapping UserIdMapping { get; set; } 8 | public WsFedSamlAssertion Assertion { get; set; } 9 | public List Attributes { get; set; } 10 | public List ExtendedSamlAttributes { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/PostAuth/SamlWsFedAttribute.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | 4 | namespace SecureAuth.Admin.Sdk.Models 5 | { 6 | public class SamlWsFedAttribute 7 | { 8 | public int? AttributeNumber { get; set; } 9 | public string Name { get; set; } 10 | public string NameSpace { get; set; } 11 | public string Format { get; set; } 12 | [JsonConverter(typeof(StringEnumConverter))] 13 | public Enums.PostAuthUserIdMappingType? Value { get; set; } 14 | public string GroupFilterExpression { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/PostAuth/UserIdMapping.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | 4 | namespace SecureAuth.Admin.Sdk.Models 5 | { 6 | public class UserIdMapping 7 | { 8 | [JsonConverter(typeof(StringEnumConverter))] 9 | public Enums.PostAuthUserIdMappingType? Mapping { get; set; } 10 | public string NameIdFormat { get; set; } 11 | public bool? EncodeToBase64 { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/PostAuth/WsFedSetting.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace SecureAuth.Admin.Sdk.Models 4 | { 5 | public class WsFedSetting : RedirectBase 6 | { 7 | public UserIdMapping UserIdMapping { get; set; } 8 | public WsFedSamlAssertion Assertion { get; set; } 9 | public List Attributes { get; set; } 10 | public WsTrustEndpointConfiguration EndpointConfiguration { get; set; } 11 | public WsTrustRequestBlocking RequestBlocking { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/PostAuth/WsTrustEndpoint.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | 4 | namespace SecureAuth.Admin.Sdk.Models 5 | { 6 | public class WsTrustEndpoint 7 | { 8 | [JsonConverter(typeof(StringEnumConverter))] 9 | public Enums.PostAuthWsTrustEndpoint? Id { get; set; } 10 | public bool? Enabled { get; set; } 11 | public string EndpointPath { get; set; } 12 | public string AuthenticationType { get; set; } 13 | public string SecurityMode { get; set; } 14 | public string Type { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/PostAuth/WsTrustEndpointConfiguration.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace SecureAuth.Admin.Sdk.Models 4 | { 5 | public class WsTrustEndpointConfiguration 6 | { 7 | public string Host { get; set; } 8 | public List Endpoints { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/PostAuth/WsTrustRequestBlocking.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | using System.Collections.Generic; 4 | 5 | namespace SecureAuth.Admin.Sdk.Models 6 | { 7 | public class WsTrustRequestBlocking 8 | { 9 | public bool? UseAdaptiveAuthForIpBlocking { get; set; } 10 | public bool? EnableRequestBlocking { get; set; } 11 | [JsonConverter(typeof(StringEnumConverter))] 12 | public Enums.WsTrustRequestBlockingConditionLogic? ConditionLogic { get; set; } 13 | [JsonConverter(typeof(StringEnumConverter))] 14 | public Enums.WsTrustBlockingRule? IpAddressBlockingRule { get; set; } 15 | public List IpAddresses { get; set; } 16 | [JsonConverter(typeof(StringEnumConverter))] 17 | public Enums.WsTrustBlockingRule? ApplicationBlockingRule { get; set; } 18 | public List Applications { get; set; } 19 | [JsonConverter(typeof(StringEnumConverter))] 20 | public Enums.WsTrustBlockingRule? UserAgentBlockingRules { get; set; } 21 | public List UserAgents { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/Realm.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Admin.Sdk.Models 4 | { 5 | public class Realm 6 | { 7 | public int Id { get; set; } 8 | public Overview Overview { get; set; } 9 | public Data Data { get; set; } 10 | public Workflow Workflow { get; set; } 11 | public AdaptiveAuthentication AdaptiveAuthentication { get; set; } 12 | public MultiFactor MultiFactor { get; set; } 13 | public PostAuthentication PostAuthentication { get; set; } 14 | public ApiSetting ApiSetting { get; set; } 15 | public LogSetting LogSetting { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/Workflow/BrowserProfileSetting.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | 4 | namespace SecureAuth.Admin.Sdk.Models 5 | { 6 | public class BrowserProfileSetting 7 | { 8 | [JsonConverter(typeof(StringEnumConverter))] 9 | public Enums.DFPDesktopMode? FpMode { get; set; } 10 | public string CookieNamePrefix { get; set; } 11 | public int? CookieExpireLength { get; set; } 12 | public bool? MatchFpIdInCookie { get; set; } 13 | public int? AuthenticationThreshold { get; set; } 14 | public int? UpdateThreshold { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/Workflow/CustomIdentityConsumer.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | 4 | namespace SecureAuth.Admin.Sdk.Models 5 | { 6 | public class CustomIdentityConsumer 7 | { 8 | [JsonConverter(typeof(StringEnumConverter))] 9 | public Enums.ReceiveToken? ReceiveToken { get; set; } 10 | public bool? RequireBeginSite { get; set; } 11 | [JsonConverter(typeof(StringEnumConverter))] 12 | public Enums.BeginSite? BeginSite { get; set; } 13 | public bool? WindowsSsoUserImpersonation { get; set; } 14 | public bool? WindowsSsoWindowsAuthentication { get; set; } 15 | public string YubiKeyProvisionPage { get; set; } 16 | public string CustomBeginSiteUrl { get; set; } 17 | [JsonConverter(typeof(StringEnumConverter))] 18 | public Enums.ReceiveTokenDataType? ReceiveTokenDataType { get; set; } 19 | [JsonConverter(typeof(StringEnumConverter))] 20 | public Enums.SendTokenDataType? SendTokenDataType { get; set; } 21 | public bool? UserIdCheck { get; set; } 22 | public bool? AllowTransparentSso { get; set; } 23 | public string Delimiter { get; set; } 24 | public int? GetSharedSecret { get; set; } 25 | public int? SetSharedSecret { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/Workflow/DeviceRecognitionMethod.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | 4 | namespace SecureAuth.Admin.Sdk.Models 5 | { 6 | public class DeviceRecognitionMethod 7 | { 8 | [JsonConverter(typeof(StringEnumConverter))] 9 | public Enums.DeviceRecognitionIntegrationMethod? IntegrationMethod { get; set; } 10 | [JsonConverter(typeof(StringEnumConverter))] 11 | public Enums.DeviceRecognitionClientSideControl? ClientSideControl { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/Workflow/FbaWebService.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Admin.Sdk.Models 2 | { 3 | public class FbaWebService 4 | { 5 | public bool? Enabled { get; set; } 6 | public string Username { get; set; } 7 | public string Password { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/Workflow/LoginScreen.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | 4 | namespace SecureAuth.Admin.Sdk.Models 5 | { 6 | public class LoginScreen 7 | { 8 | [JsonConverter(typeof(StringEnumConverter))] 9 | public Enums.DefaultWorkflow? DefaultWorkflow { get; set; } 10 | [JsonConverter(typeof(StringEnumConverter))] 11 | public Enums.KioskOption? PublicPrivateMode { get; set; } 12 | [JsonConverter(typeof(StringEnumConverter))] 13 | public Enums.DefaultKiosk? PublicPrivateDefault { get; set; } 14 | public bool? RememberPublicPrivateUserSelection { get; set; } 15 | public bool? ShowUserIdTextbox { get; set; } 16 | public bool? ShowInlinePasswordChange { get; set; } 17 | public PasswordThrottle PasswordThrottle { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/Workflow/MobileProfileSetting.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | 4 | 5 | namespace SecureAuth.Admin.Sdk.Models 6 | { 7 | public class MobileProfileSetting 8 | { 9 | [JsonConverter(typeof(StringEnumConverter))] 10 | public Enums.DFPMobileMode? FpMode { get; set; } 11 | public string CookieNamePrefix { get; set; } 12 | public int? CookieExpireLength { get; set; } 13 | public bool? MatchFpIdInCookie { get; set; } 14 | public bool? SkipIpMatch { get; set; } 15 | public int? AuthenticationThreshold { get; set; } 16 | public int? UpdateThreshold { get; set; } 17 | } 18 | } -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/Workflow/PasswordThrottle.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | 4 | 5 | namespace SecureAuth.Admin.Sdk.Models 6 | { 7 | public class PasswordThrottle 8 | { 9 | public bool? Enabled { get; set; } 10 | public int? MaxFailedAttempts { get; set; } 11 | public int? Interval { get; set; } 12 | [JsonConverter(typeof(StringEnumConverter))] 13 | public Enums.TimeUnit? TimeUnit { get; set; } 14 | [JsonConverter(typeof(StringEnumConverter))] 15 | public Enums.WorkflowPasswordThrottleAction? Action { get; set; } 16 | [JsonConverter(typeof(StringEnumConverter))] 17 | public Enums.WorkflowPasswordThrottleStorage? StorageLocation { get; set; } 18 | 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/Workflow/ProfileSetting.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | 4 | namespace SecureAuth.Admin.Sdk.Models 5 | { 6 | public class ProfileSetting 7 | { 8 | public int? FpExpirationLength { get; set; } 9 | public int? FpExpirationSinceLastAccess { get; set; } 10 | public bool? AllowOnlyOneFpCookiePerBrowser { get; set; } 11 | public int? TotalFpMaxCount { get; set; } 12 | [JsonConverter(typeof(StringEnumConverter))] 13 | public Enums.DFPAllowToReplaceWhenExceedMaxAccount? WhenExceedingMaxCount { get; set; } 14 | [JsonConverter(typeof(StringEnumConverter))] 15 | public Enums.DFPOrderBy? ReplaceInOrderBy { get; set; } 16 | public int? FpAccessRecordsMaxCount { get; set; } 17 | } 18 | } -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/Workflow/Redirect.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Admin.Sdk.Models 2 | { 3 | public class Redirect 4 | { 5 | public string InvalidatePersistentTokenRedirect { get; set; } 6 | public string TokenMissingRedirect { get; set; } 7 | public string ProfileMissingRedirect { get; set; } 8 | public string MobileRedirect { get; set; } 9 | public string MobileIdentifiers { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/Workflow/SessionTimeout.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using Newtonsoft.Json.Converters; 3 | 4 | 5 | namespace SecureAuth.Admin.Sdk.Models 6 | { 7 | public class SessionTimeout 8 | { 9 | public string SessionStateName { get; set; } 10 | public int? IdleTimeoutLength { get; set; } 11 | [JsonConverter(typeof(StringEnumConverter))] 12 | public Enums.DisplayTimeoutMessage? DisplayTimeoutMessage { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/Workflow/TerminationPoint.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Admin.Sdk.Models 2 | { 3 | public class TerminationPoint 4 | { 5 | public string ClientFqdn { get; set; } 6 | public string SslTerminationCertificate { get; set; } 7 | public string SslCertificateAddress { get; set; } 8 | public string SslTerminationPoint { get; set; } 9 | } 10 | } -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/Workflow/TokenPersistence.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Admin.Sdk.Models 2 | { 3 | public class TokenPersistence 4 | { 5 | public bool? ValidatePersistentToken { get; set; } 6 | public bool? RenewPersistentToken { get; set; } 7 | } 8 | } -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Models/Workflow/Workflow.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Admin.Sdk.Models 2 | { 3 | public class Workflow 4 | { 5 | public DeviceRecognitionMethod DeviceRecognitionMethod { get; set; } 6 | public BrowserProfileSetting BrowserProfileSetting { get; set; } 7 | public MobileProfileSetting MobileProfileSetting { get; set; } 8 | public ProfileSetting ProfileSetting { get; set; } 9 | public LoginScreen LoginScreen { get; set; } 10 | public SessionTimeout SessionTimeout { get; set; } 11 | public TokenPersistence TokenPersistence { get; set; } 12 | public Redirect Redirect { get; set; } 13 | public TerminationPoint TerminationPoint { get; set; } 14 | public CustomIdentityConsumer CustomIdentityConsumer { get; set; } 15 | public FbaWebService FbaWebService { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Requests/AdaptiveAuthRequest.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Admin.Sdk 2 | { 3 | public class AdaptiveAuthRequest : BaseRequest 4 | { 5 | public Models.AdaptiveAuthentication AdaptiveAuth { get; set; } 6 | 7 | public AdaptiveAuthRequest() 8 | { 9 | AdaptiveAuth = new Models.AdaptiveAuthentication(); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Requests/AdaptiveAuthRequestV2.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Admin.Sdk 2 | { 3 | public class AdaptiveAuthRequestV2 : BaseRequest 4 | { 5 | public Models.v2.AdaptiveAuthentication AdaptiveAuth { get; set; } 6 | 7 | public AdaptiveAuthRequestV2() 8 | { 9 | AdaptiveAuth = new Models.v2.AdaptiveAuthentication(); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Requests/ApiSettingRequest.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Admin.Sdk 2 | { 3 | public class ApiSettingRequest : BaseRequest 4 | { 5 | public Models.ApiSetting ApiSetting { get; set; } 6 | 7 | public ApiSettingRequest() 8 | { 9 | ApiSetting = new Models.ApiSetting(); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Requests/BaseRequest.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Admin.Sdk 4 | { 5 | public class BaseRequest 6 | { 7 | 8 | public string RealmId { get; set; } 9 | 10 | public BaseRequest() 11 | { 12 | } 13 | 14 | public BaseRequest(string realmId) 15 | { 16 | this.RealmId = realmId; 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Requests/DataGlobalAuxRequest.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Admin.Sdk 2 | { 3 | public class DataGlobalAuxRequest : BaseRequest 4 | { 5 | public Models.Data Data { get; set; } 6 | 7 | public DataGlobalAuxRequest() 8 | { 9 | Data = new Models.Data(); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Requests/DataMembershipRequest.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Admin.Sdk 2 | { 3 | public class DataMembershipRequest : BaseRequest 4 | { 5 | public Models.Membership Membership { get; set; } 6 | 7 | public DataMembershipRequest() 8 | { 9 | Membership = new Models.Membership(); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Requests/DataProfileRequest.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Admin.Sdk 2 | { 3 | public class DataProfileRequest : BaseRequest 4 | { 5 | public Models.Profile Profile { get; set; } 6 | 7 | public DataProfileRequest() 8 | { 9 | Profile = new Models.Profile(); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Requests/LogSettingRequest.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Admin.Sdk 2 | { 3 | public class LogSettingRequest : BaseRequest 4 | { 5 | public Models.LogSetting LogSetting { get; set; } 6 | 7 | public LogSettingRequest() 8 | { 9 | LogSetting = new Models.LogSetting(); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Requests/MultifactorRequest.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Admin.Sdk 2 | { 3 | public class MultifactorRequest : BaseRequest 4 | { 5 | public Models.MultiFactor MultiFactor { get; set; } 6 | 7 | public MultifactorRequest() 8 | { 9 | MultiFactor = new Models.MultiFactor(); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Requests/OverviewRequest.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Admin.Sdk 2 | { 3 | public class OverviewRequest : BaseRequest 4 | { 5 | public Models.Overview Overview { get; set; } 6 | 7 | public OverviewRequest() 8 | { 9 | Overview = new Models.Overview(); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Requests/PostAuthRequest.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Admin.Sdk 2 | { 3 | public class PostAuthRequest : BaseRequest 4 | { 5 | public Models.PostAuthentication PostAuth { get; set; } 6 | 7 | public PostAuthRequest() 8 | { 9 | PostAuth = new Models.PostAuthentication(); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Requests/UserRiskProviderRequest.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Admin.Sdk 2 | { 3 | public class UserRiskProviderRequest : BaseRequest 4 | { 5 | public Models.v2.UserRiskProvider UserRiskProvider { get; set; } 6 | 7 | public UserRiskProviderRequest() 8 | { 9 | UserRiskProvider = new Models.v2.UserRiskProvider(); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Requests/WorkflowRequest.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Admin.Sdk 2 | { 3 | public class WorkflowRequest : BaseRequest 4 | { 5 | public Models.Workflow Workflow { get; set; } 6 | 7 | public WorkflowRequest() 8 | { 9 | Workflow = new Models.Workflow(); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Responses/BaseResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Net; 2 | using System.Runtime.Serialization; 3 | 4 | namespace SecureAuth.Admin.Sdk 5 | { 6 | [DataContract] 7 | public class BaseResponse 8 | { 9 | [DataMember(Name = "status", EmitDefaultValue = false)] 10 | public string Status { get; set; } 11 | 12 | [IgnoreDataMember] 13 | public string RawJson { get; set; } 14 | 15 | [IgnoreDataMember] 16 | public string RawRequestJson { get; set; } 17 | 18 | [IgnoreDataMember] 19 | public HttpStatusCode StatusCode { get; set; } 20 | 21 | public virtual bool IsSucess() 22 | { 23 | return ((this.StatusCode == HttpStatusCode.OK) && (this.Status == "valid")); 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Responses/PhoneCarrierResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Net; 2 | using System.Collections.Generic; 3 | 4 | namespace SecureAuth.Admin.Sdk 5 | { 6 | public class PhoneCarrierResponse : BaseResponse 7 | { 8 | public List CarrierCountries { get; set; } 9 | 10 | public override bool IsSucess() 11 | { 12 | return ((this.StatusCode == HttpStatusCode.OK)); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Responses/RealmApiResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Net; 2 | 3 | 4 | namespace SecureAuth.Admin.Sdk 5 | { 6 | public class RealmApiResponse : BaseResponse 7 | { 8 | public Models.ApiSetting ApiSetting { get; set; } 9 | 10 | public override bool IsSucess() 11 | { 12 | return ((this.StatusCode == HttpStatusCode.OK)); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Responses/RealmResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Net; 3 | using System.Runtime.Serialization; 4 | 5 | 6 | namespace SecureAuth.Admin.Sdk 7 | { 8 | [DataContract] 9 | public class RealmResponse : BaseResponse 10 | { 11 | [DataMember(Name = "realm")] 12 | public Models.Realm Realm { get; set; } 13 | 14 | public override bool IsSucess() 15 | { 16 | return ((this.StatusCode == HttpStatusCode.OK)); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Responses/TestConnectionResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Net; 2 | using System.Collections.Generic; 3 | 4 | namespace SecureAuth.Admin.Sdk 5 | { 6 | public class TestConnectionResponse : BaseResponse 7 | { 8 | public bool Result { get; set; } 9 | 10 | public override bool IsSucess() 11 | { 12 | return ((this.StatusCode == HttpStatusCode.OK)); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/Responses/VersionResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Net; 2 | 3 | namespace SecureAuth.Admin.Sdk 4 | { 5 | public class VersionResponse : BaseResponse 6 | { 7 | public Models.AssemblyVersion Version { get; set; } 8 | 9 | public override bool IsSucess() 10 | { 11 | return ((this.StatusCode == HttpStatusCode.OK)); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.26730.3 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SecureAuth.Admin.Sdk", "SecureAuth.Admin.Sdk.csproj", "{710C6B5A-DAA2-45FC-B79F-3BA55C06C385}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SecureAuth.Admin.Sdk.UnitTests", "..\..\SecureAuth.Admin.Sdk.UnitTests\SecureAuth.Admin.Sdk.UnitTests\SecureAuth.Admin.Sdk.UnitTests.csproj", "{7388F373-FC11-4C9A-8772-74736002FCCF}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Release|Any CPU = Release|Any CPU 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {710C6B5A-DAA2-45FC-B79F-3BA55C06C385}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {710C6B5A-DAA2-45FC-B79F-3BA55C06C385}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {710C6B5A-DAA2-45FC-B79F-3BA55C06C385}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {710C6B5A-DAA2-45FC-B79F-3BA55C06C385}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {7388F373-FC11-4C9A-8772-74736002FCCF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {7388F373-FC11-4C9A-8772-74736002FCCF}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {7388F373-FC11-4C9A-8772-74736002FCCF}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {7388F373-FC11-4C9A-8772-74736002FCCF}.Release|Any CPU.Build.0 = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {8E0FB207-DAB4-44CC-B82B-D92E53761226} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/VersionService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using SecureAuth.Admin.Sdk.Models; 3 | 4 | namespace SecureAuth.Admin.Sdk 5 | { 6 | public class VersionService : IVersionService 7 | { 8 | private readonly ApiClient _apiClient; 9 | 10 | protected internal VersionService(ApiClient apiClient) 11 | { 12 | this._apiClient = apiClient; 13 | } 14 | 15 | 16 | /// 17 | /// Returns the SecureAuth appliance version information 18 | /// 19 | /// VersionResponse 20 | public VersionResponse GetVersion() 21 | { 22 | string endpoint = "/api/v1/version"; ; 23 | 24 | return this._apiClient.Post(endpoint); 25 | } 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SecureAuth.Admin.Sdk/SecureAuth.Admin.Sdk/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, SecureAuth 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 5 | 6 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | 8 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | 10 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 11 | 12 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 13 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 14 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 15 | -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/README.md: -------------------------------------------------------------------------------- 1 | # SACustomAPI 2 | A .NET MVC WebApp using SecureAuth APIs 3 | 4 | ## Requirements 5 | * IIS Webserver 6 | * .NET Framework 4.5.2 7 | * SecureAuth IdP with API configured ( [https://docs.secureauth.com/x/LwZPAg](https://docs.secureauth.com/x/LwZPAg)) 8 | 9 | 10 | ## Configuration 11 | Simply build the application in release mode and add to your IIS web server as a virtual application. 12 | Edit the following items in the web.config: 13 | * ` ` - Insert your AppId provided by the SecureAuth API 14 | * `` - Insert your AppKey provided by the SecureAuth API 15 | * `` - Insert the hostname and realm of the SecureAuth realm configured for API -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SACustomAPI", "SACustomAPI\SACustomAPI.csproj", "{35763C90-77C8-4DB7-8BF5-2E41540B8F6E}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {35763C90-77C8-4DB7-8BF5-2E41540B8F6E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {35763C90-77C8-4DB7-8BF5-2E41540B8F6E}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {35763C90-77C8-4DB7-8BF5-2E41540B8F6E}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {35763C90-77C8-4DB7-8BF5-2E41540B8F6E}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/App_Start/BundleConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Optimization; 3 | 4 | namespace SACustomAPI 5 | { 6 | public class BundleConfig 7 | { 8 | // For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862 9 | public static void RegisterBundles(BundleCollection bundles) 10 | { 11 | bundles.Add(new ScriptBundle("~/bundles/jquery").Include( 12 | "~/Scripts/jquery-{version}.js")); 13 | 14 | bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include( 15 | "~/Scripts/jquery.validate*")); 16 | 17 | // Use the development version of Modernizr to develop with and learn from. Then, when you're 18 | // ready for production, use the build tool at http://modernizr.com to pick only the tests you need. 19 | bundles.Add(new ScriptBundle("~/bundles/modernizr").Include( 20 | "~/Scripts/modernizr-*")); 21 | 22 | bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include( 23 | "~/Scripts/bootstrap.js", 24 | "~/Scripts/respond.js")); 25 | 26 | bundles.Add(new StyleBundle("~/Content/css").Include( 27 | "~/Content/bootstrap.css", 28 | "~/Content/site.css")); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/App_Start/FilterConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Mvc; 3 | 4 | namespace SACustomAPI 5 | { 6 | public class FilterConfig 7 | { 8 | public static void RegisterGlobalFilters(GlobalFilterCollection filters) 9 | { 10 | filters.Add(new HandleErrorAttribute()); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace SACustomAPI 9 | { 10 | public class RouteConfig 11 | { 12 | public static void RegisterRoutes(RouteCollection routes) 13 | { 14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 15 | 16 | routes.MapRoute( 17 | name: "Default", 18 | url: "{controller}/{action}/{id}", 19 | defaults: new { controller = "Login", action = "Index", id = UrlParameter.Optional } 20 | ); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/App_Start/Startup.Auth.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.Owin; 3 | using Microsoft.Owin.Security.Cookies; 4 | using Owin; 5 | 6 | namespace SACustomAPI 7 | { 8 | public static class SAAuthentication 9 | { 10 | public const string ApplicationCookie = "SAAuthType"; 11 | } 12 | 13 | public partial class Startup 14 | { 15 | public void ConfigureAuth(IAppBuilder app) 16 | { 17 | // need to add UserManager into owin, because this is used in cookie invalidation 18 | app.UseCookieAuthentication(new CookieAuthenticationOptions 19 | { 20 | AuthenticationType = SAAuthentication.ApplicationCookie, 21 | LoginPath = new PathString("/Login"), 22 | Provider = new CookieAuthenticationProvider(), 23 | CookieName = "saauth", 24 | CookieHttpOnly = true, 25 | ExpireTimeSpan = TimeSpan.FromHours(1), // adjust to your needs 26 | }); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/App_Start/Startup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Owin; 2 | using Owin; 3 | 4 | [assembly: OwinStartupAttribute(typeof(SACustomAPI.Startup))] 5 | namespace SACustomAPI 6 | { 7 | public partial class Startup 8 | { 9 | public void Configuration(IAppBuilder app) 10 | { 11 | ConfigureAuth(app); 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/Content/Images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SecureAuthCorp/saidp-sdk-csharp/6d6c0405ec0a26ecdbe1cabd6dd15bcc6e773002/SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/Content/Images/logo.png -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/Controllers/AuthorizedController.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Mvc; 2 | using SACustomAPI.Utilities; 3 | using SACustomAPI.Models; 4 | 5 | namespace SACustomAPI.Controllers 6 | { 7 | public class AuthorizedController : Controller 8 | { 9 | // GET: Authorized 10 | [CustomAuthorize] 11 | public virtual ActionResult Index() 12 | { 13 | AuthorizedViewModel model = new AuthorizedViewModel(); 14 | return View(model); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="SACustomAPI.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Optimization; 7 | using System.Web.Routing; 8 | 9 | namespace SACustomAPI 10 | { 11 | public class MvcApplication : System.Web.HttpApplication 12 | { 13 | protected void Application_Start() 14 | { 15 | AreaRegistration.RegisterAllAreas(); 16 | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); 17 | RouteConfig.RegisterRoutes(RouteTable.Routes); 18 | BundleConfig.RegisterBundles(BundleTable.Bundles); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/Models/AdaptViewModel.cs: -------------------------------------------------------------------------------- 1 | using SACustomAPI.Utilities; 2 | 3 | namespace SACustomAPI.Models 4 | { 5 | public class AdaptViewModel 6 | { 7 | public string actionRedirect { get; set; } 8 | 9 | public string outsideRedirect { get; set; } 10 | 11 | public string localRedirect { get; set; } 12 | 13 | public string routeRedirect { get; set; } 14 | 15 | public ApiJson apiJson 16 | { 17 | get 18 | { 19 | return SessionBag.Current.JsonModel; 20 | } 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/Models/AuthorizedViewModel.cs: -------------------------------------------------------------------------------- 1 | using SACustomAPI.Utilities; 2 | 3 | namespace SACustomAPI.Models 4 | { 5 | public class AuthorizedViewModel 6 | { 7 | public ApiJson apiJson 8 | { 9 | get 10 | { 11 | return SessionBag.Current.JsonModel; 12 | } 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/Models/ConfigurationModel.cs: -------------------------------------------------------------------------------- 1 | using SecureAuth.Sdk; 2 | using System.Configuration; 3 | 4 | namespace SACustomAPI.Models 5 | { 6 | public static class ConfigurationModel 7 | { 8 | public static SecureAuth.Sdk.Configuration getConfig() 9 | { 10 | string appId = ConfigurationManager.AppSettings["AppId"]; 11 | string appKey = ConfigurationManager.AppSettings["AppKey"]; 12 | string SecureAuthUrl = ConfigurationManager.AppSettings["SecureAuthUrl"]; 13 | string BypassCert = ConfigurationManager.AppSettings["BypassCert"]; 14 | bool CertBypass = false; 15 | if (BypassCert.ToLower().Contains("true")) 16 | { 17 | CertBypass = true; 18 | } 19 | 20 | SecureAuth.Sdk.Configuration sdkConfig = new SecureAuth.Sdk.Configuration(SecureAuthUrl, appId, appKey, CertBypass); 21 | return sdkConfig; 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/Models/HardstopViewModel.cs: -------------------------------------------------------------------------------- 1 | using SACustomAPI.Utilities; 2 | 3 | namespace SACustomAPI.Models 4 | { 5 | public class HardstopViewModel 6 | { 7 | public ApiJson apiJson 8 | { 9 | get 10 | { 11 | return SessionBag.Current.JsonModel; 12 | } 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/Models/LoginViewModel.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | using System.Web.Mvc; 3 | 4 | namespace SACustomAPI.Models 5 | { 6 | public class LoginViewModel 7 | { 8 | [Required, AllowHtml] 9 | public string Username { get; set; } 10 | 11 | [Required, AllowHtml] 12 | [DataType(DataType.Password)] 13 | public string Password { get; set; } 14 | 15 | [Required, AllowHtml] 16 | public string Fingerprint { get; set; } 17 | } 18 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/Models/OtpViewModel.cs: -------------------------------------------------------------------------------- 1 | using SACustomAPI.Utilities; 2 | using SecureAuth.Sdk; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Web.Mvc; 5 | 6 | namespace SACustomAPI.Models 7 | { 8 | public class OtpViewModel 9 | { 10 | [AllowHtml] 11 | [DataType(DataType.Password)] 12 | public string Passcode { get; set; } 13 | 14 | [AllowHtml] 15 | [Display(Name = "Remember this device?")] 16 | public bool isTrustedDevice { get; set; } 17 | 18 | [AllowHtml] 19 | public bool canTrust { get; set; } 20 | 21 | [AllowHtml] 22 | [DataType(DataType.Password)] 23 | public string KbqAnswer1 { get; set; } 24 | 25 | [AllowHtml] 26 | [DataType(DataType.Password)] 27 | public string KbqAnswer2 { get; set; } 28 | 29 | public string OtpType { get; set; } 30 | 31 | public MultiFactorOption KbqQuestion1 { get; set; } 32 | 33 | public MultiFactorOption KbqQuestion2 { get; set; } 34 | 35 | public string Kbq1FactorId { get; set; } 36 | 37 | public string Kbq2FactorId { get; set; } 38 | 39 | public ApiJson apiJson 40 | { 41 | get 42 | { 43 | return SessionBag.Current.JsonModel; 44 | } 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/Models/Persona.cs: -------------------------------------------------------------------------------- 1 | using SACustomAPI.Utilities; 2 | using SecureAuth.Sdk; 3 | 4 | namespace SACustomAPI.Models 5 | { 6 | public class Persona 7 | { 8 | public string UserReturnUrl { get; set; } 9 | 10 | public string FingerprintJson { get; set; } 11 | 12 | public AuthorizeEnum.State AuthState { get; set; } 13 | 14 | public string UserIpAddress { get; set; } 15 | 16 | public string FingerprintId { get; set; } 17 | 18 | public bool AllowDeviceRecog { get; set; } 19 | 20 | public GetFactorsResponse factors { get; set; } 21 | 22 | public MultiFactorOption selectedFactor { get; set; } 23 | } 24 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/Models/SelectViewModel.cs: -------------------------------------------------------------------------------- 1 | using SACustomAPI.Utilities; 2 | using SecureAuth.Sdk; 3 | using System.Collections.Generic; 4 | using System.ComponentModel.DataAnnotations; 5 | 6 | namespace SACustomAPI.Models 7 | { 8 | public class SelectViewModel 9 | { 10 | [UIHint("PhoneSelect")] 11 | public IList phoneFactors { get; set; } 12 | 13 | [UIHint("EmailSelect")] 14 | public IList emailFactors { get; set; } 15 | 16 | [UIHint("KbqSelect")] 17 | public IList kbqFactors { get; set; } 18 | 19 | [UIHint("HelpDeskSelect")] 20 | public IList helpDeskFactors { get; set; } 21 | 22 | [UIHint("PushSelect")] 23 | public IList pushFactors { get; set; } 24 | 25 | [UIHint("OathSelect")] 26 | public IList oathFactors { get; set; } 27 | 28 | public string selectedFactorId { get; set; } 29 | public string selectedType { get; set; } 30 | public string selectedCapability { get; set; } 31 | 32 | public ApiJson apiJson 33 | { 34 | get 35 | { 36 | return SessionBag.Current.JsonModel; 37 | } 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("SACustomAPI")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SACustomAPI")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("34e97055-75ef-4357-af70-092c7432e4c1")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/Scripts/_references.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SecureAuthCorp/saidp-sdk-csharp/6d6c0405ec0a26ecdbe1cabd6dd15bcc6e773002/SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/Scripts/_references.js -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/Utilities/AuthorizeEnum.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace SACustomAPI.Utilities 7 | { 8 | public class AuthorizeEnum 9 | { 10 | [Flags] 11 | public enum State 12 | { 13 | Index = 0x0, 14 | Adapt = 0x1, 15 | Select = 0x2, 16 | Otp = 0x4 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/Utilities/SessionBag.cs: -------------------------------------------------------------------------------- 1 | using System.Dynamic; 2 | using System.Web; 3 | 4 | namespace SACustomAPI.Utilities 5 | { 6 | public sealed class SessionBag : DynamicObject 7 | { 8 | private static readonly SessionBag sessionBag; 9 | 10 | static SessionBag() 11 | { 12 | sessionBag = new SessionBag(); 13 | } 14 | 15 | private SessionBag() 16 | { 17 | } 18 | 19 | private HttpSessionStateBase Session 20 | { 21 | get { return new HttpSessionStateWrapper(HttpContext.Current.Session); } 22 | } 23 | 24 | public override bool TryGetMember(GetMemberBinder binder, out object result) 25 | { 26 | result = Session[binder.Name]; 27 | return true; 28 | } 29 | 30 | public override bool TrySetMember(SetMemberBinder binder, object value) 31 | { 32 | Session[binder.Name] = value; 33 | return true; 34 | } 35 | 36 | public override bool TryGetIndex(GetIndexBinder 37 | binder, object[] indexes, out object result) 38 | { 39 | int index = (int)indexes[0]; 40 | result = Session[index]; 41 | return result != null; 42 | } 43 | 44 | public override bool TrySetIndex(SetIndexBinder binder, 45 | object[] indexes, object value) 46 | { 47 | int index = (int)indexes[0]; 48 | Session[index] = value; 49 | return true; 50 | } 51 | 52 | public static dynamic Current 53 | { 54 | get { return sessionBag; } 55 | } 56 | } 57 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/Views/Login/Fraud.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Fraud"; 3 | } 4 | 5 |
6 |
7 |

Phone Number Verification Needed

8 |
9 |
10 | 11 |
12 |
13 |
14 |

We have detected a recent change to the number you are trying to use for two-factor authentication. In order to verify that you still own the number you are trying to use for authentication, please click here.

15 |

If you are unsure of why you are receiving this message, please contact customer support at: (888)555-5555

16 |
17 |
18 |
19 |
20 |

Phone Number Ported Status Check and Fraud Prevention

21 |
22 |
23 |

SecureAuth is able to provide information about the carrier, type (landline, mobile, etc), and ported status of a phone number.

24 |

Using this information, your organization can require users to go through additional steps of verification to guarantee that the user still owns the number they are using for authentication.

25 |

In addition, SecureAuth allows you to block the delivery of OTP to phone numbers that fit specific type profiles, such as virtual, landline, and others. This allows you to block abuse of virtual numbers, a common attack vector for bad actors.

26 |
27 |
28 |
29 |
30 | -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/Views/Shared/EmailSelect.cshtml: -------------------------------------------------------------------------------- 1 | @model SecureAuth.Sdk.MultiFactorOption 2 | @using SACustomAPI.Models 3 | 4 |
5 |
6 | Deliver OTP to:  7 | @Html.LabelFor(m => m.FactorValue, Model.FactorValue.MaskEmail(), new { @class = "form-control", aria_describedby = "basic-addon3", @style = "background-color:#eee" }) 8 | 9 | 10 | 11 |
12 |
13 | -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Error 6 | 7 | 8 |
9 |

Error.

10 |

An error occurred while processing your request.

11 |
12 | 13 | 14 | -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/Views/Shared/HelpDeskSelect.cshtml: -------------------------------------------------------------------------------- 1 | @model SecureAuth.Sdk.MultiFactorOption 2 | 3 |
4 |
5 | Call Help Desk at:  6 | @Html.LabelFor(m => m.FactorValue, Model.FactorValue, new { @class = "form-control", aria_describedby = "basic-addon3", @style = "background-color:#eee" }) 7 | 8 | 9 | 10 |
11 |
12 | 13 | -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/Views/Shared/KbqEntry.cshtml: -------------------------------------------------------------------------------- 1 | @model SACustomAPI.Models.OtpViewModel 2 |
3 | @Html.LabelFor(m => m.KbqQuestion1.FactorValue, Model.KbqQuestion1.FactorValue) 4 | @Html.PasswordFor(m => m.KbqAnswer1, new { @class = "form-control" }) 5 |
6 |
7 | @Html.LabelFor(m => m.KbqQuestion2.FactorValue, Model.KbqQuestion2.FactorValue) 8 | @Html.PasswordFor(m => m.KbqAnswer2, new { @class = "form-control" }) 9 |
10 | @if (Model.canTrust) 11 | { 12 |
13 |
14 |
15 | @Html.CheckBoxFor(m => m.isTrustedDevice) 16 | @Html.LabelFor(m => m.isTrustedDevice) 17 |
18 |
19 |
20 | } 21 | @if (Model.canTrust) 22 | { 23 |
24 |
25 |
26 | @Html.CheckBoxFor(m => m.isTrustedDevice) 27 | @Html.LabelFor(m => m.isTrustedDevice) 28 |
29 |
30 |
31 | } 32 |
33 | 34 |
35 | -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/Views/Shared/KbqSelect.cshtml: -------------------------------------------------------------------------------- 1 | @model SecureAuth.Sdk.MultiFactorOption 2 | 3 |
4 |
5 | Answer KBQ:  6 | 7 | 8 | 9 | 10 |
11 |
12 | -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/Views/Shared/OathSelect.cshtml: -------------------------------------------------------------------------------- 1 | @model SecureAuth.Sdk.MultiFactorOption 2 | 3 |
4 |
5 | Enter OTP from Device:  6 | @Html.LabelFor(m => m.FactorValue, Model.FactorValue, new { @class = "form-control", aria_describedby = "basic-addon3", @style="background-color:#eee;" }) 7 | 8 | 9 | 10 |
11 |
12 | -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/Views/Shared/PhoneSelect.cshtml: -------------------------------------------------------------------------------- 1 | @model SecureAuth.Sdk.MultiFactorOption 2 | @using SACustomAPI.Models 3 | 4 |
5 |
6 | Deliver OTP to:  7 | @Html.LabelFor(m => m.FactorValue, Model.FactorValue.MaskPhone(), new { @class = "form-control", aria_describedby = "basic-addon3", @style="background-color:#eee" }) 8 | 9 | @if (Model.Capabilities.Contains("call")) 10 | { 11 | 12 | } 13 | @if (Model.Capabilities.Contains("sms")) 14 | { 15 | 16 | } 17 | 18 |
19 |
20 | -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/Views/Shared/PushCheck.cshtml: -------------------------------------------------------------------------------- 1 | @model SACustomAPI.Models.OtpViewModel 2 | 3 |
Login Request sent to device, awaiting response...
4 |
Waiting for Response...
5 | 6 | @if (Model.canTrust) 7 | { 8 |
9 |
10 |
11 | @Html.CheckBoxFor(m => m.isTrustedDevice) 12 | @Html.LabelFor(m => m.isTrustedDevice) 13 |
14 |
15 |
16 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/Views/Shared/PushSelect.cshtml: -------------------------------------------------------------------------------- 1 | @model SecureAuth.Sdk.MultiFactorOption 2 | 3 | @if (Model.Capabilities.Contains("push")) 4 | { 5 | 6 |
7 |
8 | Deliver OTP to:  9 | @Html.LabelFor(m => m.FactorValue, Model.FactorValue, new { @class = "form-control", aria_describedby = "basic-addon3", @style = "background-color:#eee;" }) 10 | 11 | 12 | 13 |
14 |
15 | } 16 | 17 | @if (Model.Capabilities.Contains("push_accept")) 18 | { 19 |
20 |
21 | Send Login Request to:  22 | @Html.LabelFor(m => m.FactorValue, Model.FactorValue, new { @class = "form-control", aria_describedby = "basic-addon3", @style = "background-color:#eee;" }) 23 | 24 | 25 | 26 |
27 |
28 | } 29 | 30 | 31 | -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | @ViewBag.Title - SecureAuth Custom API Test Application 7 | @Styles.Render("~/Content/css") 8 | @Scripts.Render("~/bundles/modernizr") 9 | 10 | 11 | 23 |
24 | @RenderBody() 25 |
26 |
27 |

© @DateTime.Now.Year - SecureAuth Custom API Test Applicaiton

28 |
29 |
30 | 31 | @Scripts.Render("~/bundles/jquery") 32 | @Scripts.Render("~/bundles/bootstrap") 33 | @RenderSection("scripts", required: false) 34 | 35 | 36 | -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } 4 | -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/Web.Debug.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/Web.Release.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SecureAuthCorp/saidp-sdk-csharp/6d6c0405ec0a26ecdbe1cabd6dd15bcc6e773002/SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/favicon.ico -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SecureAuthCorp/saidp-sdk-csharp/6d6c0405ec0a26ecdbe1cabd6dd15bcc6e773002/SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SecureAuthCorp/saidp-sdk-csharp/6d6c0405ec0a26ecdbe1cabd6dd15bcc6e773002/SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SecureAuthCorp/saidp-sdk-csharp/6d6c0405ec0a26ecdbe1cabd6dd15bcc6e773002/SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SecureAuthCorp/saidp-sdk-csharp/6d6c0405ec0a26ecdbe1cabd6dd15bcc6e773002/SecureAuth.Sdk.Examples/SACustomAPI/SACustomAPI/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /SecureAuth.Sdk.UnitTests/EnvironmentBehavioralBiometricsServiceTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace SecureAuth.Sdk.UnitTests 9 | { 10 | public class EnvironmentBehavioralBiometricsServiceTest 11 | { 12 | // Globals 13 | public ISecureAuthService secAuthSvc; 14 | public string goodUsername; 15 | public string fieldName; 16 | public string fieldType; 17 | public string deviceType; 18 | public string behaviorProfile; 19 | public string hostAddress; 20 | public string userAgent; 21 | 22 | public EnvironmentBehavioralBiometricsServiceTest() 23 | { 24 | goodUsername = ConfigurationManager.AppSettings["BehBioSvc.goodUsername"]; 25 | fieldName = ConfigurationManager.AppSettings["BehBioSvc.fieldName"]; 26 | fieldType = ConfigurationManager.AppSettings["BehBioSvc.fieldType"]; 27 | deviceType = ConfigurationManager.AppSettings["BehBioSvc.deviceType"]; 28 | behaviorProfile = ConfigurationManager.AppSettings["BehBioSvc.behaviorProfile"]; 29 | hostAddress = ConfigurationManager.AppSettings["BehBioSvc.hostAddress"]; 30 | userAgent = ConfigurationManager.AppSettings["BehBioSvc.userAgent"]; 31 | 32 | string secureAuthRealm = ConfigurationManager.AppSettings["SecureAuthRealmUrl"]; 33 | string apiId = ConfigurationManager.AppSettings["ApiID"]; 34 | string apiKey = ConfigurationManager.AppSettings["ApiKey"]; 35 | 36 | // Init the SecureAuthService 37 | Configuration config = new Configuration(secureAuthRealm, apiId, apiKey); 38 | secAuthSvc = new SecureAuthService(config); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /SecureAuth.Sdk.UnitTests/EnvironmentDeviceFingerprintServiceTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace SecureAuth.Sdk.UnitTests 9 | { 10 | public class EnvironmentDeviceFingerprintServiceTest 11 | { 12 | // Globals 13 | public ISecureAuthService secAuthSvc; 14 | public string goodUsername1; 15 | public string goodUsername2; 16 | 17 | public EnvironmentDeviceFingerprintServiceTest() 18 | { 19 | // Grab values from app.config 20 | goodUsername1 = ConfigurationManager.AppSettings["DeviceFingerprintSvc.goodUsername1"]; 21 | goodUsername2 = ConfigurationManager.AppSettings["DeviceFingerprintSvc.goodUsername2"]; 22 | 23 | string secureAuthRealm = ConfigurationManager.AppSettings["SecureAuthRealmUrl"]; 24 | string apiId = ConfigurationManager.AppSettings["ApiID"]; 25 | string apiKey = ConfigurationManager.AppSettings["ApiKey"]; 26 | 27 | // Init the SecureAuthService 28 | Configuration config = new Configuration(secureAuthRealm, apiId, apiKey); 29 | secAuthSvc = new SecureAuthService(config); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /SecureAuth.Sdk.UnitTests/EnvironmentGroupServiceTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace SecureAuth.Sdk.UnitTests 9 | { 10 | public class EnvironmentGroupServiceTest 11 | { 12 | // Globals 13 | public ISecureAuthService secAuthSvc; 14 | public string goodDomain; 15 | public string badDomain; 16 | public string goodUserId; 17 | public string badUserId; 18 | public string groupName1; 19 | public string groupName2; 20 | 21 | public EnvironmentGroupServiceTest() 22 | { 23 | // Grab values from app.config 24 | goodUserId = ConfigurationManager.AppSettings["GroupSvc.goodUserId"]; 25 | badUserId = ConfigurationManager.AppSettings["GroupSvc.badUserId"]; 26 | groupName1 = ConfigurationManager.AppSettings["GroupSvc.groupName1"]; 27 | groupName2 = ConfigurationManager.AppSettings["GroupSvc.groupName2"]; 28 | badDomain = ConfigurationManager.AppSettings["GroupSvc.badDomain"]; 29 | goodDomain = ConfigurationManager.AppSettings["GroupSvc.goodDomain"]; 30 | 31 | string secureAuthRealm = ConfigurationManager.AppSettings["SecureAuthRealmUrl"]; 32 | string apiId = ConfigurationManager.AppSettings["ApiID"]; 33 | string apiKey = ConfigurationManager.AppSettings["ApiKey"]; 34 | 35 | // Init the SecureAuthService 36 | Configuration config = new Configuration(secureAuthRealm, apiId, apiKey); 37 | secAuthSvc = new SecureAuthService(config); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /SecureAuth.Sdk.UnitTests/GroupServiceTest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.VisualStudio.TestTools.UnitTesting; 3 | 4 | namespace SecureAuth.Sdk.UnitTests 5 | { 6 | [TestClass] 7 | public class GroupServiceTest 8 | { 9 | static EnvironmentGroupServiceTest env; 10 | 11 | [ClassInitialize] 12 | public static void Init(TestContext testContext) 13 | { 14 | env = new EnvironmentGroupServiceTest(); 15 | } 16 | 17 | [TestMethod] 18 | public void ValidateAddUserToGroupQueryStringTest() 19 | { 20 | BaseResponse res = env.secAuthSvc.GroupService.AddUserToGroupQueryString(env.groupName1, env.goodUserId, env.goodDomain); 21 | Assert.AreEqual(Constants.ResponseStatus.Success, res.Status); 22 | } 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /SecureAuth.Sdk.UnitTests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("SecureAuth.Sdk.UnitTests")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SecureAuth.Sdk.UnitTests")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("b5995a75-cb46-408e-85e4-20efd1952cf0")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /SecureAuth.Sdk.UnitTests/SecureAuth.Sdk.UnitTests.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SecureAuthCorp/saidp-sdk-csharp/6d6c0405ec0a26ecdbe1cabd6dd15bcc6e773002/SecureAuth.Sdk.UnitTests/SecureAuth.Sdk.UnitTests.snk -------------------------------------------------------------------------------- /SecureAuth.Sdk.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 12.00 2 | # Visual Studio 14 3 | VisualStudioVersion = 14.0.25123.0 4 | MinimumVisualStudioVersion = 10.0.40219.1 5 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SecureAuth.Sdk", "SecureAuth.Sdk\SecureAuth.Sdk.csproj", "{2D72D9F4-321F-4720-BCF3-BB254C08CBB7}" 6 | EndProject 7 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SecureAuth.Sdk.UnitTests", "SecureAuth.Sdk.UnitTests\SecureAuth.Sdk.UnitTests.csproj", "{B5995A75-CB46-408E-85E4-20EFD1952CF0}" 8 | EndProject 9 | Global 10 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 11 | Debug|Any CPU = Debug|Any CPU 12 | Release|Any CPU = Release|Any CPU 13 | EndGlobalSection 14 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 15 | {2D72D9F4-321F-4720-BCF3-BB254C08CBB7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 16 | {2D72D9F4-321F-4720-BCF3-BB254C08CBB7}.Debug|Any CPU.Build.0 = Debug|Any CPU 17 | {2D72D9F4-321F-4720-BCF3-BB254C08CBB7}.Release|Any CPU.ActiveCfg = Release|Any CPU 18 | {2D72D9F4-321F-4720-BCF3-BB254C08CBB7}.Release|Any CPU.Build.0 = Release|Any CPU 19 | {B5995A75-CB46-408E-85E4-20EFD1952CF0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 20 | {B5995A75-CB46-408E-85E4-20EFD1952CF0}.Debug|Any CPU.Build.0 = Debug|Any CPU 21 | {B5995A75-CB46-408E-85E4-20EFD1952CF0}.Release|Any CPU.ActiveCfg = Release|Any CPU 22 | {B5995A75-CB46-408E-85E4-20EFD1952CF0}.Release|Any CPU.Build.0 = Release|Any CPU 23 | EndGlobalSection 24 | GlobalSection(SolutionProperties) = preSolution 25 | HideSolutionNode = FALSE 26 | EndGlobalSection 27 | EndGlobal 28 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/AccessHistoryService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace SecureAuth.Sdk 4 | { 5 | public class AccessHistoryService : IAccessHistoryService 6 | { 7 | private readonly ApiClient _apiClient; 8 | private string apiVersion = "v2"; 9 | 10 | protected internal AccessHistoryService(ApiClient apiClient) 11 | { 12 | this._apiClient = apiClient; 13 | } 14 | 15 | /// 16 | /// Creates an Access History record on the specified 17 | /// user's profile. 18 | /// 19 | /// AccessHistory Request object. 20 | /// BaseResponse 21 | public BaseResponse CreateAccessHistory(AccessHistoryRequest request) 22 | { 23 | // sanitize request 24 | if (string.IsNullOrEmpty(request.UserId)) 25 | { 26 | throw new ArgumentNullException("AccessHistoryRequest.UserId", "User ID cannot be empty."); 27 | } 28 | if (string.IsNullOrEmpty(request.IpAddress)) 29 | { 30 | throw new ArgumentNullException("AccessHistoryRequest.IpAddress", "IP Address cannot be empty."); 31 | } 32 | 33 | return this._apiClient.Post("/api/" + apiVersion + "/accesshistory", request); 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk/AdaptiveAuthService.cs: -------------------------------------------------------------------------------- 1 | using SecureAuth.Sdk.Models; 2 | using System; 3 | 4 | namespace SecureAuth.Sdk 5 | { 6 | public class AdaptiveAuthService : IAdaptiveAuthService 7 | { 8 | private readonly ApiClient _apiClient; 9 | 10 | protected internal AdaptiveAuthService(ApiClient apiClient) 11 | { 12 | this._apiClient = apiClient; 13 | } 14 | 15 | /// 16 | /// Runs analyze engine over request parameters to determine 17 | /// risk and suggested action. 18 | /// 19 | /// Adaptive Auth Request object. 20 | /// AdaptiveAuthResponse 21 | public AdaptiveAuthResponse RunAdaptiveAuth(AdaptiveAuthRequest request, bool errorOnAccountStatus = false) 22 | { 23 | 24 | // sanitize request 25 | if (string.IsNullOrEmpty(request.UserId)) 26 | { 27 | throw new ArgumentNullException("AdaptiveAuthRequest.UserId", "User ID cannot be empty."); 28 | } 29 | 30 | string apiVersion = errorOnAccountStatus ? ApiVersion.V1.Value : ApiVersion.V2.Value; 31 | 32 | return this._apiClient.Post("/api/" + apiVersion + "/adaptauth", request); 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk/Configuration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace SecureAuth.Sdk 4 | { 5 | public class Configuration 6 | { 7 | private string _secureAuthRealmUrl; 8 | public string SecureAuthRealmUrl 9 | { 10 | get { return this._secureAuthRealmUrl; } 11 | set { this._secureAuthRealmUrl = value.TrimEnd(new char[] {'/'}); } 12 | } 13 | 14 | public string AppId { get; set; } 15 | public string AppKey { get; set; } 16 | public bool BypassCertValidation { get; set; } 17 | 18 | public Configuration() 19 | { 20 | } 21 | 22 | public Configuration(string secureAuthRealmUrl, string appId, string appKey, bool isDevelopment = false) 23 | { 24 | if (secureAuthRealmUrl == null) 25 | { 26 | throw new ArgumentNullException("secureAuthRealmUrl", "A SecureAuth realm URL is required."); 27 | } 28 | if (string.IsNullOrEmpty(appId)) 29 | { 30 | throw new ArgumentNullException("appId", "An application ID is required."); 31 | } 32 | if (string.IsNullOrEmpty(appKey)) 33 | { 34 | throw new ArgumentNullException("appKey", "An application key is required."); 35 | } 36 | 37 | this._secureAuthRealmUrl = secureAuthRealmUrl.TrimEnd(new char[] { '/' }); 38 | this.AppId = appId; 39 | this.AppKey = appKey; 40 | this.BypassCertValidation = isDevelopment; 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk/HashTool.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Security.Cryptography; 3 | using System.Text; 4 | 5 | namespace SecureAuth.Sdk 6 | { 7 | internal class HashTool 8 | { 9 | internal static string SHA256HashToBase64(string key, string value) 10 | { 11 | string result = ""; 12 | var keyBytes = HexStringToByteArray(key); 13 | var valueBytes = Encoding.UTF8.GetBytes(value); 14 | 15 | using (var hmac = new HMACSHA256(keyBytes)) 16 | { 17 | var hash = hmac.ComputeHash(valueBytes); 18 | result = Convert.ToBase64String(hash); 19 | } 20 | return result; 21 | } 22 | 23 | internal static string SHA256HashToHex(string key, string value) 24 | { 25 | string result = ""; 26 | var keyBytes = HexStringToByteArray(key); 27 | var valueBytes = Encoding.UTF8.GetBytes(value); 28 | 29 | using (var hmac = new HMACSHA256(keyBytes)) 30 | { 31 | var hash = hmac.ComputeHash(valueBytes); 32 | result = BitConverter.ToString(hash).Replace("-", ""); 33 | } 34 | return result; 35 | } 36 | 37 | internal static byte[] HexStringToByteArray(String hex) 38 | { 39 | int numberChars = hex.Length; 40 | byte[] bytes = new byte[numberChars / 2]; 41 | for (int i = 0; i < numberChars; i += 2) 42 | bytes[i / 2] = Convert.ToByte(hex.Substring(i, 2), 16); 43 | return bytes; 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk/HmacSigningHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net.Http; 3 | using System.Net.Http.Headers; 4 | using System.Text; 5 | using System.Threading; 6 | using System.Threading.Tasks; 7 | 8 | namespace SecureAuth.Sdk 9 | { 10 | public class HmacSigningHandler : WebRequestHandler 11 | { 12 | public string AppId { get; set; } 13 | public string AppKey { get; set; } 14 | 15 | public HmacSigningHandler() 16 | { 17 | } 18 | 19 | public HmacSigningHandler(string appId, string appKey) 20 | { 21 | AppId = appId; 22 | AppKey = appKey; 23 | } 24 | 25 | protected override Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) 26 | { 27 | request.Headers.Date = DateTimeOffset.UtcNow; 28 | var hash = HmacBasicAuthenticationHelper.BuildAuthorizationHeaderParameter(AppId, AppKey, request); 29 | 30 | var headerValue = Convert.ToBase64String(Encoding.UTF8.GetBytes(string.Format("{0}:{1}", AppId, hash))); 31 | var header = new AuthenticationHeaderValue("Basic", headerValue); 32 | 33 | request.Headers.Authorization = header; 34 | 35 | return base.SendAsync(request, cancellationToken); 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk/IAccessHistoryService.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Sdk 2 | { 3 | public interface IAccessHistoryService 4 | { 5 | BaseResponse CreateAccessHistory(AccessHistoryRequest request); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/IAdaptiveAuthService.cs: -------------------------------------------------------------------------------- 1 | using SecureAuth.Sdk.Models; 2 | 3 | namespace SecureAuth.Sdk 4 | { 5 | public interface IAdaptiveAuthService 6 | { 7 | AdaptiveAuthResponse RunAdaptiveAuth(AdaptiveAuthRequest request, bool errorOnAccountStatus = false); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/IBehavioralBiometricsService.cs: -------------------------------------------------------------------------------- 1 | using SecureAuth.Sdk.Requests; 2 | using SecureAuth.Sdk.Responses; 3 | 4 | namespace SecureAuth.Sdk 5 | { 6 | public interface IBehavioralBiometricsService 7 | { 8 | BiometricsJavascriptLinkResponse GetBehavioralBioJavascriptLink(); 9 | BaseResponse SendBehavioralBio(SendBehavioralBioRequest request); 10 | BaseResponse ResetBehavioralBio(ResetBehavioralBioRequest request); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/IDeviceFingerprintService.cs: -------------------------------------------------------------------------------- 1 | using SecureAuth.Sdk.Responses; 2 | 3 | namespace SecureAuth.Sdk 4 | { 5 | public interface IDeviceFingerprintService 6 | { 7 | DfpJavascriptLinkResponse GetDfpJavascriptLink(); 8 | DfpResponse ValidateDfp(ValidateDfpRequest request); 9 | DfpResponse ConfirmDfp(ConfirmDfpRequest request); 10 | DfpResponse ScoreDfp(ScoreDfpRequest request); 11 | DfpResponse SaveDfp(SaveDfpRequest request); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/IGroupService.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Sdk 2 | { 3 | public interface IGroupService 4 | { 5 | BaseResponse AddUserToGroup(string groupName, string userId, string domain = ""); 6 | GroupAssociateResponse AddUsersToGroup(string groupName, GroupAssociateRequest request); 7 | BaseResponse AddUserToGroupQueryString(string groupName, string userId, string domain = ""); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/IIpEvaluationService.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Sdk 2 | { 3 | public interface IIpEvaluationService 4 | { 5 | IpRiskResponse GetIpRisk(IpRiskRequest request); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/INumberProfileService.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Sdk 2 | { 3 | public interface INumberProfileService 4 | { 5 | NumberProfileResponse EvaluatePhoneNumber(string userId, string phoneNumber); 6 | NumberProfileResponse EvaluatePhoneNumber(NumberProfileRequest request); 7 | BaseResponse UpdateOriginalCarrier(string userId, string phoneNumber, CurrentCarrier carrier); 8 | BaseResponse UpdateOriginalCarrier(NumberProfileRequest request); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/ISecureAuthService.cs: -------------------------------------------------------------------------------- 1 | namespace SecureAuth.Sdk 2 | { 3 | public interface ISecureAuthService 4 | { 5 | Configuration Configuration { get; set; } 6 | string AppId { get; set; } 7 | string AppKey { get; set; } 8 | string SecureAuthRealmUrl { get; set; } 9 | IUserService User { get; } 10 | IAuthenticationService Authenticate { get; } 11 | INumberProfileService NumberProfile { get; } 12 | IIpEvaluationService EvaluateIp { get; } 13 | IDeviceFingerprintService DeviceFingerprint { get; } 14 | IBehavioralBiometricsService BehavioralBiometricsService { get; } 15 | IAccessHistoryService AccessHistory { get; } 16 | IAdaptiveAuthService AdaptiveAuth { get; } 17 | IGroupService GroupService { get; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/IUserService.cs: -------------------------------------------------------------------------------- 1 | using SecureAuth.Sdk.Models; 2 | 3 | namespace SecureAuth.Sdk 4 | { 5 | public interface IUserService 6 | { 7 | GetFactorsResponse GetFactors(string userId, string domain = "", bool errorOnAccountStatus = false); 8 | GetUserProfileResponse GetUserProfile(string userId, string domain = ""); 9 | BaseResponse UpdateUserProfile(string userId, UpdateUserProfileRequest request, string domain = ""); 10 | BaseResponse CreateUser(CreateUserRequest request); 11 | BaseResponse ChangePassword(string userId, ChangePasswordRequest request, string domain = ""); 12 | BaseResponse ResetPassword(string userId, ResetPasswordRequest request, string domain = "", bool errorOnAccountStatus = false); 13 | BaseResponse AddUserToGroup(string userId, string groupName, string domain = ""); 14 | GroupAssociateResponse AddGroupsToUser(string userId, GroupAssociateRequest request, string domain = ""); 15 | ThrottleResponse GetThrottleCount(string userId, string domain = ""); 16 | ThrottleResponse ResetThrottleCount(string userId, string domain = ""); 17 | ThrottleResponse GetOTPThrottleCount(string userId, string domain = ""); 18 | ThrottleResponse ResetOTPThrottleCount(string userId, string domain = ""); 19 | GetFactorsResponse GetUserFactorsQueryString(string userId, string domain = "", bool errorOnAccountStatus = false); 20 | GroupAssociateResponse AddGroupsToUserQueryString(string userId, GroupAssociateRequest request, string domain = ""); 21 | BaseResponse AddUserToGroupQueryString(string groupName, string userId, string domain = ""); 22 | UserStatusResponse GetUserStatus(string userId, string domain = ""); 23 | BaseResponse SetUserStatus(string userId, SetUserStatusRequest request, string domain = ""); 24 | UserStatusResponse GetUserStatusQueryString(string userId, string domain = ""); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/IpEvaluationService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace SecureAuth.Sdk 4 | { 5 | public class IpEvaluationService : IIpEvaluationService 6 | { 7 | private readonly ApiClient _apiClient; 8 | 9 | protected internal IpEvaluationService(ApiClient apiClient) 10 | { 11 | this._apiClient = apiClient; 12 | } 13 | 14 | /// 15 | /// Retrieves risk and geolocation information for 16 | /// the IP address provided in the request. 17 | /// 18 | /// IpRiskRequest 19 | /// IpRiskResponse 20 | public IpRiskResponse GetIpRisk(IpRiskRequest request) 21 | { 22 | // sanitize request 23 | if (string.IsNullOrEmpty(request.IpAddress)) 24 | { 25 | throw new ArgumentNullException("IpRiskRequest.IpAddress", "IP Address cannot be empty."); 26 | } 27 | 28 | return this._apiClient.Post("/api/v1/ipeval", request); 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk/JsonSerializer.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Runtime.Serialization.Json; 3 | using System.Text; 4 | 5 | namespace SecureAuth.Sdk 6 | { 7 | internal static class JsonSerializer 8 | { 9 | internal static string Serialize(object model) 10 | { 11 | DataContractJsonSerializer ser = new DataContractJsonSerializer(model.GetType(), new DataContractJsonSerializerSettings() 12 | { 13 | UseSimpleDictionaryFormat = true 14 | }); 15 | MemoryStream ms = new MemoryStream(); 16 | ser.WriteObject(ms, model); 17 | string jsonString = Encoding.UTF8.GetString(ms.ToArray()); 18 | ms.Close(); 19 | return jsonString; 20 | } 21 | 22 | internal static T Deserialize(string jsonString) 23 | { 24 | DataContractJsonSerializerSettings settings = new DataContractJsonSerializerSettings(); 25 | settings.UseSimpleDictionaryFormat = true; 26 | 27 | DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(T), settings); 28 | MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(jsonString)); 29 | T obj = (T)ser.ReadObject(ms); 30 | return obj; 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk/Models/AccessHistory.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk 4 | { 5 | [DataContract] 6 | public class AccessHistory 7 | { 8 | [DataMember(Name = "userAgent")] 9 | public string UserAgent { get; set; } 10 | 11 | [DataMember(Name = "ipAddress")] 12 | public string IpAddress { get; set; } 13 | 14 | [DataMember(Name = "timeStamp")] 15 | public string TimeStamp { get; set; } 16 | 17 | [DataMember(Name = "authState")] 18 | public string AuthState { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/Models/ApiVersion.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace SecureAuth.Sdk.Models 8 | { 9 | public class ApiVersion 10 | { 11 | private ApiVersion(string value) { Value = value; } 12 | 13 | public string Value { get; private set; } 14 | 15 | public static ApiVersion V1 { get { return new ApiVersion("v1"); } } 16 | public static ApiVersion V2 { get { return new ApiVersion("v2"); } } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/Models/BiometricType.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk.Models 4 | { 5 | [DataContract(Name = "biometricType")] 6 | public class BiometricType 7 | { 8 | [DataMember(Name = "push_accept_details", EmitDefaultValue = false)] 9 | public PushAcceptDetails PushAcceptDetails { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/Models/Factoring.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk 4 | { 5 | [DataContract(Name = "factoring")] 6 | public class Factoring 7 | { 8 | [DataMember(Name = "latitude", EmitDefaultValue = false)] 9 | public double? Latitude { get; set; } 10 | 11 | [DataMember(Name = "longitude", EmitDefaultValue = false)] 12 | public double? Longitude { get; set; } 13 | 14 | [DataMember(Name = "threatType", EmitDefaultValue = false)] 15 | public int? ThreatType { get; set; } 16 | 17 | [DataMember(Name = "threatCategory", EmitDefaultValue = false)] 18 | public int? ThreatCategory { get; set; } 19 | } 20 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk/Models/FingerprintWrapper.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk.Models 4 | { 5 | [DataContract] 6 | public class FingerprintWrapper 7 | { 8 | [DataMember(Name = "fingerprint", EmitDefaultValue = false)] 9 | public Fingerprint Fingerprint { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/Models/GeoLocation.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk 4 | { 5 | [DataContract(Name = "geoloc")] 6 | public class GeoLocation 7 | { 8 | [DataMember(Name = "country", EmitDefaultValue = false)] 9 | public string Country { get; set; } 10 | 11 | [DataMember(Name = "country_code", EmitDefaultValue = false)] 12 | public string CountryCode { get; set; } 13 | 14 | [DataMember(Name = "region", EmitDefaultValue = false)] 15 | public string Region { get; set; } 16 | 17 | [DataMember(Name = "region_code", EmitDefaultValue = false)] 18 | public string RegionCode { get; set; } 19 | 20 | [DataMember(Name = "city", EmitDefaultValue = false)] 21 | public string City { get; set; } 22 | 23 | [DataMember(Name = "latitude", EmitDefaultValue = false)] 24 | public double? Latitude { get; set; } 25 | 26 | [DataMember(Name = "longitude", EmitDefaultValue = false)] 27 | public double? Longitude { get; set; } 28 | 29 | [DataMember(Name = "internet_service_provider", EmitDefaultValue = false)] 30 | public string InternetServiceProvider { get; set; } 31 | 32 | [DataMember(Name = "organization", EmitDefaultValue = false)] 33 | public string Organization { get; set; } 34 | } 35 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk/Models/IpEvaluation.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk 4 | { 5 | [DataContract(Name = "ip_evaluation")] 6 | public class IpEvaluation 7 | { 8 | [DataMember(Name = "method", EmitDefaultValue = false)] 9 | public string Method { get; set; } 10 | 11 | [DataMember(Name = "ip", EmitDefaultValue = false)] 12 | public string Ip { get; set; } 13 | 14 | [DataMember(Name = "risk_factor", EmitDefaultValue = false)] 15 | public int? RiskFactor { get; set; } 16 | 17 | [DataMember(Name = "risk_color", EmitDefaultValue = false)] 18 | public string RiskColor { get; set; } 19 | 20 | [DataMember(Name = "risk_desc", EmitDefaultValue = false)] 21 | public string RiskDesc { get; set; } 22 | 23 | [DataMember(Name = "geoloc", EmitDefaultValue = false)] 24 | public GeoLocation GeoLocation { get; set; } 25 | 26 | [DataMember(Name = "factoring", EmitDefaultValue = false)] 27 | public Factoring Factoring { get; set; } 28 | 29 | [DataMember(Name = "factor_description", EmitDefaultValue = false)] 30 | public FactorDescription FactorDesctiption { get; set; } 31 | } 32 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk/Models/KbProperty.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk 4 | { 5 | [DataContract] 6 | public class KbProperty 7 | { 8 | public KbProperty() 9 | { 10 | 11 | } 12 | 13 | public KbProperty(string question, string answer) 14 | { 15 | Question = question; 16 | Answer = answer; 17 | } 18 | 19 | [DataMember(Name = "question")] 20 | public string Question { get; set; } 21 | 22 | [DataMember(Name = "answer")] 23 | public string Answer { get; set; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/Models/MultiFactorOption.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Runtime.Serialization; 3 | 4 | namespace SecureAuth.Sdk 5 | { 6 | [DataContract] 7 | public class MultiFactorOption 8 | { 9 | [DataMember(Name = "type")] 10 | public string FactorType { get; set; } 11 | 12 | [DataMember(Name = "id", EmitDefaultValue = false)] 13 | public string FactorId { get; set; } 14 | 15 | [DataMember(Name = "value", EmitDefaultValue = false)] 16 | public string FactorValue { get; set; } 17 | 18 | [DataMember(Name = "biometricTypes", EmitDefaultValue = false)] 19 | public List BiometricTypes { get; set; } 20 | 21 | [DataMember(Name = "capabilities", EmitDefaultValue = false)] 22 | public List Capabilities { get; set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/Models/PushAcceptDetails.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk.Models 4 | { 5 | [DataContract(Name = "push_accept_details")] 6 | public class PushAcceptDetails 7 | { 8 | [DataMember(Name = "company_name", EmitDefaultValue = false)] 9 | public string CompanyName { get; set; } 10 | 11 | [DataMember(Name = "application_description", EmitDefaultValue = false)] 12 | public string ApplicationDescription { get; set; } 13 | 14 | [DataMember(Name = "enduser_ip", EmitDefaultValue = false)] 15 | public string EndUserIp { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/Models/TouchSupport.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk.Models 4 | { 5 | [DataContract(Name = "touchSupport")] 6 | public class TouchSupport 7 | { 8 | [DataMember(Name = "maxTouchPoints", EmitDefaultValue = false)] 9 | public int MaxTouchPoints { get; set; } 10 | 11 | [DataMember(Name = "touchEvent", EmitDefaultValue = false)] 12 | public bool TouchEvent { get; set; } 13 | 14 | [DataMember(Name = "touchStart", EmitDefaultValue = false)] 15 | public bool TouchStart { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/Models/UaBrowser.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk.Models 4 | { 5 | [DataContract(Name = "uaBrowser")] 6 | public class UaBrowser 7 | { 8 | [DataMember(Name = "name", EmitDefaultValue = false)] 9 | public string Name { get; set; } 10 | 11 | [DataMember(Name = "version", EmitDefaultValue = false)] 12 | public string Version { get; set; } 13 | 14 | [DataMember(Name = "major", EmitDefaultValue = false)] 15 | public string Major { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/Models/UaCpu.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk.Models 4 | { 5 | [DataContract(Name = "uaCPU")] 6 | public class UaCpu 7 | { 8 | [DataMember(Name = "architecture", EmitDefaultValue = false)] 9 | public string Architecture { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/Models/UaDevice.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk.Models 4 | { 5 | [DataContract(Name = "uaDevice")] 6 | public class UaDevice 7 | { 8 | [DataMember(Name = "model", EmitDefaultValue = false)] 9 | public string Model { get; set; } 10 | 11 | [DataMember(Name = "type", EmitDefaultValue = false)] 12 | public string Type { get; set; } 13 | 14 | [DataMember(Name = "vendor", EmitDefaultValue = false)] 15 | public string Vendor { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/Models/UaEngine.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk.Models 4 | { 5 | [DataContract(Name = "uaEngine")] 6 | public class UaEngine 7 | { 8 | [DataMember(Name = "name", EmitDefaultValue = false)] 9 | public string Name { get; set; } 10 | 11 | [DataMember(Name = "version", EmitDefaultValue = false)] 12 | public string Version { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/Models/UaOs.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk.Models 4 | { 5 | [DataContract(Name = "uaOS")] 6 | public class UaOs 7 | { 8 | [DataMember(Name = "name", EmitDefaultValue = false)] 9 | public string Name { get; set; } 10 | 11 | [DataMember(Name = "version", EmitDefaultValue = false)] 12 | public string Version { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/Models/UserProfileProperty.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk 4 | { 5 | [DataContract] 6 | public class UserProfileProperty 7 | { 8 | [DataMember(Name = "value")] 9 | public string Value { get; set; } 10 | 11 | [DataMember(Name = "isWritable")] 12 | public bool IsWritable { get; set; } 13 | 14 | [DataMember(Name = "displayName", EmitDefaultValue = false)] 15 | public string DisplayName { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/Requests/AccessHistoryRequest.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk 4 | { 5 | [DataContract] 6 | public class AccessHistoryRequest : BaseRequest 7 | { 8 | [DataMember(Name = "ip_address", EmitDefaultValue = false)] 9 | public string IpAddress { get; set; } 10 | 11 | public AccessHistoryRequest() 12 | { 13 | } 14 | 15 | public AccessHistoryRequest(string userId, string ipAddress) 16 | : base(userId, "") 17 | { 18 | this.IpAddress = ipAddress; 19 | } 20 | 21 | public AccessHistoryRequest(string userId, string ipAddress, string domain = "") 22 | : base(userId, "", domain) 23 | { 24 | this.IpAddress = ipAddress; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/Requests/AdHocEmailLinkOtpRequest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.Serialization; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace SecureAuth.Sdk 9 | { 10 | [DataContract] 11 | public class AdHocEmailLinkOtpRequest : BaseRequest 12 | { 13 | public AdHocEmailLinkOtpRequest() 14 | { 15 | this.Type = "email_link"; 16 | } 17 | 18 | public AdHocEmailLinkOtpRequest(string userId, string emailAddress) 19 | : base(userId, "email_link") 20 | { 21 | Token = emailAddress; 22 | } 23 | 24 | public AdHocEmailLinkOtpRequest(string userId, string emailAddress, string domain = "") 25 | : base(userId, "email_link", domain) 26 | { 27 | Token = emailAddress; 28 | } 29 | 30 | [DataMember(Name = "token")] 31 | public string Token { get; set; } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/Requests/AdHocEmailOtpRequest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.Serialization; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace SecureAuth.Sdk 9 | { 10 | [DataContract] 11 | public class AdHocEmailOtpRequest : BaseRequest 12 | { 13 | public AdHocEmailOtpRequest() 14 | { 15 | this.Type = "email"; 16 | } 17 | 18 | public AdHocEmailOtpRequest(string userId, string emailAddress) 19 | : base(userId, "email") 20 | { 21 | Token = emailAddress; 22 | } 23 | 24 | public AdHocEmailOtpRequest(string userId, string emailAddress, string domain = "") 25 | : base(userId, "email", domain) 26 | { 27 | Token = emailAddress; 28 | } 29 | 30 | [DataMember(Name = "token")] 31 | public string Token { get; set; } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/Requests/AdHocPhonecallOtpRequest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.Serialization; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace SecureAuth.Sdk 9 | { 10 | [DataContract] 11 | public class AdHocPhonecallOtpRequest : BaseRequest 12 | { 13 | public AdHocPhonecallOtpRequest() 14 | { 15 | this.Type = "call"; 16 | } 17 | 18 | public AdHocPhonecallOtpRequest(string userId, string phoneNumber) 19 | : base(userId, "call") 20 | { 21 | Token = phoneNumber; 22 | } 23 | 24 | public AdHocPhonecallOtpRequest(string userId, string phoneNumber, string domain = "") 25 | : base(userId, "call", domain) 26 | { 27 | Token = phoneNumber; 28 | } 29 | 30 | [DataMember(Name = "token")] 31 | public string Token { get; set; } 32 | 33 | [DataMember(Name = "evaluate_number")] 34 | public bool EvaluateNumber { get; set; } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/Requests/AdHocSmsLinkOtpRequest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.Serialization; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace SecureAuth.Sdk 9 | { 10 | [DataContract] 11 | public class AdHocSmsLinkOtpRequest : BaseRequest 12 | { 13 | public AdHocSmsLinkOtpRequest() 14 | { 15 | this.Type = "sms_link"; 16 | } 17 | 18 | public AdHocSmsLinkOtpRequest(string userId, string phoneNumber) 19 | : base(userId, "sms_link") 20 | { 21 | Token = phoneNumber; 22 | } 23 | 24 | public AdHocSmsLinkOtpRequest(string userId, string phoneNumber, string domain = "") 25 | : base(userId, "sms_link", domain) 26 | { 27 | Token = phoneNumber; 28 | } 29 | 30 | [DataMember(Name = "token")] 31 | public string Token { get; set; } 32 | 33 | [DataMember(Name = "evaluate_number")] 34 | public bool EvaluateNumber { get; set; } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/Requests/AdHocSmsOtpRequest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.Serialization; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace SecureAuth.Sdk 9 | { 10 | [DataContract] 11 | public class AdHocSmsOtpRequest : BaseRequest 12 | { 13 | public AdHocSmsOtpRequest() 14 | { 15 | this.Type = "sms"; 16 | } 17 | 18 | public AdHocSmsOtpRequest(string userId, string phoneNumber) 19 | : base(userId, "sms") 20 | { 21 | Token = phoneNumber; 22 | } 23 | 24 | public AdHocSmsOtpRequest(string userId, string phoneNumber, string domain = "") 25 | : base(userId, "sms", domain) 26 | { 27 | Token = phoneNumber; 28 | } 29 | 30 | [DataMember(Name = "token")] 31 | public string Token { get; set; } 32 | 33 | [DataMember(Name = "evaluate_number")] 34 | public bool EvaluateNumber { get; set; } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/Requests/AdaptiveAuthRequest.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Runtime.Serialization; 3 | 4 | namespace SecureAuth.Sdk 5 | { 6 | [DataContract] 7 | public class AdaptiveAuthRequest : BaseRequest 8 | { 9 | [DataMember(Name = "parameters", EmitDefaultValue = false)] 10 | public Dictionary Parameters { get; set; } 11 | 12 | public AdaptiveAuthRequest() 13 | { 14 | } 15 | 16 | public AdaptiveAuthRequest(string userId, Dictionary parameters) 17 | : base(userId, "") 18 | { 19 | this.Parameters = parameters; 20 | } 21 | 22 | public AdaptiveAuthRequest(string userId, Dictionary parameters, string domain = "") 23 | : base(userId, "", domain) 24 | { 25 | this.Parameters = parameters; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/Requests/BaseRequest.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk 4 | { 5 | [DataContract] 6 | public class BaseRequest 7 | { 8 | [DataMember(Name = "domain")] 9 | public string Domain { get; set; } 10 | 11 | [DataMember(Name = "user_id", EmitDefaultValue = false)] 12 | public string UserId { get; set; } 13 | 14 | [DataMember(Name = "type", EmitDefaultValue = false)] 15 | public string Type { get; set; } 16 | 17 | public BaseRequest() 18 | { 19 | } 20 | 21 | public BaseRequest(string userId, string type, string domain = "") 22 | { 23 | this.UserId = userId; 24 | this.Type = type; 25 | this.Domain = string.IsNullOrEmpty(Domain) ? string.Empty : Domain; 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk/Requests/ChangePasswordRequest.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk 4 | { 5 | [DataContract] 6 | public class ChangePasswordRequest : BaseRequest 7 | { 8 | [DataMember(Name = "currentPassword")] 9 | public string CurrentPassword { get; set; } 10 | 11 | [DataMember(Name = "newPassword")] 12 | public string NewPassword { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/Requests/ConfirmDfpRequest.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk 4 | { 5 | [DataContract] 6 | public class ConfirmDfpRequest : BaseRequest 7 | { 8 | [DataMember(Name = "fingerprint_id", EmitDefaultValue = false)] 9 | public string FingerprintId { get; set; } 10 | } 11 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk/Requests/CreateUserRequest.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Runtime.Serialization; 3 | 4 | namespace SecureAuth.Sdk 5 | { 6 | [DataContract] 7 | public class CreateUserRequest : BaseRequest 8 | { 9 | [DataMember(Name = "userId")] 10 | public string UserId { get; set; } 11 | 12 | [DataMember(Name = "password")] 13 | public string Password { get; set; } 14 | 15 | [DataMember(Name = "properties")] 16 | public IDictionary Properties { get; set; } 17 | 18 | [DataMember(Name = "knowledgeBase")] 19 | public IDictionary KnowledgeBase { get; set; } 20 | 21 | public CreateUserRequest() 22 | { 23 | Properties = new Dictionary(); 24 | KnowledgeBase = new Dictionary(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/Requests/EmailLinkOTPRequest.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk 4 | { 5 | [DataContract] 6 | public class EmailLinkOtpRequest : BaseRequest 7 | { 8 | [DataMember(Name = "factor_id", EmitDefaultValue = false)] 9 | public string FactorId { get; set; } 10 | 11 | public EmailLinkOtpRequest() 12 | { 13 | this.Type = "email_link"; 14 | } 15 | 16 | public EmailLinkOtpRequest(string userId, string factorId) 17 | : base(userId, "email_link") 18 | { 19 | this.FactorId = factorId; 20 | } 21 | 22 | public EmailLinkOtpRequest(string userId, string factorId, string domain = "") 23 | : base(userId, "email_link", domain) 24 | { 25 | this.FactorId = factorId; 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk/Requests/EmailOtpRequest.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk 4 | { 5 | [DataContract] 6 | public class EmailOtpRequest : BaseRequest 7 | { 8 | [DataMember(Name = "factor_id", EmitDefaultValue = false)] 9 | public string FactorId { get; set; } 10 | 11 | public EmailOtpRequest() 12 | { 13 | this.Type = "email"; 14 | } 15 | 16 | public EmailOtpRequest(string userId, string factorId) 17 | : base(userId, "email") 18 | { 19 | this.FactorId = factorId; 20 | } 21 | 22 | public EmailOtpRequest(string userId, string factorId, string domain = "") 23 | : base(userId, "email", domain) 24 | { 25 | this.FactorId = factorId; 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk/Requests/GroupAssociateRequest.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Runtime.Serialization; 3 | 4 | namespace SecureAuth.Sdk 5 | { 6 | [DataContract] 7 | public class GroupAssociateRequest : BaseRequest 8 | { 9 | [DataMember(Name = "groupNames", EmitDefaultValue = false)] 10 | public List GroupNames { get; set; } 11 | 12 | [DataMember(Name = "userIds", EmitDefaultValue = false)] 13 | public List UserIds { get; set; } 14 | 15 | public GroupAssociateRequest() 16 | { 17 | GroupNames = new List(); 18 | UserIds = new List(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/Requests/HelpDeskOtpRequest.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk 4 | { 5 | [DataContract] 6 | public class HelpDeskOtpRequest : BaseRequest 7 | { 8 | [DataMember(Name = "factor_id", EmitDefaultValue = false)] 9 | public string FactorId { get; set; } 10 | 11 | public HelpDeskOtpRequest() 12 | { 13 | this.Type = "help_desk"; 14 | } 15 | 16 | public HelpDeskOtpRequest(string userId, string factorId) 17 | : base(userId, "help_desk") 18 | { 19 | this.FactorId = factorId; 20 | } 21 | 22 | public HelpDeskOtpRequest(string userId, string factorId, string domain = "") 23 | : base(userId, "help_desk", domain) 24 | { 25 | this.FactorId = factorId; 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk/Requests/IpRiskRequest.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk 4 | { 5 | [DataContract] 6 | public class IpRiskRequest : BaseRequest 7 | { 8 | [DataMember(Name = "ip_address", EmitDefaultValue = false)] 9 | public string IpAddress { get; set; } 10 | 11 | public IpRiskRequest() 12 | { 13 | this.Type = "risk"; 14 | } 15 | 16 | public IpRiskRequest(string userId, string ipAddress) 17 | : base(userId, "risk") 18 | { 19 | this.IpAddress = ipAddress; 20 | } 21 | 22 | public IpRiskRequest(string userId, string ipAddress, string domain = "") 23 | : base(userId, "risk", domain) 24 | { 25 | this.IpAddress = ipAddress; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/Requests/NumberProfileRequest.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk 4 | { 5 | [DataContract] 6 | public class NumberProfileRequest : BaseRequest 7 | { 8 | [DataMember(Name ="phone_number", EmitDefaultValue = false)] 9 | public string PhoneNumber { get; set; } 10 | 11 | [DataMember(Name = "ported_status", EmitDefaultValue = false)] 12 | public string PortedStatus { get; set; } 13 | 14 | [DataMember(Name = "carrierInfo", EmitDefaultValue = false)] 15 | public CarrierInfo CarrierInfo { get; set; } 16 | 17 | public NumberProfileRequest() 18 | { 19 | } 20 | public NumberProfileRequest(string userId, string phoneNumber) 21 | { 22 | this.UserId = userId; 23 | this.PhoneNumber = phoneNumber; 24 | } 25 | 26 | } 27 | 28 | [DataContract(Name ="carrierInfo")] 29 | public class CarrierInfo 30 | { 31 | [DataMember(Name = "carrierCode", EmitDefaultValue = false)] 32 | public string CarrierCode { get; set; } 33 | 34 | [DataMember(Name = "carrier", EmitDefaultValue = false)] 35 | public string Carrier { get; set; } 36 | 37 | [DataMember(Name = "countryCode", EmitDefaultValue = false)] 38 | public string CountryCode { get; set; } 39 | 40 | [DataMember(Name = "networkType", EmitDefaultValue = false)] 41 | public string NetworkType { get; set; } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/Requests/OathTokenRequest.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk 4 | { 5 | [DataContract] 6 | public class OathTokenRequest : BaseRequest 7 | { 8 | [DataMember(Name = "password", EmitDefaultValue = false)] 9 | public string Password { get; set; } 10 | 11 | [DataMember(Name = "token", EmitDefaultValue = false)] 12 | public string Token { get; set; } 13 | 14 | [DataMember(Name = "factor_id", EmitDefaultValue = false)] 15 | public string FactorId { get; set; } 16 | 17 | public OathTokenRequest(string domain, string userId, string password, string token, string factorId) 18 | : base(userId, "oath", domain) 19 | { 20 | this.Password = password; 21 | this.Token = token; 22 | this.FactorId = factorId; 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk/Requests/PhonecallOtpRequest.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk 4 | { 5 | [DataContract] 6 | public class PhonecallOtpRequest : BaseRequest 7 | { 8 | [DataMember(Name = "factor_id", EmitDefaultValue = false)] 9 | public string FactorId { get; set; } 10 | 11 | 12 | [DataMember(Name = "evaluate_number", EmitDefaultValue = false)] 13 | public string EvaluateNumber { get; set; } 14 | 15 | public PhonecallOtpRequest() 16 | { 17 | this.Type = "call"; 18 | } 19 | 20 | public PhonecallOtpRequest(string userId, string factorId) 21 | : base(userId, "call") 22 | { 23 | this.FactorId = factorId; 24 | } 25 | 26 | public PhonecallOtpRequest(string userId, string factorId, bool evaluateNumber) 27 | : base(userId, "call") 28 | { 29 | this.FactorId = factorId; 30 | this.EvaluateNumber = evaluateNumber.ToString(); 31 | } 32 | 33 | public PhonecallOtpRequest(string userId, string factorId, bool evaluateNumber, string domain = "") 34 | : base(userId, "call", domain) 35 | { 36 | this.FactorId = factorId; 37 | this.EvaluateNumber = evaluateNumber.ToString(); 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk/Requests/PushAcceptRequest.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | using SecureAuth.Sdk.Models; 3 | 4 | namespace SecureAuth.Sdk 5 | { 6 | [DataContract] 7 | public class PushAcceptRequest : BaseRequest 8 | { 9 | [DataMember(Name = "factor_id", EmitDefaultValue = false)] 10 | public string FactorId { get; set; } 11 | 12 | [DataMember(Name = "push_accept_details", EmitDefaultValue = false)] 13 | public PushAcceptDetails PushAcceptDetails { get; set; } 14 | 15 | [DataMember(Name = "biometricType")] 16 | public string BiometricType { get; set; } 17 | 18 | public PushAcceptRequest() 19 | { 20 | this.Type = "push_accept"; 21 | } 22 | 23 | public PushAcceptRequest(string userId, string factorId) 24 | : base(userId, "push_accept") 25 | { 26 | this.FactorId = factorId; 27 | } 28 | 29 | public PushAcceptRequest(string userId, string factorId, string domain = "") 30 | : base(userId, "push_accept", domain) 31 | { 32 | this.FactorId = factorId; 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk/Requests/PushAcceptSymbolRequest.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | using SecureAuth.Sdk.Models; 3 | 4 | namespace SecureAuth.Sdk 5 | { 6 | [DataContract] 7 | public class PushAcceptSymbolRequest : BaseRequest 8 | { 9 | [DataMember(Name = "factor_id", EmitDefaultValue = false)] 10 | public string FactorId { get; set; } 11 | 12 | [DataMember(Name = "push_accept_details", EmitDefaultValue = false)] 13 | public PushAcceptDetails PushAcceptDetails { get; set; } 14 | 15 | public PushAcceptSymbolRequest() 16 | { 17 | this.Type = "push_accept_symbol"; 18 | } 19 | 20 | public PushAcceptSymbolRequest(string userId, string factorId) 21 | : base(userId, "push_accept_symbol") 22 | { 23 | this.FactorId = factorId; 24 | } 25 | 26 | public PushAcceptSymbolRequest(string userId, string factorId, string domain = "") 27 | : base(userId, "push_accept_symbol", domain) 28 | { 29 | this.FactorId = factorId; 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk/Requests/PushBiometricRequest.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | using SecureAuth.Sdk.Models; 3 | 4 | namespace SecureAuth.Sdk 5 | { 6 | [DataContract] 7 | public class PushBiometricRequest : BaseRequest 8 | { 9 | [DataMember(Name = "factor_id", EmitDefaultValue = false)] 10 | public string FactorId { get; set; } 11 | 12 | [DataMember(Name = "biometricType")] 13 | public BiometricType BiometricType { get; set; } 14 | 15 | public PushBiometricRequest() 16 | { 17 | this.Type = "push_accept_biometric"; 18 | } 19 | 20 | public PushBiometricRequest(string userId, string factorId, BiometricType biometricType) 21 | : base(userId, "push_accept_biometric") 22 | { 23 | this.FactorId = factorId; 24 | this.BiometricType = biometricType; 25 | } 26 | 27 | public PushBiometricRequest(string userId, string factorId, BiometricType biometricType, string domain = "") 28 | : base(userId, "push_accept_biometric", domain) 29 | { 30 | this.FactorId = factorId; 31 | this.BiometricType = biometricType; 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk/Requests/PushOtpRequest.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk 4 | { 5 | [DataContract] 6 | public class PushOtpRequest : BaseRequest 7 | { 8 | [DataMember(Name = "factor_id", EmitDefaultValue = false)] 9 | public string FactorId { get; set; } 10 | 11 | public PushOtpRequest() 12 | { 13 | this.Type = "push"; 14 | } 15 | 16 | public PushOtpRequest(string userId, string factorId) 17 | : base(userId, "push") 18 | { 19 | this.FactorId = factorId; 20 | } 21 | 22 | public PushOtpRequest(string userId, string factorId, string domain = "") 23 | : base(userId, "push", domain) 24 | { 25 | this.FactorId = factorId; 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk/Requests/ResetBehavioralBioRequest.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | using SecureAuth.Sdk.Models; 3 | 4 | namespace SecureAuth.Sdk 5 | { 6 | [DataContract] 7 | public class ResetBehavioralBioRequest : BaseRequest 8 | { 9 | [DataMember(Name = "userId", EmitDefaultValue = false)] 10 | public string UserId { get; set; } 11 | 12 | [DataMember(Name = "fieldName", EmitDefaultValue = false)] 13 | public string FieldName { get; set; } 14 | 15 | [DataMember(Name = "fieldType", EmitDefaultValue = false)] 16 | public string FieldType { get; set; } 17 | 18 | [DataMember(Name = "deviceType", EmitDefaultValue = false)] 19 | public string DeviceType { get; set; } 20 | 21 | public ResetBehavioralBioRequest() { } 22 | 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/Requests/ResetPasswordRequest.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk 4 | { 5 | [DataContract] 6 | public class ResetPasswordRequest : BaseRequest 7 | { 8 | [DataMember(Name = "password")] 9 | public string NewPassword { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/Requests/SaveDfpRequest.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | using SecureAuth.Sdk.Models; 3 | 4 | namespace SecureAuth.Sdk 5 | { 6 | [DataContract] 7 | public class SaveDfpRequest : BaseRequest 8 | { 9 | [DataMember(Name = "fingerprint_id", EmitDefaultValue = false)] 10 | public string FingerprintId { get; set; } 11 | 12 | [DataMember(Name = "host_address", EmitDefaultValue = false)] 13 | public string HostAddress { get; set; } 14 | 15 | [DataMember(Name = "fingerprint", EmitDefaultValue = false)] 16 | public Fingerprint Fingerprint { get; set; } 17 | 18 | public SaveDfpRequest() { } 19 | 20 | public SaveDfpRequest(string fpJson) 21 | { 22 | this.Fingerprint = JsonSerializer.Deserialize(fpJson).Fingerprint; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/Requests/ScoreDfpRequest.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | using SecureAuth.Sdk.Models; 3 | 4 | namespace SecureAuth.Sdk 5 | { 6 | [DataContract] 7 | public class ScoreDfpRequest : BaseRequest 8 | { 9 | [DataMember(Name = "fingerprint_id", EmitDefaultValue = false)] 10 | public string FingerprintId { get; set; } 11 | 12 | [DataMember(Name = "host_address", EmitDefaultValue = false)] 13 | public string HostAddress { get; set; } 14 | 15 | [DataMember(Name = "fingerprint", EmitDefaultValue = false)] 16 | public Fingerprint Fingerprint { get; set; } 17 | 18 | public ScoreDfpRequest() { } 19 | 20 | public ScoreDfpRequest(string fpJson) 21 | { 22 | this.Fingerprint = JsonSerializer.Deserialize(fpJson).Fingerprint; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/Requests/SendBehavioralBioRequest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.Serialization; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace SecureAuth.Sdk.Requests 9 | { 10 | public class SendBehavioralBioRequest : BaseRequest 11 | { 12 | 13 | [DataMember(Name = "userAgent", EmitDefaultValue = false)] 14 | public string UserAgent { get; set; } 15 | 16 | [DataMember(Name = "hostAddress", EmitDefaultValue = false)] 17 | public string HostAddress { get; set; } 18 | 19 | [DataMember(Name = "domain", EmitDefaultValue = false)] 20 | public string Domain { get; set; } 21 | 22 | [DataMember(Name = "userId", EmitDefaultValue = false)] 23 | public string UserId { get; set; } 24 | 25 | [DataMember(Name = "fingerprint", EmitDefaultValue = false)] 26 | public string BehaviorProfile { get; set; } 27 | 28 | public SendBehavioralBioRequest() 29 | { 30 | } 31 | 32 | public SendBehavioralBioRequest(string bbJson) 33 | { 34 | this.BehaviorProfile = JsonSerializer.Deserialize(bbJson).BehaviorProfile; 35 | } 36 | } 37 | 38 | 39 | } 40 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/Requests/SetUserStatusRequest.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Runtime.Serialization; 3 | 4 | namespace SecureAuth.Sdk 5 | { 6 | [DataContract] 7 | public class SetUserStatusRequest: BaseRequest 8 | { 9 | [DataMember(Name = "status")] 10 | public string Status { get; set; } 11 | 12 | public SetUserStatusRequest(string status) 13 | { 14 | Status = status; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/Requests/SmsLinkOTPRequest.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk 4 | { 5 | [DataContract] 6 | public class SmsLinkOtpRequest : BaseRequest 7 | { 8 | [DataMember(Name = "factor_id", EmitDefaultValue = false)] 9 | public string FactorId { get; set; } 10 | 11 | [DataMember(Name = "evaluate_number", EmitDefaultValue = false)] 12 | public string EvaluateNumber { get; set; } 13 | 14 | public SmsLinkOtpRequest() 15 | { 16 | this.Type = "sms_link"; 17 | } 18 | 19 | public SmsLinkOtpRequest(string userId, string factorId) 20 | : base(userId, "sms_link") 21 | { 22 | this.FactorId = factorId; 23 | } 24 | 25 | public SmsLinkOtpRequest(string userId, string factorId, bool evaluateNumber) 26 | : base(userId, "sms_link") 27 | { 28 | this.FactorId = factorId; 29 | this.EvaluateNumber = evaluateNumber.ToString(); 30 | } 31 | 32 | public SmsLinkOtpRequest(string userId, string factorId, bool evaluateNumber, string domain = "") 33 | : base(userId, "sms_link", domain) 34 | { 35 | this.FactorId = factorId; 36 | this.EvaluateNumber = evaluateNumber.ToString(); 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk/Requests/SmsOtpRequest.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk 4 | { 5 | [DataContract] 6 | public class SmsOtpRequest : BaseRequest 7 | { 8 | [DataMember(Name = "factor_id", EmitDefaultValue = false)] 9 | public string FactorId { get; set; } 10 | 11 | [DataMember(Name = "evaluate_number", EmitDefaultValue = false)] 12 | public string EvaluateNumber { get; set; } 13 | 14 | public SmsOtpRequest() 15 | { 16 | this.Type = "sms"; 17 | } 18 | 19 | public SmsOtpRequest(string userId, string factorId) 20 | : base(userId, "sms") 21 | { 22 | this.FactorId = factorId; 23 | } 24 | 25 | public SmsOtpRequest(string userId, string factorId, bool evaluateNumber) 26 | : base(userId, "sms") 27 | { 28 | this.FactorId = factorId; 29 | this.EvaluateNumber = evaluateNumber.ToString(); 30 | } 31 | 32 | public SmsOtpRequest(string userId, string factorId, bool evaluateNumber, string domain = "") 33 | : base(userId, "sms", domain) 34 | { 35 | this.FactorId = factorId; 36 | this.EvaluateNumber = evaluateNumber.ToString(); 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk/Requests/UpdateProfileRequest.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Runtime.Serialization; 3 | 4 | namespace SecureAuth.Sdk 5 | { 6 | [DataContract] 7 | public class UpdateUserProfileRequest : BaseRequest 8 | { 9 | [DataMember(Name = "properties")] 10 | public IDictionary Properties { get; set; } 11 | 12 | [DataMember(Name = "knowledgeBase")] 13 | public IDictionary KnowledgeBase { get; set; } 14 | 15 | public UpdateUserProfileRequest() 16 | { 17 | Properties = new Dictionary(); 18 | KnowledgeBase = new Dictionary(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/Requests/ValidateDfpRequest.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | using SecureAuth.Sdk.Models; 3 | 4 | namespace SecureAuth.Sdk 5 | { 6 | [DataContract] 7 | public class ValidateDfpRequest : BaseRequest 8 | { 9 | [DataMember(Name = "fingerprint_id", EmitDefaultValue = false)] 10 | public string FingerprintId { get; set; } 11 | 12 | [DataMember(Name = "host_address", EmitDefaultValue = false)] 13 | public string HostAddress { get; set; } 14 | 15 | [DataMember(Name = "fingerprint", EmitDefaultValue = false)] 16 | public FingerprintWrapper Fingerprint { get; set; } 17 | 18 | public ValidateDfpRequest() 19 | { 20 | } 21 | 22 | public ValidateDfpRequest(string fpJson) 23 | { 24 | this.Fingerprint = JsonSerializer.Deserialize(fpJson).Fingerprint; 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk/Requests/ValidateKbaRequest.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk 4 | { 5 | [DataContract] 6 | public class ValidateKbaRequest : BaseRequest 7 | { 8 | [DataMember(Name = "token", EmitDefaultValue = false)] 9 | public string Token { get; set; } 10 | 11 | [DataMember(Name = "factor_id", EmitDefaultValue = false)] 12 | public string FactorId { get; set; } 13 | 14 | public ValidateKbaRequest() 15 | { 16 | this.Type = "kba"; 17 | } 18 | 19 | public ValidateKbaRequest(string userId, string token, string factorId) 20 | : base(userId, "kba") 21 | { 22 | this.Token = token; 23 | this.FactorId = factorId; 24 | } 25 | 26 | public ValidateKbaRequest(string userId, string token, string factorId, string domain = "") 27 | : base(userId, "kba", domain) 28 | { 29 | this.Token = token; 30 | this.FactorId = factorId; 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk/Requests/ValidateOathRequest.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk 4 | { 5 | [DataContract] 6 | public class ValidateOathRequest : BaseRequest 7 | { 8 | [DataMember(Name = "token", EmitDefaultValue = false)] 9 | public string Token { get; set; } 10 | 11 | [DataMember(Name = "factor_id", EmitDefaultValue = false)] 12 | public string FactorId { get; set; } 13 | 14 | public ValidateOathRequest() 15 | { 16 | this.Type = "oath"; 17 | } 18 | 19 | public ValidateOathRequest(string userId, string token, string factorId) 20 | : base(userId, "oath") 21 | { 22 | this.Token = token; 23 | this.FactorId = factorId; 24 | } 25 | 26 | public ValidateOathRequest(string userId, string token, string factorId, string domain = "") 27 | : base(userId, "oath", domain) 28 | { 29 | this.Token = token; 30 | this.FactorId = factorId; 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk/Requests/ValidateOtpRequest.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk 4 | { 5 | [DataContract] 6 | public class ValidateOtpRequest : BaseRequest 7 | { 8 | [DataMember(Name = "otp", EmitDefaultValue = false)] 9 | public string Otp { get; set; } 10 | 11 | public ValidateOtpRequest() { } 12 | public ValidateOtpRequest(string userId, string otp) 13 | { 14 | this.UserId = userId; 15 | this.Otp = otp; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/Requests/ValidatePasswordRequest.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk 4 | { 5 | [DataContract] 6 | public class ValidatePasswordRequest : BaseRequest 7 | { 8 | [DataMember(Name = "token", EmitDefaultValue = false)] 9 | public string Token { get; set; } 10 | 11 | public ValidatePasswordRequest() 12 | { 13 | this.Type = "password"; 14 | } 15 | 16 | public ValidatePasswordRequest(string userId, string token) 17 | : base(userId, "password") 18 | { 19 | this.Token = token; 20 | } 21 | 22 | public ValidatePasswordRequest(string userId, string token, string domain = "") 23 | : base(userId, "password", domain) 24 | { 25 | this.Token = token; 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk/Requests/ValidatePinRequest.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk 4 | { 5 | [DataContract] 6 | public class ValidatePinRequest : BaseRequest 7 | { 8 | [DataMember(Name = "token", EmitDefaultValue = false)] 9 | public string Token { get; set; } 10 | 11 | public ValidatePinRequest() 12 | { 13 | this.Type = "pin"; 14 | } 15 | 16 | public ValidatePinRequest(string userId, string token) 17 | : base(userId, "pin") 18 | { 19 | this.Token = token; 20 | } 21 | 22 | public ValidatePinRequest(string userId, string token, string domain = "") 23 | : base(userId, "pin", domain) 24 | { 25 | this.Token = token; 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk/Requests/ValidateUserIdRequest.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk 4 | { 5 | [DataContract] 6 | public class ValidateUserIdRequest : BaseRequest 7 | { 8 | public ValidateUserIdRequest() 9 | { 10 | this.Type = "user_id"; 11 | } 12 | 13 | public ValidateUserIdRequest(string userId) : base(userId, "user_id") 14 | { 15 | } 16 | 17 | public ValidateUserIdRequest(string userId, string domain = "") : base(userId, "user_id", domain) 18 | { 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk/Responses/AdaptiveAuthResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Net; 2 | using System.Runtime.Serialization; 3 | 4 | namespace SecureAuth.Sdk 5 | { 6 | [DataContract] 7 | public class AdaptiveAuthResponse : BaseResponse 8 | { 9 | [DataMember(Name = "realm_workflow", EmitDefaultValue = false)] 10 | public string RealmWorkflow { get; set; } 11 | 12 | [DataMember(Name = "suggested_action", EmitDefaultValue = false)] 13 | public string SuggestedAction { get; set; } 14 | 15 | [DataMember(Name = "redirect_url", EmitDefaultValue = false)] 16 | public string RedirectUrl { get; set; } 17 | 18 | public override bool IsSuccess() 19 | { 20 | return (this.StatusCode == HttpStatusCode.OK); 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk/Responses/BaseResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Net; 2 | using System.Runtime.Serialization; 3 | 4 | namespace SecureAuth.Sdk 5 | { 6 | [DataContract] 7 | public class BaseResponse 8 | { 9 | [DataMember(Name = "status", EmitDefaultValue = false)] 10 | public string Status { get; set; } 11 | 12 | [DataMember(Name = "message", EmitDefaultValue = false)] 13 | public string Message { get; set; } 14 | 15 | [IgnoreDataMember] 16 | public string RawJson { get; set; } 17 | 18 | [IgnoreDataMember] 19 | public string RawRequestJson { get; set; } 20 | 21 | [IgnoreDataMember] 22 | public HttpStatusCode StatusCode { get; set; } 23 | 24 | [IgnoreDataMember] 25 | public string IngressCookie { get; set; } 26 | 27 | public virtual bool IsSuccess() 28 | { 29 | return ((this.StatusCode == HttpStatusCode.OK) && (this.Status == "valid")); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk/Responses/BiometricsJavascriptLinkResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Net; 5 | using System.Runtime.Serialization; 6 | 7 | namespace SecureAuth.Sdk.Responses 8 | { 9 | [DataContract] 10 | public class BiometricsJavascriptLinkResponse : BaseResponse 11 | { 12 | [DataMember(Name = "src")] 13 | public string Source { get; set; } 14 | 15 | public override bool IsSuccess() 16 | { 17 | return ((this.StatusCode == HttpStatusCode.OK) && (!string.IsNullOrEmpty(this.Source))); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/Responses/DfpJavascriptLinkResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Net; 2 | using System.Runtime.Serialization; 3 | 4 | namespace SecureAuth.Sdk.Responses 5 | { 6 | [DataContract] 7 | public class DfpJavascriptLinkResponse : BaseResponse 8 | { 9 | [DataMember(Name = "src")] 10 | public string Source { get; set; } 11 | 12 | public override bool IsSuccess() 13 | { 14 | return ((this.StatusCode == HttpStatusCode.OK) && (!string.IsNullOrEmpty(this.Source))); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/Responses/DfpResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Net; 2 | using System.Runtime.Serialization; 3 | 4 | namespace SecureAuth.Sdk 5 | { 6 | [DataContract] 7 | public class DfpResponse : BaseResponse 8 | { 9 | [DataMember(Name = "user_id", EmitDefaultValue = false)] 10 | public string UserId { get; set; } 11 | 12 | [DataMember(Name = "fingerprint_id", EmitDefaultValue = false)] 13 | public string FingerprintId { get; set; } 14 | 15 | [DataMember(Name = "fingerprint_name", EmitDefaultValue = false)] 16 | public string FingerprintName { get; set; } 17 | 18 | [DataMember(Name = "score", EmitDefaultValue = false)] 19 | public string Score { get; set; } 20 | 21 | [DataMember(Name = "match_score", EmitDefaultValue = false)] 22 | public string MatchScore { get; set; } 23 | 24 | [DataMember(Name = "update_score", EmitDefaultValue = false)] 25 | public string UpdateScore { get; set; } 26 | 27 | public override bool IsSuccess() 28 | { 29 | return (this.StatusCode == HttpStatusCode.OK); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk/Responses/EmailLinkResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk 4 | { 5 | [DataContract] 6 | public class EmailLinkResponse : BaseResponse 7 | { 8 | [DataMember(Name = "user_id", EmitDefaultValue = false)] 9 | public string UserId { get; set; } 10 | 11 | [DataMember(Name = "reference_id", EmitDefaultValue = false)] 12 | public string ReferenceId { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk/Responses/GetProfileResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Net; 3 | using System.Runtime.Serialization; 4 | 5 | namespace SecureAuth.Sdk 6 | { 7 | [DataContract] 8 | public class GetUserProfileResponse : BaseResponse 9 | { 10 | [DataMember(Name = "userId")] 11 | public string UserId { get; set; } 12 | 13 | [DataMember(Name = "properties")] 14 | public IDictionary Properties { get; set; } 15 | 16 | [DataMember(Name = "knowledgeBase")] 17 | public IDictionary KnowledgeBase { get; set; } 18 | 19 | [DataMember(Name = "groups")] 20 | public IList Groups { get; set; } 21 | 22 | [DataMember(Name = "accessHistories")] 23 | public IList AccessHistories { get; set; } 24 | 25 | public override bool IsSuccess() 26 | { 27 | return ((this.StatusCode == HttpStatusCode.OK) && (this.Status == "found")); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/Responses/GroupAssociateResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Runtime.Serialization; 3 | 4 | namespace SecureAuth.Sdk 5 | { 6 | [DataContract] 7 | public class GroupAssociateResponse : BaseResponse 8 | { 9 | [DataMember(Name = "failures")] 10 | public Dictionary> Failures { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/Responses/IpRiskResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Net; 2 | using System.Runtime.Serialization; 3 | 4 | namespace SecureAuth.Sdk 5 | { 6 | [DataContract] 7 | public class IpRiskResponse : BaseResponse 8 | { 9 | [DataMember(Name = "ip_evaluation", EmitDefaultValue = false)] 10 | public IpEvaluation IpEvaluation { get; set; } 11 | 12 | public override bool IsSuccess() 13 | { 14 | return ((this.StatusCode == HttpStatusCode.OK) && (this.Status == "verified")); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk/Responses/NumberProfileResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Net; 2 | using System.Runtime.Serialization; 3 | 4 | namespace SecureAuth.Sdk 5 | { 6 | [DataContract] 7 | public class NumberProfileResponse : BaseResponse 8 | { 9 | [DataMember(Name = "numberProfileResult", EmitDefaultValue = false)] 10 | public NumberProfileResult NumberProfileResult { get; set; } 11 | 12 | public override bool IsSuccess() 13 | { 14 | return ((this.StatusCode == HttpStatusCode.OK) && (this.Status == "verified")); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/Responses/OathTokenResponse.cs: -------------------------------------------------------------------------------- 1 | //using System.Net; 2 | using System.Runtime.Serialization; 3 | 4 | namespace SecureAuth.Sdk 5 | { 6 | [DataContract] 7 | public class OathTokenResponse : BaseResponse 8 | { 9 | [DataMember(Name = "server_time", EmitDefaultValue = false)] 10 | public string ServerTime { get; set; } 11 | 12 | [DataMember(Name = "key", EmitDefaultValue = false)] 13 | public string OathSeed { get; set; } 14 | 15 | [DataMember(Name = "interval", EmitDefaultValue = false)] 16 | public string Interval { get; set; } 17 | 18 | [DataMember(Name = "length", EmitDefaultValue = false)] 19 | public string Length { get; set; } 20 | 21 | [DataMember(Name = "offset", EmitDefaultValue = false)] 22 | public string Offset { get; set; } 23 | 24 | [DataMember(Name = "pin_control", EmitDefaultValue = false)] 25 | public string PinControl { get; set; } 26 | 27 | [DataMember(Name = "failed_wipe", EmitDefaultValue = false)] 28 | public string FailedWipe { get; set; } 29 | 30 | [DataMember(Name = "screen_timeout", EmitDefaultValue = false)] 31 | public string ScreenTimeout { get; set; } 32 | 33 | [DataMember(Name = "tokentype", EmitDefaultValue = false)] 34 | public string TokenType { get; set; } 35 | 36 | [DataMember(Name = "counter", EmitDefaultValue = false)] 37 | public int? Counter { get; set; } 38 | } 39 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk/Responses/PushAcceptResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk 4 | { 5 | [DataContract] 6 | public class PushAcceptResponse : BaseResponse 7 | { 8 | [DataMember(Name = "user_id", EmitDefaultValue = false)] 9 | public string UserId { get; set; } 10 | 11 | [DataMember(Name = "reference_id", EmitDefaultValue = false)] 12 | public string ReferenceId { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk/Responses/PushAcceptSymbolResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk 4 | { 5 | [DataContract] 6 | public class PushAcceptSymbolResponse : BaseResponse 7 | { 8 | [DataMember(Name = "user_id", EmitDefaultValue = false)] 9 | public string UserId { get; set; } 10 | 11 | [DataMember(Name = "reference_id", EmitDefaultValue = false)] 12 | public string ReferenceId { get; set; } 13 | 14 | [DataMember(Name = "symbol", EmitDefaultValue = false)] 15 | public string Symbol { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk/Responses/PushBiometricResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk 4 | { 5 | [DataContract] 6 | public class PushBiometricResponse : BaseResponse 7 | { 8 | [DataMember(Name = "user_id", EmitDefaultValue = false)] 9 | public string UserId { get; set; } 10 | 11 | [DataMember(Name = "reference_id", EmitDefaultValue = false)] 12 | public string ReferenceId { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk/Responses/SendOtpResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk 4 | { 5 | [DataContract] 6 | public class SendOtpResponse : BaseResponse 7 | { 8 | [DataMember(Name = "user_id", EmitDefaultValue = false)] 9 | public string UserId { get; set; } 10 | 11 | [DataMember(Name = "otp", EmitDefaultValue = false)] 12 | public string OneTimePasscode { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk/Responses/SmsLinkResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk 4 | { 5 | [DataContract] 6 | public class SmsLinkResponse : BaseResponse 7 | { 8 | [DataMember(Name = "user_id", EmitDefaultValue = false)] 9 | public string UserId { get; set; } 10 | 11 | [DataMember(Name = "reference_id", EmitDefaultValue = false)] 12 | public string ReferenceId { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk/Responses/ThrottleResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | 3 | namespace SecureAuth.Sdk 4 | { 5 | [DataContract] 6 | public class ThrottleResponse : BaseResponse 7 | { 8 | [DataMember(Name = "count", EmitDefaultValue = false)] 9 | public int? Count { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /SecureAuth.Sdk/Responses/UserStatusResponse.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Net; 4 | using System.Runtime.Serialization; 5 | 6 | namespace SecureAuth.Sdk 7 | { 8 | [DataContract] 9 | public class UserStatusResponse : BaseResponse 10 | { 11 | [DataMember(Name = "user_id", EmitDefaultValue = false)] 12 | public string UserId { get; set; } 13 | 14 | 15 | public bool NotFound() 16 | { 17 | return ((this.StatusCode == HttpStatusCode.NotFound) && (this.Status == "not_found")); 18 | } 19 | 20 | public bool InvalidGroup() 21 | { 22 | return ((this.StatusCode == HttpStatusCode.OK) && (this.Status == "invalid_group")); 23 | } 24 | 25 | public bool Disabled() 26 | { 27 | return ((this.StatusCode == HttpStatusCode.OK) && (this.Status == "disabled")); 28 | } 29 | 30 | public bool Lockout() 31 | { 32 | return ((this.StatusCode == HttpStatusCode.OK) && (this.Status == "lock_out")); 33 | } 34 | 35 | public bool PasswordExpired() 36 | { 37 | return ((this.StatusCode == HttpStatusCode.OK) && (this.Status == "password_expired")); 38 | } 39 | 40 | public bool ChangePassword() 41 | { 42 | return ((this.StatusCode == HttpStatusCode.OK) && (this.Status == "change_password")); 43 | } 44 | 45 | public bool AccountExpired() 46 | { 47 | return ((this.StatusCode == HttpStatusCode.OK) && (this.Status == "account_expired")); 48 | } 49 | } 50 | } -------------------------------------------------------------------------------- /SecureAuth.Sdk/SecureAuth.Sdk.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SecureAuthCorp/saidp-sdk-csharp/6d6c0405ec0a26ecdbe1cabd6dd15bcc6e773002/SecureAuth.Sdk/SecureAuth.Sdk.snk --------------------------------------------------------------------------------