Facebook OAth login issue

Eric Garrison asked on October 18, 2016 04:26

Kentico V9.0.44 seems to be giving errors using the Facebook Login feature.

Message: Exception of type 'System.Web.HttpUnhandledException' was thrown.

Exception type: System.Web.HttpUnhandledException Stack Trace: at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Message: (OAuthException - #12) (#12) bio field is deprecated for versions v2.8 and higher

Exception type: Facebook.FacebookOAuthException Stack Trace: at Facebook.FacebookClient.ProcessResponse(HttpHelper httpHelper, String responseString, Type resultType, Boolean containsEtag, IList`1 batchEtags) at Facebook.FacebookClient.Api(HttpMethod httpMethod, String path, Object parameters, Type resultType) at Facebook.FacebookClient.Get(String path, Object parameters, Type resultType) at CMS.MembershipProvider.Facebook.FacebookUserProvider.GetFacebookUser(String facebookUserId, String accessToken) at CMSWebParts_Membership_FacebookConnect_FacebookConnectLogon.MapFacebookUserProfile(FacebookUserProfileMappingTriggerEnum mappingTrigger, UserInfo user, String userProfileId, String facebookAccessToken) at CMSWebParts_Membership_FacebookConnect_FacebookConnectLogon.SignInUser(UserInfo ui, String facebookUserId, String facebookAccessToken, Boolean mapFacebookProfile) at CMSWebParts_Membership_FacebookConnect_FacebookConnectLogon.SetupControlForPublicUser() at CMS.PortalControls.CMSWebPartZone.OnContentLoaded() at CMS.PortalControls.CMSAbstractLayout.OnContentLoaded() at CMS.PortalControls.CMSAbstractLayout.LoadWebPartsContent(Boolean reloadData) at CMS.PortalControls.CMSAbstractLayout.LoadContent(PageInfo pageInfo, Boolean reloadData, Boolean allowOrphanedZones) at CMS.PortalControls.CMSPagePlaceholder.LoadContent(PageInfo pageInfo, Boolean reloadData) at CMS.PortalControls.CMSPagePlaceholder.LoadContent(PageInfo pageInfo, Boolean reloadData) at CMS.PortalControls.CMSPortalManager.LoadPage(Boolean reloadData) at CMS.PortalControls.CMSPortalManager.PageHelper_InitComplete(Object sender, EventArgs e) at CMS.Helpers.PageContext.CurrentPage_InitComplete(Object sender, EventArgs e) at System.EventHandler.Invoke(Object sender, EventArgs e) at System.Web.UI.Page.OnInitComplete(EventArgs e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Correct Answer

Filip Tesar answered on October 25, 2016 17:34

Hello Eric, this issue is caused by the Facebook API change as mentioned above. It will be fixed in 9.0.46 hotfix.

0 votesVote for this answer Unmark Correct answer

Recent Answers


Joshua Adams answered on October 21, 2016 02:51

Just had the same exact error occur in that latest hotfix even after changing the field mapping in settings not to pull in the bio.

0 votesVote for this answer Mark as a Correct answer

Laura Frese answered on October 21, 2016 07:07

Facebook likes to change their API quite a bit. You will have to modify the web part. This post on stackoverflow has a solution that worked for them.

Connection<Facebook> connection = facebookConnectionFactory.createConnection(accessGrant);
Facebook facebook = connection.getApi();
String [] fields = { "id", "email",  "first_name", "last_name" };
User userProfile = facebook.fetchObject("me", User.class, fields);
1 votesVote for this answer Mark as a Correct answer

Eric Garrison answered on October 25, 2016 02:03

What file do I change. The mapping looks to be controlled by settins>Global>Security & Membership>Authenticatin>Facebook>User Profile Mapping

I removed the Biography mapping, but it seems to still be trying to pull it.

0 votesVote for this answer Mark as a Correct answer

Eric Garrison answered on October 25, 2016 20:04

Ok. I will wait for that to come out.

0 votesVote for this answer Mark as a Correct answer

Eric Garrison answered on October 31, 2016 01:05

The newest Hotfix did correct the issue. Thank you.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.