i am extracting the authorization code with the below:
Yes, that should work.
B.T.W. you mentioned adding the openssl dll's to the directory.
using Lazarus 1.6.4 on Windows 7 64 bit
you would need libeay32.dll and ssleay32.dll in same directory as exe
But for just the HTTP server / authentication part you won't need these yet.
You only need them when doing https.
But my guess is that you will be doing the further communication via fphttp components for which you need https access.
First (and hardest) part is over