1000% Free, fully managed service for authentication with Google, Microsoft, Facebook, Twitter, Github, Discord & Steam.
Users don't feel a thing.
The easiest way to authenticate users isn't with email, password, passkeys...
It's stealing other people's code.
"Sign in with [service]" is a shiny solution to all of your issues. Simply let someone else do it! It's convenient for users, free, and... a pain to set up.
Either
https://auth.coding398.dev/go/[SERVICE]?callback=[CALLBACK_URL]
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjEsRmaLt0GyimmeZpsKf
Pm88VPm/kTMu2/aGGxnSXhcyM/FXZfI4LPB2AJsSxTauS43rKiq+Owvh4yWIUs1f
vFzJ1NUrResuizAF1W2akKPsAloxTgxshBhVApNX55erAHo40OY1w4o+dfLd3jnG
7KrbkcaHQTlhXP4+USm5lIQmn95+v1l4zny8JCqE1S8wqhLWewmFsBy1QdDMYhDC
hA96KwXIxfOqtPfsj9+W5isFMMt232JYxuebgjnXSKrRecumDyFEmZbSO4B0Kjsk
8nIyP4GDC+RT7uszCcnL6CfqjPCK+/ppDZdCRjcdSSFzrbRPLTwxv2ZCRTRRY8/6
aQIDAQAB
-----END PUBLIC KEY-----
const jose = require('jose')
const alg = 'RS256'
const spki = `-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjEsRmaLt0GyimmeZpsKf
Pm88VPm/kTMu2/aGGxnSXhcyM/FXZfI4LPB2AJsSxTauS43rKiq+Owvh4yWIUs1f
vFzJ1NUrResuizAF1W2akKPsAloxTgxshBhVApNX55erAHo40OY1w4o+dfLd3jnG
7KrbkcaHQTlhXP4+USm5lIQmn95+v1l4zny8JCqE1S8wqhLWewmFsBy1QdDMYhDC
hA96KwXIxfOqtPfsj9+W5isFMMt232JYxuebgjnXSKrRecumDyFEmZbSO4B0Kjsk
8nIyP4GDC+RT7uszCcnL6CfqjPCK+/ppDZdCRjcdSSFzrbRPLTwxv2ZCRTRRY8/6
aQIDAQAB
-----END PUBLIC KEY-----`
const publicKey = await jose.importSPKI(spki, alg)
const jwt =
'eyJhbGciOiJSUzI1NiJ9.eyJpZCI6InR3dC4xNDgyOTkzOTYxMDQ4NjI1MTUzIiwibiI6IkxhY2hsYW4gTm9ibGUiLCJwIjoiaHR0cHM6Ly9wYnMudHdpbWcuY29tL3Byb2ZpbGVfaW1hZ2VzLzE0ODI5OTQ4NzAwNzU5MzI2NzMval9jSkcwS2tfbm9ybWFsLmpwZyIsImlhdCI6MTcwMDcyNjE0NiwiZXhwIjoxNzAxMzMwOTQ2fQ.TQbQiyVReSob9_hRIrtWTJfIJ8o3hLQKKnlLdIVjBoIQd0O8z2qXFcYXToAhQRBBNcjs8o8EnhWfrIHkUkumi3M6VwMfFuNlc9vSfLPhMAFCLiQ-YcNfPeaGvC58rk3iH6PVVE5eZHzTzT0rHe_hAzEniEO2wqSYl6FwriZVMQb7yGQGLA1S2i1Ym9xGILSGElt3iCt7LPw_PoZeM-4U0jyZg79QnAmPmV632O4dk8sfC3LL82tTvOih2WjO-Mp_WDAGWGtn_cRp9d8HZfnbTDeyHljMTxPv3H2OZpx0sMfcIqgww66MhF0zP4WVNbEiT2oEfkcpDA4FdhfMRei5tA'
// This JWT is included in the callback. "jwt" query parameter.
const { payload } = await jose.jwtVerify(jwt, publicKey)
console.log(payload)
/*
{
id: 'twt.1482993961048625153',
n: 'Lachlan Noble',
p: 'https://pbs.twimg.com/profile_images/1482994870075932673/j_cJG0Kk_normal.jpg'
}
*/
https://auth.coding398.dev/go/microsoft?callback=[CALLBACK_URL]
Returns user ID "id", name "n", sometimes email "em"
https://auth.coding398.dev/go/google?callback=[CALLBACK_URL]
Returns user ID "id", name "n", profile picture "p"
https://auth.coding398.dev/go/steam?callback=[CALLBACK_URL]
Returns user ID "id", name "n", profile picture "p"
https://auth.coding398.dev/go/github?callback=[CALLBACK_URL]
Returns user ID "id", name "n", profile picture "p", Github Username "gh"
https://auth.coding398.dev/go/twitter?callback=[CALLBACK_URL]
Returns user ID "id", name "n", profile picture "p"
https://auth.coding398.dev/go/discord?callback=[CALLBACK_URL]
Returns user ID "id", display name "n", profile picture "p"
https://auth.coding398.dev/go/facebook?callback=[CALLBACK_URL]
Returns user ID "id", name "n"