hey <@498057949541826571> we are facing issues wi...
# support-questions-legacy
a
hey @rp_st we are facing issues with apple signup from ios mobile, android and web signup/login are working fine
r
Hey! What are the issues? Note that the flow for mobile is different than for web
a
the error is in the signup API
this is the request
Copy code
{
  "code": "c89cd7bac35af4de09888aa718fbe7cc6.0.syvx.lhG_XRTF9sYElC6kGxCmZA",
  "redirectURI": "https://dev.wingit.us/services/auth/v1/callback/apple",
  "thirdPartyId": "apple"
}
this is the apple response we get
Copy code
{
  "authorizationCode": "c89cd7bac35af4de09888aa718fbe7cc6.0.syvx.lhG_XRTF9sYElC6kGxCmZA",
  "authorizedScopes": [],
  "email": null,
  "fullName": {
    "familyName": null,
    "givenName": null,
    "middleName": null,
    "namePrefix": null,
    "nameSuffix": null,
    "nickname": null
  },
  "identityToken": "eyJraWQiOiJmaDZCczhDIiwiYWxnIjoiUlMyNTYifQ.eyJpc3MiOiJodHRwczovL2FwcGxlaWQuYXBwbGUuY29tIiwiYXVkIjoidXMud2luZ2l0Lmd1ZXN0IiwiZXhwIjoxNjU5MDA2NTgxLCJpYXQiOjE2NTg5MjAxODEsInN1YiI6IjAwMDg1Ny44YTJjMmY5Y2JkZWQ0YjIwYmE5MjQyMzc2MjM3ZjVjZS4xMTEzIiwibm9uY2UiOiI5MzAxMDUxZTE5ZWJiNTZmMmNlODE5ZDBiY2RhM2Q0NDY4ZjFhNDIwYzMxMDg2NDYyOTE3MmMwOGI5ZTBlZTliIiwiY19oYXNoIjoiUUZ0Tkl3MnN0YjFRSWgxQ05hZ2tOUSIsImF1dGhfdGltZSI6MTY1ODkyMDE4MSwibm9uY2Vfc3VwcG9ydGVkIjp0cnVlfQ.uGBVeK4G_HKXyGvQOUyIvclnXXx-pyCHVHf1GJ8wSoN7rvm1tpm73PnGlzbA32pIpZMBJryZxPbA1IeqJuFW66QvkEp_DzzNoszJkDBEdAFrXvprRcASZgF4_tX46wpmd3BXzhLpfoGQ1BRtNnowQW_PK3ekt-UXWh0qmWKA56ksavFG8tp7PxGTj_nIZhkjL8o3lGCyzfm4pARZop1fhWHmA0P0BxvwDgZYes1GswBe_2bknhjsXxgvrckRsi--fcZ8jGobMqnGUdkyCSfsWVbZmXWf5LBGgAASdiPDzobEhD2hajS87vVmsgsgmfP23BfN3Y9yErbdUQE3AEs1Yg",
  "nonce": "VPmik7zVXsNtFluGB1keqY7thplt1pv5",
  "realUserStatus": 1,
  "state": null,
  "user": "000857.8a2c2f9cbded4b20ba9242376237f5ce.1113"
}
Copy code
interface conversion: interface {} is nil, not string
/go/pkg/mod/github.com/getsentry/sentry-go@v0.13.0/gin/sentrygin.go:72 (0xd32907)
/usr/local/go/src/runtime/panic.go:838 (0x437206)
/usr/local/go/src/runtime/iface.go:262 (0x40ace9)
/go/pkg/mod/github.com/supertokens/supertokens-golang@v0.8.1/recipe/thirdparty/providers/apple.go:87 (0xd81129)
/go/pkg/mod/github.com/supertokens/supertokens-golang@v0.8.1/recipe/thirdparty/api/implementation.go:134 (0xd7e3fd)
/go/pkg/mod/github.com/supertokens/supertokens-golang@v0.8.1/recipe/thirdpartyemailpassword/api/implementation.go:114 (0xd8825b)
/go/build/supertokens.go:136 (0xdbdbe2)
/go/build/handlers/st_social_overrider.go:57 (0xdb57f9)
/go/build/supertokens.go:135 (0xdbda6f)
/go/pkg/mod/github.com/supertokens/supertokens-golang@v0.8.1/recipe/thirdpartyemailpassword/api/thirdPartyAPIImplementation.go:35 (0xd88d7b)
/go/pkg/mod/github.com/supertokens/supertokens-golang@v0.8.1/recipe/thirdparty/api/signinup.go:80 (0xd7fa8e)
/go/pkg/mod/github.com/supertokens/supertokens-golang@v0.8.1/recipe/thirdparty/recipe.go:153 (0xd84aa5)
/go/pkg/mod/github.com/supertokens/supertokens-golang@v0.8.1/recipe/thirdpartyemailpassword/recipe.go:201 (0xd8e5a9)
/go/pkg/mod/github.com/supertokens/supertokens-golang@v0.8.1/supertokens/supertokens.go:248 (0xab4f22)
logs ^
/go/build/handlers/st_social_overrider.go:57 (0xdb57f9)
-> this is where we call the ST signup api
r
I see.
what scope have you provided for this?
have you added a separate apple provider on the backend for mobile app? That has the clientId and key specific for the mobile app?
if not, you need to do that, and in your signinup post request, you need to also pass that clientId in the request. See this: https://github.com/supertokens/supertokens-react-native/blob/master/examples/with-thirdpartyemailpassword/apple.js#L49
a
BE provider is configured
Copy code
thirdparty.Apple(tpmodels.AppleConfig{
                        ClientID: conf.STAppleClientID,
                        ClientSecret: tpmodels.AppleClientSecret{
                            KeyId:      conf.STAppleClientSecretKeyID,
                            PrivateKey: conf.STAppleClientSecretPrivateKey,
                            TeamId:     conf.STAppleClientSecretTeamID,
                        },
                    }),
r
You need to add a different provider for each platform
a
ohh
we have not done that
r
apple gives different set of client IDs and keys per platform
a
oh, I see, how do I add multiple apple providers in the BE ?
you need one separate provider config for ios... and one that works for android & web. So in total two of them
a
got it
will try, this and let you know
thanks 🙂
r
cool!
yea.. we should probably add a guide for mobile app with social login. Apple doesn't really make it easy to do an integration
a
yeah, apple is tedious
r
ironic isn't it.. they force devs to add sign in with apple, but don't make it easy at all.. lol
a
💯
so for apple to work on web/android and ios, will there be 2 sets of client id and keys? we currently have 1 set of credentials
do you have any doc/steps to add multiple accounts?
r
We ddont have any docs for that unfortunately.
But you will need one dedicated for ios, and one for rest of the platforms
we can probably guide you over a call sometime next week
a
cool, we will try that, if we don't manage to succeed, will get back
r
cool
3 Views