190896 (15) [Avatar] Offline
Dear Forum,

I have downloaded the code as suggested. Made sure I am running the right version of node.js. For the first exercise in chapter 3 (folder ch-3-ex-1) When I click on the button "Get OAuth Token" I notice that is is calling the same client port i.e 9000. I would have assumed that it would call port 9001 which is the authorization server.

Can someone let me know if there is any code or updates I need to do just to get this working? A little disappointed as I just wanted to start the process and now find myself debugging node.js smilie

Any help to get me moving would be much appreciated.
Thanking you in advance.
Justin Richer (56) [Avatar] Offline
Please read appendix A as recommended to describe how the codebase works first. I think you're missing a few things about what's going on here, as from your description it doesn't sound like you're really debugging NodeJS.

First, the code that's in the exercises is incomplete by design -- you're supposed to follow along the chapter and fill in the missing pieces as you go. If you want to see the completed and working versions, check out the 'complete' folder.

Additionally, as described in chapter 3, the way the client software works in particular is that when you click the "Get Token" button it simply fetches a URL at the client to trigger the start of the OAuth process. The code that you fill in in client.js processes that browser request, which will cause a redirect to the authorization server on another port. The client software will do the redirect until you program that in, using the code in the exercises.

Hope this helps.