Unable to link account after unlinking it

edited May 2017 in Social Login
I have linked my account to Facebook, and as I'm testing my implementation of the SDK I went ahead and unlinked Facebook. I am now unable to link Facebook to my account again. It worked the first time, is there something I need to do special during the unlinking or during relinking?

https://docs.oneall.com/services/implementation-guide/social-link/



Code for Linking the account
If Request.OneAllTokenExists() Then
Dim oneAllUserToken As Guid = Guid.Empty
Dim oneAllCnToken As Guid = Request.OneAllToken()

Dim responseCn As Response(Of ConnectionDetail) = OneAllAPI.Default.ConnectionReadDetails(oneAllCnToken)
Select Case responseCn.Result.Data.PlugIn.Data.Action
Case "link_identity"
Dim userToken = responseCn.Result.Data.User.UserToken
Dim identityToken = responseCn.Result.Data.User.Identity.IdentityToken
'is current customer already linked?
Dim customer = DAL.DbContext.Customers.Where(Function(c) c.Id = LoggedInUser.CustomerId).First()
If customer.OneAllUserToken <> userToken.ToString() Then
customer.OneAllUserToken = userToken.ToString()
DAL.DbContext.SaveChanges()
End If
Case "unlink_identity"


End Select
End If
Return RedirectToAction("Edit")

Answers

  • More info to add:

    When calling the user clicks on the Facebook icon to re-link, I get a different connection_token then the one I got previously. This results in a 400 status response when I call the:

    https://MyAppName.api.oneall.com/connections/connection_Token.json

    but the contents of the result still have the correct user_token

    The response has the following information:

    info=Your request could not be processed due to an error
    reason=identity_is_linked_to_another_user

    At this point I'm at a lose, I can't seem to find anything in the documentation, any help would be appreciated.
    Wayne
  • Claude_SchlesserClaude_SchlesserAdministratorOneAll Team
    Hello,

    the connection_token identifies the connection with the social network.

    If you login let's say 10 times, you will make 10 different connections and receive 10 different connection_tokens.
    If you always login with the same social network account, then the content will almost be identical each time.

    info=Your request could not be processed due to an error reason=identity_is_linked_to_another_user

    This error means that your Facebook is already assigned to another user_token.
    This probably occurred during your tests.

    If you are still testing you can probably simply delete it so that you can relink it afterwards:
    http://docs.oneall.com/api/resources/identities/delete-identity/

Welcome!

Please sign in to your OneAll account to ask a new question or to contribute to the discussions.

Please click on the link below to connect to the forum with your OneAll account.