1
redirect_uri
set for the flow object should match the one you set in the Developers Console -> Credentials. Failing to do that leads to the redirect_uri_mismatch
you mentioned. You may also have a look at the web server flow example I provided at [1].
Source:stackexchange.com