Just wondering if anyone can point me towards any docs about implementing google authentication for OpenFPL to make it easy for people to sign up.
Since the app is free to play, I only want to require users to have an Internet Identity if they win $FPL tokens, and then they claim them by mapping their Google Auth to an IID.
I have so many ways to win $FPL during the season, adding the barrier to entry (IID) after someone has won tokens seems like a good idea.
So I decided to try the same route as the new Bioniq site and use Web3Auth. I now have a JWT token I can submit to the backend with my users email address. To avoid spam I need to verify these in my backend canister. Do I need to build my own JWT verification library?
After JWT token verification I’m assuming it is just a case of creating a ‘fake’ principal which can be replaced later with an IID related one.
So I spoke to Bioniq (Bob) and tried implementing web3auth as I really like their login flow but I I get conflicts with the auth.worker service that works nicely when using IID. I really want both and don’t know if there is some underlying problem with using web3auth + IID, I don’t think you can currently use both on Bioniq.
A crude approach would be to associate a Google Oauth user identifier to an identity that you generate on the backend. You can then generate an identity on the backend on the fly like this:
import { Ed25519KeyIdentity } from '@dfinity/identity';
export function generateICUserIdentityString(): string {
const key = Ed25519KeyIdentity.generate();
return JSON.stringify(key.toJSON());
}
and then store the mapping in a database.
Then, getting the identity back from the key string is as easy as:
export function identityFromKeyString(key: string): Ed25519KeyIdentity {
return Ed25519KeyIdentity.fromParsedJson(JSON.parse(key));
}
A caveat here is that you are in full control of your users’ identities (keys).
Looking to streamline your app’s login process? Check out our Web3Auth SDKs – they’re super easy to set up! With our plug-and-play solution, you can integrate Google login seamlessly in just minutes. Plus, when it comes to security, we’ve got a unique approach. Web3Auth doesn’t store your keys. Instead, we divide them into multiple parts, so no single party has the complete key. It only gets reconstructed on the client side upon successful authentication. Your security is our priority. If you need a hand, I’m here to help. Join our friendly Web3Auth Community discourse and let’s make your authentication worries a thing of the past!
I implemented the modal in one of my projects and it works great. There are a few items that I couldn’t find in the we3auth documentation like how to delay the last screen in the modal (see shot below) or how to customize the close button.
I’ll hop on the Discord channel to discuss further.
If it’s convenient for you, could you please paste the link to the discourse thread here once you’ve opened it on the Web3Auth community? I’ll make sure to prioritize its resolution.
Regarding the SDK customization, the modal SDK offers limited options, including whitelabeling. If you’re looking to design the modal interface yourself while still leveraging Web3Auth for the login mechanics, the no modal SDK might be a better fit for your needs.