Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authorising with magic.link #302

Open
owengot opened this issue Jan 30, 2022 · 1 comment
Open

Authorising with magic.link #302

owengot opened this issue Jan 30, 2022 · 1 comment

Comments

@owengot
Copy link

owengot commented Jan 30, 2022

In the javascript documentation there are examples of authenticating users with MetaMask and 3Box - I am wondering how to go about doing this with magic.link? Going by the 3box example, I would generate a private key and convert it to a string, magic.link then offers an endpoint to generate an ID Token - so I have ended up with this:

const identity = await PrivateKey.fromRandom()
const identityString = identity.privKey.toString()
const idToken = await magic.user.generateIdToken({ attachment: identityString });

however the return ID payload, after base64 decode, does not resemble the private key originally generated. In this case it looks something like 0xd05f8c5d1d81818f77538579bff1c944acf3165b606c19a11e8086d36eca739e0c96ad19eaacbe435352b18672023062698b22723677ff8bf87355d4e104d1281b

Would appreciate any advice.

@joewagner
Copy link
Member

joewagner commented Feb 2, 2022

@owengot Sorry for the delay in response here. Concerning your issue, I'm not familiar enough with magic.link to be much help. We have moved to using discord almost everything feel free to join us there https://discord.gg/P5yw8eHE

Looking at the magic docs it looks like the value you're seeing is an encoded JSON tuple that would be [proof, claim]. Once you decode it, what are you seeing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants