18.05.2016 Views

Mittwoch, 18. Mai, 2016

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

MongoDB CRUD the MVC way with Passport Authentication 89<br />

Twitter_3<br />

Set the strategy<br />

Take note of the Consumer Key (API key) and Consumer Secret (API secret) values; enter them in<br />

the config/env/development.js file:<br />

1 twitter: {<br />

2 clientID: 'API key',<br />

3 clientSecret: 'API secret',<br />

4 callbackURL: 'http://localhost:1337/oauth/twitter/callback'<br />

5 }<br />

Now, create a new twitter.js file in the config/strategies folder and put the following code inside:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!