I am able to successfully authorize a user through Partner Connections Manager, but when I request tokens from https://www.googleapis.com/oauth2/v4/token using my authorization code, I do not receive a refresh_token in the response, only an access_token is present:
{
access_token: 'my-access-token',
expires_in: 3599,
scope: 'https://www.googleapis.com/auth/sdm.service',
token_type: 'Bearer'
}
Make sure to specify
access_type=offlinein your Partner Connections Manager (PCM) URL. Omitting it assumesaccess_type=online, which does not provide a refresh token.For example, the PCM URL should look something like this, where
access_type=offline:Then, the subsequent token response from
https://www.googleapis.com/oauth2/v4/tokenshould have what you expect:For more information, see Authorize an Account on the Device Access site.