Hi everyone. Can somebody help me out on how to use SuperTokens with Flutter FE. Documentation says to call FE APIs directly for the thirdparty login flow, but I'm not quite sure how this suppose to work.
Specifically I'm trying to implement thirdparty login with Twitch. For that I've added custom twitch provider in SuperTokens config to my Go backend. I see that frontend APIs have
signinup
and
authorisationurl
. My assumption is that I have to call
authorisationurl
API first to get the redirect to the thirdparty provider and then call
signinup
once I get authorisation code from provider. Is that the correct flow?
Also the url returned by
authorisationurl
does not include either
redirect_uri
or
state
parameters. Are these supposed to be added my me on the FE manually? Does Supertokens provide any mechanism of handling
state
and / or
nonce
verification ?
Thanks.
r
rp_st
05/17/2023, 11:13 AM
hey @nicktgn you will have to get twitch's access or id token on the frontend first. This will require you to use any ouaht client lib available for flutter (you can google this).
Once you have this, you can send the token to the backend using the signinup API and then your custom implementation for twitch on the backend will kick in
rp_st
05/17/2023, 11:14 AM
so no need to use
authorisationurl
at all.
n
nicktgn
05/17/2023, 11:17 AM
I see. Thanks for reply.
I was kinda under impression that ST can handle some of that for me.
r
rp_st
05/17/2023, 11:18 AM
yeaaa.. for mobile social login flows, we don't help with the client side oauth as of yet. A primary reason is also cause many providers have very different mobile flows. For examlpe sign in with apple asks the OS to auth the user. Sign in with google requires use of the google's frontend sdk on mobile etc.
SuperTokens is an open source authentication solution offering features like: Different types of login: Email / password, Passwordless (OTP or Magic link based).