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

Configure OAuth/JWT flow for Meetup #122

Open
1 task done
zenlex opened this issue Oct 22, 2022 · 0 comments
Open
1 task done

Configure OAuth/JWT flow for Meetup #122

zenlex opened this issue Oct 22, 2022 · 0 comments
Labels
back end apis, server logic, plugins

Comments

@zenlex
Copy link
Collaborator

zenlex commented Oct 22, 2022

Note: for support questions, please use #ug-code-for-tulsa slack channel in Techlahoma or stackoverflow. This repository's issues are reserved for feature requests and bug reports.

sample flow from slack meetup connection:

const fs = require('fs');
const privateKey = fs.readFileSync(`${__dirname}/../jwt_priv.pem`, 'utf8');
​
// source .env file one directory up
const env = require('dotenv').config({path: `${__dirname}/../.env`});
const SELF_ID = env.parsed.SELF_ID;
const CLIENT_SECRET = env.parsed.CLIENT_SECRET;
const SIGNING_KEY_ID = env.parsed.SIGNING_KEY_ID;
​
const token = jwt.sign(
  {},
  privateKey,
  {
    algorithm: 'RS256',
    issuer: CLIENT_SECRET,
    subject: SELF_ID,
    audience: 'api.meetup.com',
    keyid: SIGNING_KEY_ID,
    expiresIn: 120
  }
);
​
console.log(token);
@zenlex zenlex added the back end apis, server logic, plugins label Oct 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
back end apis, server logic, plugins
Projects
Status: Backlog
Development

No branches or pull requests

1 participant