Skip to content

Instantly share code, notes, and snippets.

@anishsujanani
Created August 2, 2020 12:04
Show Gist options
  • Select an option

  • Save anishsujanani/7d719ac9c1c861446ea5aeaf1b0b6c33 to your computer and use it in GitHub Desktop.

Select an option

Save anishsujanani/7d719ac9c1c861446ea5aeaf1b0b6c33 to your computer and use it in GitHub Desktop.
Custom Oauth Client AuthME
app.post('/authme', (req, res) => {
var state = crypto.randomBytes(10).toString('hex');
params = `?response_type=code&client_id=${client_id}&scope=${req.body.selected_scope}&state=${state}&redirect_uri=${redirect_uri}`;
state_cache.push(state);
res.redirect( auth_server_authorize_endpoint + params );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment