示例#1
0
        public JsonResult Register(UserIdentityCreateModel identityCreateModel)
        {
            identityCreateModel.PhoneId = "+919667286111";
            identityCreateModel.IsTwoFactorAuthenticationEnabled = true;
            identityCreateModel.Password = "******";
            identityCreateModel.UserName = "******";

            foreach (var item in identityCreateModel.Email)
            {
                var Type = item.Type;

                var Value = item.Value;
            }
            SottDetails _SottDetails = new SottDetails();

            _SottDetails.Sott = new Sott();
            //_SottDetails.Sott.StartTime = DateTime.UtcNow.ToString();
            //_SottDetails.Sott.EndTime = DateTime.UtcNow.AddMinutes(10).ToString();
            _SottDetails.Sott.StartTime      = null;
            _SottDetails.Sott.EndTime        = null;
            _SottDetails.Sott.TimeDifference = "10";

            var apiResponse = new RegisterEntity().RegisterCustomer(identityCreateModel, _apiOptionalParams, _SottDetails);

            _apiOptionalParams.VerificationUrl = "VerificationUrl";
            return(Json(apiResponse, JsonRequestBehavior.AllowGet));
        }
示例#2
0
        public ApiResponse <LoginRadiusPostResponse> RegisterCustomer(UserIdentityCreateModel socialUserProfile,
                                                                      LoginRadiusApiOptionalParams optionalParams, SottDetails _SottDetails)
        {
            var additionalQueryParams = new QueryParameters();

            additionalQueryParams.AddOptionalParamsRange(optionalParams);
            var timediffrence = new QueryParameters {
                ["timedifference"] = _SottDetails.Sott.TimeDifference
            };

            if (_SottDetails.Sott.StartTime == null)
            {
                ApiResponse <SottDetails> sottresponse =
                    ConfigureAndExecute <SottDetails>(RequestType.ServerInfo, HttpMethod.Get, null, timediffrence);

                if (sottresponse.Response != null)
                {
                    _SottDetails = sottresponse.Response;
                }
            }

            additionalQueryParams.Add("sott", GetSott(_SottDetails));
            return(ConfigureAndExecute <LoginRadiusPostResponse>(RequestType.Authentication, HttpMethod.Post,
                                                                 _resoucePath.ToString(),
                                                                 additionalQueryParams, socialUserProfile.ConvertToJson()));
        }
示例#3
0
 public ApiResponse <LoginRadiusUserIdentity> CreateAccount(UserIdentityCreateModel userIdentity)
 {
     Validate(new ArrayList {
         userIdentity.Email, userIdentity.Password
     });
     return(ConfigureAndExecute <LoginRadiusUserIdentity>(RequestType.Identity, HttpMethod.Post, null,
                                                          userIdentity.ConvertToJson()));
 }
示例#4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Context context = this;

            // Get the Resources object from our context
            Android.Content.Res.Resources res = context.Resources;
            SetContentView(Resource.Layout.register);
            string sott = Intent.GetStringExtra("sott") ?? "please-go-back-and-put-sott-value";

            apikey          = res.GetString(Resource.String.apikey);
            verificationurl = res.GetString(Resource.String.verificationurl);

            EditText email     = FindViewById <EditText>(Resource.Id.email);
            EditText password  = FindViewById <EditText>(Resource.Id.password);
            EditText FirstName = FindViewById <EditText>(Resource.Id.firstname);
            EditText LastName  = FindViewById <EditText>(Resource.Id.lastname);

            email.TextChanged += (object sender, Android.Text.TextChangedEventArgs e) => {
                emiltext = e.Text.ToString();
            };
            password.TextChanged += (object sender, Android.Text.TextChangedEventArgs e) => {
                passwordtext = e.Text.ToString();
            };
            FirstName.TextChanged += (object sender, Android.Text.TextChangedEventArgs e) => {
                FirstNametext = e.Text.ToString();
            };
            LastName.TextChanged += (object sender, Android.Text.TextChangedEventArgs e) => {
                LastNametext = e.Text.ToString();
            };
            Button register = FindViewById <Button>(Resource.Id.register);

            register.Click += delegate
            {
                UserIdentityCreateModel user = new UserIdentityCreateModel();
                user.FirstName = FirstNametext;
                user.LastName  = LastNametext;
                user.Password  = passwordtext;

                Email email1 = new Email();
                email1.Type  = "Primary";
                email1.Value = emiltext;
                user.Email   = new List <Email>();
                user.Email.Add(email1);
                GetUserRegistrationbyEmail(apikey, sott, verificationurl, user);
            };
        }
示例#5
0
        async void OnSignUpButtonClicked(object sender, EventArgs e)
        {
            UserIdentityCreateModel user = new UserIdentityCreateModel();

            user.FirstName = firstnameEntry.Text;

            user.Password = passwordEntry.Text;

            Email email1 = new Email();

            email1.Type  = "Primary";
            email1.Value = emailEntry.Text;
            user.Email   = new List <Email>();
            user.Email.Add(email1);
            // Sign up logic goes here

            await UserRegistrationbyEmailAPI.GetUserRegistrationbyEmail(apiKey, sott, "", "", user, response => {
                DisplayAlert("Alert", "hello Registration is Sucessfull", "OK");
                Navigation.InsertPageBefore(new MainPage(), Navigation.NavigationStack.First());
                Navigation.PopToRootAsync();           // Success event
            }, (error) => {
                messageLabel.Text = error.description; // Failure event
            });
        }
