Initialize tKey SDK without calling triggerLogin method

Hello, we want to use tKey SDK to retrieve a public/private key pair for an authenticated user.
Authentication uses Google Identity Services (OAuth) but it happens previous to the initialization of the tKey SDK.
My question is, if we have the id/access tokens from Google login, can we initialize the tKey without calling triggerLogin() function?
Or maybe what we need is to pass Google authentication response to triggerLogin via hash and queryParameters parameters. Is there documenation or an example for this?

Thanks.

1 Like

triggerLogin() is require to retrieve the social login share which is needed for the the tkey reconstruction.
From my understanding of your question, it seems you would like to avoid to prompt user to sign in which is possible by bring in your own jwt provider (where you handle all the social login and provide the idToken as well as the jwks server).
You will need to reconfigure this at the dashboard and setup a jwks server which generate the idToken

With this, you can pass the idToken to triggerLogin and this will not prompt user to social site sign in page.

Thanks for your response @cherngwoei .
We don’t want to build our own jwt provider but use Google sign in.
However, when the user goes to the ‘wallet’ functionality and the tkey reconstruction is needed, the user has already signed in on our application. Therefore, we have a tokenid and accesstoken from Google services and we’d like to perform tkey reconstruction without showing again the sign in screens.

triggerLogin accepts hash and queryParameters as input. Is there any documentation about these parameters?

1 Like

Could you solve this David?

++ to this question.
I also need the same functionality for authorization via google in the chrome extension. See this issue

Google authorusation redirects to the new page! insted of returning the auth share to calling code. So need to pass this auth share from site to extension via window.postMessage() and inject it to tKey sdk somehow.

you can refer example here for sample google login and parameters needed to be passed to triggerLogin function

coming to relogin part
you can store the shares temporarily in session storage → you can access this with tkey.shares
while relogin if tkey instance is empty use tkey.inputShareStoreSafe() and give 2 or minimum shares required tkey/core.ts at 71fca1433ce4786026d4c10f4393a605d53dc4ce · tkey/tkey · GitHub

also refer this where you can get the webstorage(device) module share