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

CG.VOLS

07/11/2022, 10:35 PM
for apple social login... i see the following in our Go service.
r

rp

07/12/2022, 3:17 AM
Maybe @sattvikc can help out.
Hey @CG.VOLS when you said that you saw a 404 on the browser and then 200, what does that mean? Could you please elaborate?
c

CG.VOLS

07/12/2022, 11:42 AM
shows what i was talking about
s

sattvikc

07/12/2022, 11:47 AM
can u ping me the url of apple 404
apple state/code seems fine, however signinup has failed. can you check if the apple login settings are accurate? else we can debug and see what's going on
c

CG.VOLS

07/12/2022, 12:04 PM
https://dev.wwwww.us/services/auth/v1/callback/apple ty we tweaked the path by injecting "services". that is for k8s routing. /auth/v1 is the api base path it's ok for state to not have a value? https://dev.wwwww.us/callback/apple?state=&code=c209f066b40054a20944e1b21e6661f59.0.mruxx.e52D85TBP-Titom-vr8eDg
thank you...
s

sattvikc

07/12/2022, 12:06 PM
can u show the response of 404 page ?
r

rp

07/12/2022, 12:12 PM
Which URL returns a 404? And what is the response body from that network call?
c

CG.VOLS

07/12/2022, 12:12 PM
those are the response headers for that call
r

rp

07/12/2022, 12:13 PM
and what is the response body?
c

CG.VOLS

07/12/2022, 12:13 PM
nothing.
r

rp

07/12/2022, 12:13 PM
I see
Can we see the raw response?
c

CG.VOLS

07/12/2022, 12:16 PM
i don't see a response in the browser. should there be one with the 404?
r

rp

07/12/2022, 12:16 PM
Or rather, can we get on a call to debug call?
It's easier to debug that way
c

CG.VOLS

07/12/2022, 12:17 PM
yes. let me check with a couple folks on our side. would be best if we do it all together as they can tweak things as needed
r

rp

07/12/2022, 12:17 PM
sounds good!
You can book a call here too if you like: https://supertokens.com/call-user
c

CG.VOLS

07/12/2022, 12:26 PM
can we zoom now if i provide a link?
r

rp

07/12/2022, 12:26 PM
sure
s

sattvikc

07/12/2022, 1:04 PM
@CG.VOLS are you using a Mux in the golang server? if yes which one?
r

rp

07/12/2022, 1:30 PM
Also, we could reproduce the 404 error on our side, we are investigating the issue. Will release a new version with the fix as soon as possible
@CG.VOLS i have released a new version of the golang SDK (v0.8.1) which fixes the 404 issue.
c

CG.VOLS

07/12/2022, 5:36 PM
awesome!!!
hey @rp... can we have another call once i come free in like 20-30 min. we are seeing an interface issue. want your feedback.
r

rp

07/13/2022, 1:46 PM
Hey! I am busy now, can we have a call tomororw?
You can pick a time here: https://supertokens.com/call-user
c

CG.VOLS

07/13/2022, 1:48 PM
later today?
if not we can set up tomorrow
r

rp

07/13/2022, 1:48 PM
today seems difficult
c

CG.VOLS

07/13/2022, 1:48 PM
k. we'll do tomorrow
what timezone are you?
r

rp

07/13/2022, 1:48 PM
IST
c

CG.VOLS

07/13/2022, 1:49 PM
cool.
i may get Alisha and Santhosh to reach out to you sooner in your day
r

rp

07/13/2022, 1:49 PM
okay
c

CG.VOLS

07/13/2022, 1:49 PM
ty
r

rp

07/13/2022, 1:50 PM
You can even describe the issue here and if i get time today, i'll reply
otherwise tomorrow is fine
c

CG.VOLS

07/13/2022, 2:36 PM
the code is now looking for a id_token from apple.
claims, err := verifyAndGetClaimsAppleIdToken(authCodeResponse.(map[string]interface{})["id_token"].(string), api.GetActualClientIdFromDevelopmentClientId(config.ClientID))
that is in apple.go
not sure where we get that token
r

