oAuth2 - How to change access_type

Hello everyone,

I have successfully implemented "Login via Google account" and everything is okay except one thing. There is a boring message "Have offline access".

I would like to know how to set:

  • access_type to online

  • approval_prompt to force

I cannot find in documentation nor Google.



Does anyone know something about this?


when are you getting this message "Have offline access" ?

I’m not sure that it’s the best way, but I use this code:

class Google extends \yii\authclient\clients\GoogleOAuth


public function buildAuthUrl(array $params = [])


    $params['access_type'] = "offline";

    $params['prompt'] = "select_account";

    return parent::buildAuthUrl($params);