Appendix B. Extended code listings
This appendix contains extended code listings for the exercises throughout the book. In the chapters themselves, we’ve attempted to focus on the parts of the code necessary for functionality. We don’t replicate the whole code base, since that’s available on GitHub for your perusal at any time. However, it’s often useful to see the multiple snippets of code talked about in a chapter in a slightly larger context than is viable within a chapter. Here we list some of these larger functions referenced throughout the book.
Listing 1. Authorization request function (3-1)
app.get('/authorize', function(req, res){ access_token = null; state = randomstring.generate(); var authorizeUrl = buildUrl(authServer.authorizationEndpoint, ...
Get OAuth 2 in Action now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.