madscientistone / socialauth-net

Automatically exported from code.google.com/p/socialauth-net
0 stars 0 forks source link

application is running fine but I am not able to fetch contacts :Shows- You are not logged in.. #160

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I have configured in IIS and in my application 
Since Last 10 Days I was searching for contact fetcher application from Gmail, 
Yahoo, Facebook etc.
Now My application is running fine but I am not able to fetch contacts 

It shows a message: You are not logged in.
What  I did…?
1>  Added all reference of SocialAuth.net
2>  Modified Web.config (all keys and all section )
3>  Checked Application pool  Integrated mode (yes)
4>  Added #1 Code in GetContacts Page(default.aspx)
5>  Run My application Live(www.abc.com/my/page.aspx)
6>  Selecting provider(facebook,gmail etc..)
7>  Login into facebook and granting  the Access)
8>  It redirects me on my 
http://www.funndu.com/sushant/socialauth/validate.sauth/Page and showing 
message: You are not logged in…
Please Help me. Thank you in advance.

#1 Code
using System.Data;
using Brickred.SocialAuth.NET.Core.BusinessObjects;

namespace FunnduDev.socialauth.validate.sauth
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            DataTable dt = new DataTable("contacts");
            dt.Columns.Add("ProfilePicUrl");
            dt.Columns.Add("Name");
            dt.Columns.Add("Email");
            dt.Columns.Add("ProfileUrl");

            foreach (PROVIDER_TYPE p in SocialAuthUser.GetConnectedProviders())
                lblLoginStatus.Text = "Connected to: <b>" + p.ToString() + "</b> with identifier <b>" + SocialAuthUser.GetCurrentUser().GetProfile(p).GetIdentifier() + "</b>";
            if (SocialAuthUser.IsLoggedIn())
            {

                try
                {
                    User.Identity.GetContacts().ForEach(
                    x =>
                    {
                        dt.Rows.Add(x.ProfilePictureURL, x.Name, x.Email, x.ProfileURL);
                        dt.AcceptChanges();
                    }

                    );

                    GridView1.DataSource = dt;
                    GridView1.DataBind();
                    lblMessage.Text = "You are successfully logged in..";
                }
                catch (Exception ex)
                {

                }

            }
            else
            {

                lblMessage.Text = "You are not logged in..";
            }

        }
    }
}

Original issue reported on code.google.com by call2sus...@gmail.com on 20 Jan 2013 at 8:13

Attachments:

GoogleCodeExporter commented 9 years ago
I believe you're using Forms authentications. Seems you're missing following in 
web.config:

<location path="SocialAuth">
        <system.web>
            <authorization>
                <allow users="*"/>
            </authorization>
        </system.web>
    </location>

This allows security to bypass socialauth custom httphandler.

reference: 
http://code.google.com/p/socialauth-net/wiki/Integration_Guide#Option_–_3:__Ch
anges_for_using_SocialAuth_.NET_standard_authen

Let us know if it doesn't resolves your issue with more details.

Deepak

Original comment by deepak.a...@3pillarglobal.com on 29 Jan 2013 at 1:32