Had to add a parameter to authorization url in order to get a refresh token.