示例#6
0
        public ApiResponse <LoginRadiusPostResponse> PhoneUserRegistrationbySMS(SottDetails _SottDetails,
                                                                                LoginRadiusApiOptionalParams _LoginRadiusApiOptionalParams,
                                                                                UserIdentityCreateModel _UserIdentityCreateModel)
        {
            var additionalparams = new QueryParameters();

            if (string.IsNullOrEmpty(_LoginRadiusApiOptionalParams.VerificationUrl))
            {
                additionalparams.Add("verificationUrl", _LoginRadiusApiOptionalParams.VerificationUrl);
            }
            if (string.IsNullOrEmpty(_LoginRadiusApiOptionalParams.SmsTemplate))
            {
                additionalparams.Add("smsTemplate", _LoginRadiusApiOptionalParams.SmsTemplate);
            }


            var timediffrence = new QueryParameters {
                ["timedifference"] = _SottDetails.Sott.TimeDifference
            };

            if (_SottDetails.Sott.StartTime == null)
            {
                ApiResponse <SottDetails> sottresponse =
                    ConfigureAndExecute <SottDetails>(RequestType.ServerInfo, HttpMethod.Get, null, timediffrence);

                if (sottresponse.Response != null)
                {
                    _SottDetails = sottresponse.Response;
                }
            }

            additionalparams.Add("sott", LoginRadiusSecureOneTimeToken.GetSott(_SottDetails));

            return(ConfigureAndExecute <LoginRadiusPostResponse>(RequestType.Authentication, HttpMethod.Post, "register",
                                                                 additionalparams, _UserIdentityCreateModel.ConvertToJson()));
        }
示例#7
0
        public static async Task GetUserRegistrationbyEmail(string apikey, string sott, string verificationurl, string emailtemplate, UserIdentityCreateModel user, Action <LoginRadiusPostResponse> OnSuccess = null, Action <ErrorResponse> OnFailure = null)
        {
            var api = RestRequest.CallApi <ApiInterface>();

            try
            {
                var response = await api.GetUserRegistrationbyEmail(apikey, sott, verificationurl, emailtemplate, user);

                if (OnSuccess != null)
                {
                    OnSuccess(response);
                }
            }
            catch (ApiException ex)
            {
                var statusCode = ex.StatusCode;
                var error      = ex.GetContentAs <ErrorResponse>();
                if (OnFailure != null)
                {
                }
                OnFailure(error);
            }
        }
        public static async Task GetUpdateProfilebyToken(Dictionary <string, string> myDictionary, UserIdentityCreateModel obj, Action <LoginRadiusPostResponse> OnSuccess = null, Action <ErrorResponse> OnFailure = null)
        {
            var api = RestRequest.CallApi <ApiInterface>();

            try
            {
                String apikey          = myDictionary["apikey"];
                String access_token    = myDictionary["access_token"];
                String verificationurl = "";
                String emailtemplate   = "";
                String smstemplate     = "";
                if (myDictionary.ContainsKey("verificationurl"))
                {
                    verificationurl = myDictionary["verificationurl"];
                }
                if (myDictionary.ContainsKey("emailtemplate"))
                {
                    emailtemplate = myDictionary["emailtemplate"];
                }
                if (myDictionary.ContainsKey("smstemplate"))
                {
                    smstemplate = myDictionary["smstemplate"];
                }

                var response = await api.GetUpdateProfilebyToken(apikey, access_token, verificationurl, emailtemplate, smstemplate, obj);

                if (OnSuccess != null)
                {
                    OnSuccess(response);
                }
            }
            catch (ApiException ex)
            {
                var statusCode = ex.StatusCode;
                var error      = ex.GetContentAs <ErrorResponse>();
                if (OnFailure != null)
                {
                }
                OnFailure(error);
            }
        }
示例#9
0
 public async void GetUserRegistrationbyEmail(string apikey, string sott, string verificationurl, UserIdentityCreateModel user)
 {
     await UserRegistrationbyEmailAPI.GetUserRegistrationbyEmail(apikey, sott, verificationurl, "", user, response => {
         Toast.MakeText(this, "Please Verify Your Email Address", ToastLength.Long).Show();  // Success event
     }, (error) => {
         Toast.MakeText(this, error.description, ToastLength.Long).Show();                   // Failure event
     });
 }
        public static async Task GetPhoneUserRegistration(Dictionary <string, string> myDictionary, UserIdentityCreateModel user, Action <LoginRadiusPostResponse> OnSuccess = null, Action <ErrorResponse> OnFailure = null)
        {
            var api = RestRequest.CallApi <ApiInterface>();

            try
            {
                String apikey          = myDictionary["apikey"];
                String sott            = myDictionary["sott"];
                String verificationurl = "";
                String smstemplate     = "";

                if (myDictionary.ContainsKey("verificationurl"))
                {
                    verificationurl = myDictionary["verificationurl"];
                }
                if (myDictionary.ContainsKey("smstemplate"))
                {
                    smstemplate = myDictionary["smstemplate"];
                }
                var response = await api.GetPhoneUserRegistration(apikey, sott, verificationurl, smstemplate, user);

                if (OnSuccess != null)
                {
                    OnSuccess(response);
                }
            }
            catch (ApiException ex)
            {
                var statusCode = ex.StatusCode;
                var error      = ex.GetContentAs <ErrorResponse>();
                if (OnFailure != null)
                {
                }
                OnFailure(error);
            }
        }