So Please anyone share the code to retrieve the token automatically.
I've been looking at OAuth quite recently myself and I'm struggling!
Anyway - this is not the perfect answer you want - but perhaps it can get you further than I did.
sorry I cant be of more help,
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta