get paid to paste

IAuthenticationResponse response = openid.GetResponse();
            if (response != null)
            {
                switch (response.Status)
                {
                    case AuthenticationStatus.Authenticated:
                        var simpleReg = response.GetExtension<ClaimsResponse>();

                        if (simpleReg != null)
                        {
                            string email = simpleReg.Email;

                            if (!String.IsNullOrEmpty(email))
                            {
                                var user = UserBusiness.GetDetailByEmail(email);
                                if (user != null)
                                {
                                    UserContext.Permission = user.LevelID;
                                    UserContext.UserID = user.UserID;
                                    UserContext.Username = user.Username;

                                    

                                }
                                else
                                {
                                    Session["email"] = email;
                                    return Response.Redirect("....");
                                }
                            }
                        }                        
                        break;
                    case AuthenticationStatus.Canceled:
                       
                        break;
                    case AuthenticationStatus.Failed:
                        
                        break;
                }
            }
            else
            {
                string loginType = Request.QueryString["t"];

                if (!String.IsNullOrEmpty(loginType))
                {
                    string loginIdentifier = string.Empty;

                    if (loginType == "yahoo")
                        loginIdentifier = "http://yahoo.com";
                    else if (loginType == "google")
                        loginIdentifier = "http://www.google.com/accounts/o8/id";

                    if (!String.IsNullOrEmpty(loginIdentifier))
                    {
                        IAuthenticationRequest request = openid.CreateRequest(Identifier.Parse(loginIdentifier));

                        // Require some additional data
                        request.AddExtension(new ClaimsRequest
                        {
                            Email = DemandLevel.Require,
                            Nickname = DemandLevel.Require,
                            FullName = DemandLevel.Request

                        });

                        return request.RedirectingResponse.AsActionResult();
                    }
                }
            }

Pasted: Jan 4, 2011, 5:46:39 am
Views: 11