コード例 #1
0
        public ApiResponse <LoginRadiusDeleteResponse> DeleteRole(string roleName)
        {
            Validate(new ArrayList {
                roleName
            });
            var pattern      = _resoucePath.ChildObject("{0}");
            var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] { roleName });

            return(ConfigureAndExecute <LoginRadiusDeleteResponse>(RequestType.Role, HttpMethod.Delete, resourcePath));
        }
コード例 #2
0
        public ApiResponse <CustomObjectprop> UpdateAccountCustomObjectbyUID(string uId, string objectRecordId,
                                                                             string objectname, string customObject)
        {
            Validate(new ArrayList {
                uId, objectRecordId, customObject
            });
            var pattern          = _resoucePath.ChildObject("{1}").ObjectName;
            var additionalparams = new QueryParameters {
                ["objectname"] = objectname
            };
            var resourcePath = SDKUtil.FormatURIPath(pattern, new object[] { uId, objectRecordId });

            return(ConfigureAndExecute <CustomObjectprop>(RequestType.Identity, HttpMethod.Put, resourcePath, additionalparams,
                                                          customObject));
        }
コード例 #3
0
        public ApiResponse <CustomObjectprop> UpdateCustomObjectbyObjectRecordId(string accessToken, string objectRecordId, string objectName,
                                                                                 string customObject)
        {
            Validate(new ArrayList {
                objectName, accessToken
            });
            var additionalQueryParams =
                new QueryParameters {
                ["access_token"] = accessToken, ["objectName"] = objectName
            };
            var resourcePath = SDKUtil.FormatURIPath(_resoucePath.ChildObject("{0}").ToString(),
                                                     new object[] { objectRecordId });

            return(ConfigureAndExecute <CustomObjectprop>(RequestType.Authentication, HttpMethod.Put, resourcePath,
                                                          additionalQueryParams, customObject));
        }
コード例 #4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="accessToken"></param>
        /// <param name="optionalParams"></param>
        /// <returns></returns>
        public ApiResponse <LoginRadiusApiResponse <TwoFactorAuthentication> > GetTwoFactorAuthentication(
            string accessToken, LoginRadiusApiOptionalParams optionalParams)
        {
            Validate(new ArrayList {
                accessToken
            });
            var additionalQueryParams = new QueryParameters {
                { "accessToken", accessToken }
            };

            additionalQueryParams.AddOptionalParamsRange(optionalParams);

            return
                (ConfigureAndExecute <LoginRadiusApiResponse <TwoFactorAuthentication> >(
                     RequestType.Authentication, HttpMethod.Get,
                     _resoucePath.ChildObject("2FA").ToString(),
                     additionalQueryParams));
        }
コード例 #5
0
        public ApiResponse <LoginRadiusPostResponse> VerifyOtpByAccessToken(string accessToken, string otp,
                                                                            string smsTemplate = "")
        {
            Validate(new ArrayList {
                accessToken, otp
            });
            var additionalQueryParams = new QueryParameters {
                ["access_token"] = accessToken, ["otp"] = otp
            };

            if (!string.IsNullOrWhiteSpace(smsTemplate))
            {
                additionalQueryParams["smsTemplate"] = smsTemplate;
            }
            var pattern = _resoucePath.ChildObject("otp").ToString();

            return(ConfigureAndExecute <LoginRadiusPostResponse>(RequestType.Authentication, HttpMethod.Put, pattern,
                                                                 additionalQueryParams));
        }
コード例 #6
0
        public ApiResponse <LoginRadiusPostResponse <SmsResponseData> > ForgotPasswordByOtp(string phone,
                                                                                            LoginRadiusApiOptionalParams optionalParams)
        {
            Validate(new ArrayList {
                phone
            });
            var additionalQueryParams = new QueryParameters();

            if (!string.IsNullOrWhiteSpace(optionalParams.SmsTemplate))
            {
                additionalQueryParams.Add("SmsTemplate", optionalParams.SmsTemplate);
            }
            var bodyParams = new BodyParameters {
                ["phone"] = phone
            };

            return(ConfigureAndExecute <LoginRadiusPostResponse <SmsResponseData> >(RequestType.Authentication,
                                                                                    HttpMethod.Post, _resoucePath.ChildObject("otp").ToString(),
                                                                                    additionalQueryParams, bodyParams.ConvertToJson()));
        }
コード例 #7
0
        TwoFactorAuthLoginByEmail(string email, string password,
                                  LoginRadiusApiOptionalParams optionalParams)
        {
            Validate(new ArrayList {
                email, password
            });
            var additionalQueryParams = new QueryParameters {
                { "email", email }, { "password", password }
            };

            additionalQueryParams.AddOptionalParamsRange(optionalParams);
            return
                (ConfigureAndExecute
                 <TwoFactorAuthenticationResponse <LoginRadiusUserIdentity> >(
                     RequestType.Authentication,
                     HttpMethod.Get, _resoucePath.ChildObject("2FA").ToString(), additionalQueryParams));
        }