Hi everyone. Can somebody help me out on how to us...
# support-questions-legacy
n
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
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
so no need to use
authorisationurl
at all.
n
I see. Thanks for reply. I was kinda under impression that ST can handle some of that for me.
r
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.
maybe this lib can help you: https://pub.dev/packages/openid_client
n
Makes sense. And thanks for the link. I'll look into it.
4 Views