Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Facebook connect View modes: 
User avatar
Member
Member
nabraham-tibus - 7/26/2011 4:20:08 AM
   
Facebook connect
Hi

If I loggede through facebook connect method, is there any methond in kentico to identified the user is logged through facebook?

Thanks, Nibu

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 7/26/2011 4:38:35 AM
   
RE:Facebook connect
Hi,

In the CMS_UserSettinsg table is a UserFacebookID column. This one is used for users who were registered to your site via Facebook Connect logon.

You can get a value of the column using API:
http://devnet.kentico.com/docs/devguide/api_membership_managing_users.htm?zoom_highlightsub=userinfo

Best regards,
Ivana Tomanickova

User avatar
Member
Member
nabraham-tibus - 7/26/2011 5:07:07 AM
   
RE:Facebook connect
Hi Ivana

Thanks for the reply. Is there any kentico native method to find the facebook id?

ie: CMSContext.CurrentUser.IsAuthenticated(), it returns true, if the user is logged into site.

Thanks, Nibu

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 7/26/2011 5:28:36 AM
   
RE:Facebook connect
Hi,

you could use:

CMSContext.CurrentUser.UserSettings.UserFacebookID;

But there is still a possibility that user was authenticated using standard authentication form. This way of authentication is not allowed in case the field IsExternal is checked/true:

CMSContext.CurrentUser.IsExternal

So if the option IsExternal is true and UserFacebookID returns Id, the user is connected using his facebook account.

Alternatively, you could use

CMS.MembershipProvider.FacebookConnectHelper.GetFacebookSessionInfo();

If the above method retuns FacebookValidationEnum.ValidSignature, the user is connected with his fb account.

Best regards,
Ivana Tomanickova

User avatar
Member
Member
nabraham-tibus - 7/26/2011 5:44:52 AM
   
RE:Facebook connect
Thanks for the helps.