https://supertokens.com/ logo
#general
Title
# general
a

alisha

05/27/2022, 11:43 AM
hey, I am having trouble registering with facebook, I am able to do so with google
Copy code
interface conversion: interface {} is nil, not string
/home/alishavirani/go/pkg/mod/github.com/getsentry/sentry-go@v0.13.0/gin/sentrygin.go:72 (0xc10367)
        (*handler).recoverWithSentry: panic(err)
/usr/local/go/src/runtime/panic.go:838 (0x436ec6)
        gopanic: done = runOpenDeferFrame(gp, d)
/usr/local/go/src/runtime/iface.go:262 (0x40ace9)
        panicdottypeE: panic(&TypeAssertionError{iface, have, want, ""})
/home/alishavirani/go/pkg/mod/github.com/supertokens/supertokens-golang@v0.6.4/recipe/thirdparty/providers/facebook.go:82 (0xc62024)
        Facebook.func1.1: ID := userInfo["id"].(string)
/home/alishavirani/go/pkg/mod/github.com/supertokens/supertokens-golang@v0.6.4/recipe/thirdparty/api/implementation.go:134 (0xc5e81d)
        MakeAPIImplementation.func2: userInfo, err := providerInfo.GetProfileInfo(accessTokenAPIResponse, userContext)
/home/alishavirani/go/pkg/mod/github.com/supertokens/supertokens-golang@v0.6.4/recipe/thirdpartyemailpassword/api/implementation.go:106 (0xc73ee2)
        MakeAPIImplementation.func6: response, err := ogSignInUpPOST(provider, code, authCodeResponse, redirectURI, options, userContext)
s

sattvikc

05/27/2022, 11:54 AM
@alisha can you share the Init ?
a

alisha

05/27/2022, 12:36 PM
request```{ "code": "code from fb", "thirdPartyId": "facebook", "redirectURI": "http://localhost:3000/auth/callback/facebook" }```
s

sattvikc

05/27/2022, 12:38 PM
it seems like the get profile is failing on the fb API call, are u sure the configuration between frontend and backend is matching ?
@alisha we could get on a call to debug this
a

alisha

05/27/2022, 1:03 PM
sorry got occupied on something else, will check what creds are there on FE in sometime
s

sattvikc

05/27/2022, 1:03 PM
okay
a

alisha

05/27/2022, 3:05 PM
I think the FE and BE config is correct
a could will be helpful
I am available for a call after 3pm today, does that work for you ?
@rp can you help me here
r

rp

06/03/2022, 10:58 AM
hey!
Still facing the fb login issue?
@sattvikc please help out
s

sattvikc

06/03/2022, 11:00 AM
@alisha let me know a good time to call
a

alisha

06/03/2022, 11:01 AM
I am available for a call now
r

rp

06/03/2022, 11:01 AM
ok sending a link
Join Zoom Meeting https://us06web.zoom.us/j/84451561319?pwd=d0JhZXZSZUNablB3ZmlNRE5TdjJNQT09 Meeting ID: 844 5156 1319 Passcode: 782473 One tap mobile +13017158592,,84451561319#,,,,*782473# US (Washington DC) +13126266799,,84451561319#,,,,*782473# US (Chicago) Dial by your location +1 301 715 8592 US (Washington DC) +1 312 626 6799 US (Chicago) +1 346 248 7799 US (Houston) +1 669 900 6833 US (San Jose) +1 929 205 6099 US (New York) +1 253 215 8782 US (Tacoma) Meeting ID: 844 5156 1319 Passcode: 782473 Find your local number: https://us06web.zoom.us/u/kd1GHF8Ds2
a

alisha

06/03/2022, 11:02 AM
thanks
s

sattvikc

06/03/2022, 11:02 AM
joining..
r

rp

06/03/2022, 12:29 PM
hey @alisha
we found a bug in the golang SDK related to fb login. Will release a fix in a few hours.
a

alisha

06/03/2022, 12:45 PM
hey sure, thanks
r

rp

06/03/2022, 12:46 PM
thanks for pointing this out.
hey @alisha
we have fixed the bug for fb sign in in v0.6.6. Please do try and feel free to let us know if the error persists. Thanks
a

alisha

06/04/2022, 3:57 PM
thanks @rp will check and let you know
the error still persists
r

rp

06/06/2022, 7:18 AM
@sattvikc can you help?
s

sattvikc

06/06/2022, 7:19 AM
yes
@alisha could u share the logs or stack trace?
a

alisha

