second (?) cut at an OAuth2
The extra method returns dictionary
Fixed errors in parameter names.
More robust code.