is there an SDK client for Go desktop app? i'm cur...
# support-questions-legacy
t
is there an SDK client for Go desktop app? i'm currently doing this manually by referring to the curl examples on the docs
r
hey @the_aceix there isn't anything really. Seeing the curl commands is the best option for you
You could also see the mobile code tabs in the custom UI for a more guided way of how and when to call which API
If you have any specific questions, we would be happy to help - especially when it comes to getting sessions to work (updating and refreshing sessions)
t
got it. thankss
hey. so i keep getting a 404, after i log in and trying to get data from my backend. not sure what to do. i am only passing cookies in my reuest. am i missing anythig?
r
404 from which api?
t
noticed it was a mismatch. that issue is no more, thanks
currently trying to login with sso (google) but i keep getting unauthorised. provider="google", accessToken= below is the code snippet
Copy code
func OAuthSignIn(oauthProvider, accessToken string) (string, error) {
    url := fmt.Sprintf("%s/auth/signinup", os.Getenv("BASE_URL"))
    data := Data{
        ThirdPartyId: oauthProvider,
        ClientType:   "",
        OAuthTokens: OAuthTokens{
            AccessToken: accessToken,
        },
    }

    payloadBuf := new(bytes.Buffer)
    json.NewEncoder(payloadBuf).Encode(data)

    req, _ := http.NewRequest("POST", url, payloadBuf)
    req.Header.Add("rid", "thirdpartyemailpassword")
    req.Header.Add("Content-Type", "application/json; charset=utf-8")

    client := &http.Client{
        Timeout: time.Second * 10,
    }
    resp, err := client.Do(req)
    if err != nil {
        slog.Error("error sending request", "err", err)
        return "", err
    }
    defer resp.Body.Close()
    fmt.Print(resp.Body)

    // TODO: parse response and return sToken
    return "", nil
}
r
can you enable backend debug logs and show the output?
t
Sure.. I'll send that
How do I enable the debug logs?
r
Which version of the backend SDK are you using?
t
github.com/supertokens/supertokens-golang v0.10.2
t
Debug not supported on the version i use
r
Oh. Then you can update the latest one. Or then see the older docs for how to add the env var
t
or what is the best way to login via oauth from a desktop app with supertokens? maybe what i'm doing isnt right
yh.. cant update now. too many breaking changes
r
Oh no I meant see the older version of the docs. It will have the instructions for how to enable the debug logs for your version
In terms of getting it to work for desktop apps, you should redirect the user to your website and do the OAuth login there. And then pass the access token to the desktop app to create a session
t
oh.. ok
err.. so like a normal login from the website, but then send the access token to the desktop app through some other means. right?
right. is there a dropdown to change the version? the docs has a funny behavior; i share the same link with my colleague but he sees different things
also, i already get the access token from google (ie: google oauth access token), then i send to /auth/signinup to get the supertokens token. but that results in unauthorized
trying to get the supertoken from this endpoint
Copy code
curl --location --request POST '<YOUR_API_DOMAIN>/auth/signinup' \
--header 'rid: thirdpartyemailpassword' \
--header 'Content-Type: application/json; charset=utf-8' \
--data-raw '{
    "thirdPartyId": "google",
    "clientType": "...",
    "oAuthTokens": {
        "access_token": "...",
        "id_token": "..."
    },
}'
r
Yes.
There is a button on the right which takes u to a page that shows you how to run the older version
t
will check again