06/06/2022, 7:21 AM
``` interface conversion: interface {} is nil, not string /home/alishavirani/go/pkg/mod/github.com/getsentry/sentry-go@v0.13.0/gin/sentrygin.go:72 (0xc4dc07) (*handler).recoverWithSentry: panic(err) /usr/local/go/src/runtime/panic.go:838 (0x436ec6) gopanic: done = runOpenDeferFrame(gp, d) /usr/local/go/src/runtime/iface.go:262 (0x40ace9) panicdottypeE: panic(&TypeAssertionError{iface, have, want, ""}) /home/alishavirani/go/pkg/mod/github.com/supertokens/supertokens-golang@v0.6.6/recipe/thirdparty/providers/facebook.go:82 (0xc801af) Facebook.func1.1: ID := userInfo["id"].(string) /home/alishavirani/go/pkg/mod/github.com/supertokens/supertokens-golang@v0.6.6/recipe/thirdparty/api/implementation.go:134 (0xc7c9fd) MakeAPIImplementation.func2: userInfo, err := providerInfo.GetProfileInfo(accessTokenAPIResponse, userContext) /home/alishavirani/go/pkg/mod/github.com/supertokens/supertokens-golang@v0.6.6/recipe/thirdpartyemailpassword/api/implementation.go:106 (0xc85f82) MakeAPIImplementation.func6: response, err := ogSignInUpPOST(provider, code, authCodeResponse, redirectURI, options, userContext)``
s

sattvikc

06/06/2022, 7:22 AM
give me a min, let me check
seems like there is no user id in the fb response, could you call this manually and let me know the result: https://graph.facebook.com/me?fields=id,email&format=json&access_token=
a

alisha

06/06/2022, 7:49 AM
Copy code
{
  "error": {
    "message": "Malformed access token AQDsqTUpG8yTGAKvtRoP7I3u_h0eEX4pAsZ0GMyvnYcyixDgdbYfVAlkLtf5mH2afARRch_9pX6mTUuRAkgU6XFpieX9hv4OjizLXbN5hy06lzKwQ4JndARBsDfY2x8TLiDQir1Y3ARmI18x1hYocupJ0Ny7J5jRZlC26u7gi0a_xOkYlApF1pVtZf5Bk8KSUXTcNKDKCZkpCyqEbXLZiDahLLeoL2c7FD0AfAAXugSWOHYYkyF5qrNV8qkW-4XbEe38DF3tcqCwD1O_V-ccxiKQTbWaC1s33PI3tXRzMtyXgUEQSjlG3BuxT--mCldTbF0NGEjk3apfZd7A4hkzvZKPi4bw9lurbB8UZtNulzbtrsudMUyvIsGbGroqDZYTcQQ",
    "type": "OAuthException",
    "code": 190,
    "fbtrace_id": "ABDwyP4hFUBtb7YgusJtNHy"
  }
}
s

sattvikc

06/06/2022, 7:55 AM
just to re-confirm, did u you use accessToken and not code ?
otherwise, we might need to get on a call and debug to trace the issue.
a

alisha

06/06/2022, 8:00 AM
oh sorry, I used code, from where do I get the access token? The signinup API is failing so I cant log the access token from the response
s

sattvikc

06/06/2022, 8:00 AM
not to worry, there is another API to fetch access token from code... just a sec
a

alisha

06/06/2022, 8:00 AM
brb
s

sattvikc

06/06/2022, 8:03 AM
sure, meanwhile could u also share the scope?
a

alisha

06/06/2022, 8:19 AM
back, scope is
"email", "public_profile", "openid"
s

sattvikc

06/06/2022, 11:52 AM
scope seems file, maybe we could get on a call and debug this
@alisha pls do let me know a good time
a

alisha

06/06/2022, 11:53 AM
tonight 8pm IST?
s

sattvikc

06/06/2022, 11:53 AM
okay
I have actually tried with only email in the scope. Could you try that once?
a

alisha

06/06/2022, 12:35 PM
trying
facing same error @sattvikc
s

sattvikc

06/06/2022, 12:41 PM
alright, let's debug @ 8pm IST
@alisha To join the video meeting, click this link: https://meet.google.com/oux-bhza-ghj Otherwise, to join by phone, dial +1 260-897-1665 and enter this PIN: 708 222 522# To view more phone numbers, click this link: https://tel.meet/oux-bhza-ghj?hs=5
a

alisha

06/06/2022, 2:32 PM
hey joining
checked the client id and secret, still doesn't seem to work
r

rp

06/06/2022, 4:06 PM
Hmmmm. Thatโ€™s odd. Fb says that the client secret is invalid
Can you intentionally give a wrong client secret and see if you get the same error?
a

alisha

06/06/2022, 4:06 PM
yes will try that
i'll try and let you know tomorrow
r

rp

06/06/2022, 4:12 PM
Cool
a

alisha

06/07/2022, 8:13 AM
hey it worked, looks like I was using the wrong client secret value, apologies for the same, thanks a lot for your help ๐Ÿ™‚
r

rp

06/07/2022, 8:20 AM
ok great!!
a

alisha

06/07/2022, 10:25 AM
however it says on the server, do we need https on the server to get it working?
r

rp

06/07/2022, 10:27 AM
Yea. If you use the admin's (the person who created the app on db) account to login, then it allows you http. Else you have to use https
a

alisha

06/07/2022, 10:28 AM
I am trying using the admin's account, it still gives the same error
fb dev settings
s

sattvikc

06/07/2022, 10:57 AM
@alisha by "on server" do you mean production environment?
a

alisha

06/07/2022, 10:58 AM
dev server
s

sattvikc

06/07/2022, 10:58 AM
local ?
if you are using any other domain other than localhost, https is mandatory
a

alisha

06/07/2022, 10:58 AM
qa/staging server
for all users including admin?
s

sattvikc

06/07/2022, 10:59 AM
yes
a

alisha

06/07/2022, 10:59 AM
okay, cool
will let you know when we have https added, thanks for the help ๐Ÿ™‚
s

sattvikc

06/07/2022, 11:01 AM
just to confirm again, the complete login flow worked on the localhost right? (for the admin account)
a

alisha

06/07/2022, 11:01 AM
yes it did
s

sattvikc

06/07/2022, 11:01 AM
great!
4 Views