I see on the documentation that you need to set access_type=offline
in order to get refresh token.
I did set this value in OAuth url and I clearly see it properly set along with other parameters. However, I still don't get refresh token back as a response. I copy & pasted OAuth2 related code from this documentation.