rp

07/13/2022, 2:49 PM
You get that from the response that comes from apple when you give it the code
c

CG.VOLS

07/19/2022, 1:21 PM
@rp hey... we are coming back to this issue. i got a new IP for the k8s worker node and get a different error now when i do wget from the pod. we can't run local to see what the error is coming back from Apple as they won't allow us to configure localhost.
is there a way to get more debug information coming back from this call?
accessTokenAPIResponseTemp, err := postRequest(providerInfo, userContext) if err != nil { return tpmodels.SignInUpPOSTResponse{}, err }
r

rp

07/19/2022, 1:23 PM
You could override the
signInUpPOST
function, call the original implementation which would return the
err
, and then print it out
c

CG.VOLS

07/19/2022, 2:41 PM
@rp it was already overriden. from Alisha, "its causing panic inside resp, err := f() , so we are not able to see the logs"
r

rp

07/19/2022, 2:43 PM
oh. So then you can override it, and instead of calling the original implementation, you can copy the code from here: https://github.com/supertokens/supertokens-golang/blob/master/recipe/thirdparty/api/implementation.go#L95 And then see how it goes.
What is the panic error again?
Is this for web login with apple or mobile?
If it's a mobile request, what is the API call input?
c

CG.VOLS

07/19/2022, 2:51 PM
web
looking at the above code
c

CG.VOLS

07/19/2022, 2:51 PM
i think i see
r

rp

07/19/2022, 2:51 PM
and see what the value of
authCodeResponse
is?
c

CG.VOLS

07/19/2022, 2:51 PM
we can't run it locally
r

rp

07/19/2022, 2:51 PM
So locally it all works?
c

CG.VOLS

07/19/2022, 2:51 PM
because of apple config
apple won't call back to localhost
this is deployed to our dev env
from the github link you posted above
r

rp

07/19/2022, 2:52 PM
ok. Can you then copy this file https://github.com/supertokens/supertokens-golang/blob/0.8/recipe/thirdparty/providers/apple.go#L86 into your code base and add this as a custom provider on the backend? As opposed to using our pre built apple rprovider?
c

CG.VOLS

07/19/2022, 2:53 PM
on the UI, when we get a redirect url back. we override it.
we override that value because of k8s routing issues
in the github link... it look slike the redirect uri gets override on the server side
r

rp

07/19/2022, 2:54 PM
ah right. That may be the problem
How are you changing the redirect_uri?
c

CG.VOLS

07/19/2022, 2:56 PM
doing a replace of the URL param value for redirect_uri
that is probably the issue
r

rp

07/19/2022, 2:56 PM
and what are you replacing it with?
c

CG.VOLS

07/19/2022, 2:56 PM
one sec
i'll grab it
r

rp

07/19/2022, 2:56 PM
vs what is the redirect_uri by default?
vs
services allows it to route to our service
r

rp

07/19/2022, 2:58 PM
I see. To solve this, can you set the apiGatewayPath config on your backend (in appInfo) to
/services
And on the frontend, you should set the apiBasePath to
/services/auth/v1
On the backend, set the apiBasePath to
/auth/v1
This way, you shouldn't have to rewrite the redirect_uri either. And it should just work - if I understand your setup correctly.
c

CG.VOLS

07/19/2022, 3:00 PM
ok. we'll give this a try.. apiGatewayPath as the name sounds accounts for any routing needs ?
c

CG.VOLS

07/19/2022, 3:00 PM
ty 🙂
r

rp

07/19/2022, 3:02 PM
lmk if this solves the issue
c

CG.VOLS

07/19/2022, 3:02 PM
i think this may do it. it didn't occur to me that the redirect uri was dynamic
or could be reset after we set it as well
r

rp

07/19/2022, 3:03 PM
Yea. Fair enough.
c

CG.VOLS

07/19/2022, 3:04 PM
i need to read more documentation lol
thx again. we'll try it out
r

rp

07/19/2022, 3:28 PM
Hehe. Well.. reading docs is boring. Writing them even more so 😂