https://supertokens.com/ logo
Title
g

ggishant

10/12/2022, 4:01 AM
Hi guys, any example of declaring custom redirect_uri while initialising third party providers in golang?
r

rp

10/12/2022, 5:02 AM
Hey. @sattvikc can help here.
s

sattvikc

10/12/2022, 5:03 AM
sure
@ggishant you can do something like this. let me know if u face any issues
g

ggishant

10/12/2022, 10:01 AM
Thanks so much! This was helpful 👍
s

sattvikc

10/12/2022, 10:01 AM
happy to help 🙂
g

ggishant

10/12/2022, 10:02 AM
Also if we're using JWT, what should be the key of the header on which we send the token? I see that I have two tokens on the frontend, namely : Front-Token and Id-Refresh-Token
s

sattvikc

10/12/2022, 10:05 AM
@rp ?
r

rp

10/12/2022, 10:05 AM
You can send it with whatever key you like.. you will be consuming the token yourself somehwere
g

ggishant

10/14/2022, 4:44 AM
I already implemented this, able to intercept any query param but how do query for a specific provider?
s

sattvikc

10/14/2022, 4:46 AM
I'm on it, will let u know in a while
Let me know if this helps
g

ggishant

10/14/2022, 4:58 AM
so do I have to maintain a mapping of my own with client_ids and redirect uris for this?
s

sattvikc

10/14/2022, 4:58 AM
yes
g

ggishant

10/14/2022, 5:00 AM
oh okay
So the authurl endpoint returned the correct redirect uri, but when redirecting to the server it added these scopes that I had in a different provider
Also the endpoint gives me a 404
redirect_uri_web_app := struct { Params map[string]interface{} }{Params: map[string]interface{}{"redirect_uri": Config.GetEnvSecret("BASE_API_URL") + "/auth/google/webAppcallback"}}
    var googleWebAppProvider = thirdparty.Google(tpmodels.GoogleConfig{
        ClientID: Config.GetEnvSecret("GOOGLE_CLIENT_ID"),
        ClientSecret: Config.GetEnvSecret("GOOGLE_CLIENT_SECRET"),
        AuthorisationRedirect: &redirect_uri_web_app,
        Scope: default_scopes,
        IsDefault: true,
    })
this is how i registered the redirect uri
s

sattvikc

10/14/2022, 5:05 AM
can u see what scope was returned with GetAuthURL API?
g

ggishant

10/14/2022, 5:06 AM
I think the scopes are all the scopes associated with that particular cloud console project
the api returns correct scopes
s

sattvikc

10/14/2022, 5:07 AM
are u getting those additional scopes on the callback from google?
g

ggishant

10/14/2022, 5:07 AM
yes
s

sattvikc

10/14/2022, 5:08 AM
not very sure of that, let me check
g

ggishant

10/14/2022, 5:09 AM
these are the debug logs, not sure why it says no recipe matched
s

sattvikc

10/14/2022, 5:10 AM
callback is not handled by the backend
it's handled in the frontend and then there is a call to the SignInUp API
g

ggishant

10/14/2022, 5:12 AM
but I'm declaring the redirect uri on the backend
s

sattvikc

10/14/2022, 5:13 AM
u mean, are u specifying a backend url for the redirect uri?
g

ggishant

10/14/2022, 5:14 AM
yes, should it be the website one? and if it's the website one, how will the frontend know? do we need to specify it in the config as well for react?
s

sattvikc

10/14/2022, 5:14 AM
are you using our react sdk ?
it should be the website one. supertokens react SDK will handle it. there is no need to specify. You also need not override the redirect URI, it's automatically determined from the supertokens config
g

ggishant

10/14/2022, 5:50 AM
yes
Hi @sattvikc @rp is it possible to get on a short call, struggling with a weird issue
I'm unable to redirect the user to /auth/ endpoints on the frontend but am able to redirect to any other endpoint
s

sattvikc

10/14/2022, 7:04 AM
on the frontend?
g

ggishant

10/14/2022, 7:04 AM
yes
s

sattvikc

10/14/2022, 7:05 AM
@rp can help?
g

ggishant

10/14/2022, 7:25 AM
if the code/state is exchanged on the frontend, doesn't that mean we have to store the client secret as well on the frontend?
if not, then it must go to the backend, but can't find an endpoint that does this
or are we supposed to handle the callback on the backend ourselves, and then register a user with provided functions from supertokens?
r

rp

10/14/2022, 7:36 AM
hey @ggishant im available for a call now
Join Zoom Meeting https://us06web.zoom.us/j/83472125568?pwd=WVZkYWxDZkZBY3hHSVFhemhLZ2M2Zz09 Meeting ID: 834 7212 5568 Passcode: 609355 One tap mobile +12532158782,,83472125568#,,,,*609355# US (Tacoma) +13017158592,,83472125568#,,,,*609355# US (Washington DC) Dial by your location +1 253 215 8782 US (Tacoma) +1 301 715 8592 US (Washington DC) +1 309 205 3325 US +1 312 626 6799 US (Chicago) +1 346 248 7799 US (Houston) +1 386 347 5053 US +1 564 217 2000 US +1 646 931 3860 US +1 669 444 9171 US +1 669 900 6833 US (San Jose) +1 719 359 4580 US +1 929 205 6099 US (New York) Meeting ID: 834 7212 5568 Passcode: 609355 Find your local number: https://us06web.zoom.us/u/kdrzVpprGw
lmk when you can join
g

ggishant

10/14/2022, 7:50 AM
hi, i can join now
r

rp

10/14/2022, 7:50 AM
ok
sending new link.. the older one is invalid
hey @ggishant as discussed, please open an issue on our github highlighting the problem and what you want - we will investigate this over the coming days.
@ggishant we have fixed this issue in the latest golang SDK. Now the open ID token will contain the user's profile info like their name and profile pic. All you need to do is updated the backend SDK