I set up discourse locally. now i am trying to use discourse as identity provider. i followed this guide
but i am getting error
GET http://localhost:3000/session/sso_provider?sso=bm9uY2U9MWc3NlQyaHRVZTZTYzJENjVEbzlzUT09JnJldHVybl9zc29fdXJsPWh0dHA6Ly9sb2NhbGhvc3Q6ODA4MS9yZWRpcmVjdA%3D%3D&sig=abcdb4a453080b7bac871d1d8d660bc731cfbc2a26fc6013f19a848c0018461c 422 (Unprocessable Entity)
Note: my client making request is on localhost and discourse server is on localhost as well.
I tried looking for similar questions online but could not find any help. I am also posting my node js code for reference
app.get('/login', (req, res) => {
let nonce = crypto.randomBytes(16).toString('base64');
const payload = `nonce=${nonce}&return_sso_url=http://localhost:8081/redirect`
const base64 = Buffer.from(payload).toString('base64')
const URL_ENCODED_PAYLOAD = encodeURIComponent(base64)
let hmac = crypto.createHmac('sha256', 'myrandomstring')
hmac.update(URL_ENCODED_PAYLOAD)
let HEX_SIGNATURE = hmac.digest('hex').toLowerCase()
res.redirect(`http://localhost:3000/session/sso_provider?sso=${URL_ENCODED_PAYLOAD}&sig=${HEX_SIGNATURE}`)
})
Can anyone please help me figure out why its not working? Thanks