Opencart - 从谷歌API重定向时防止管理员注销问题?

I need to get data from Google drive. So I've written an API call in my admin page controller.

Once the page is loaded, it get redirected to google authentication page where we need to confirm authentication. So after authentication, it gets redirected to the admin page, but as the token parameter is missing it gets logged out. It's possible to pass token parameter to api call as parameter name - 'state' (google oauth2 redirect_uri with several parameters) in API call and I will get it back in the response as get param 'state'.

How can I MAP parameter name 'state' to 'token' in my admin controller to prevent the Logout issue?

Set your Oauth redirect uri to include the current token, or you can add the controller in question to the ignored arrays in admin/controller/common/home.php inside the login() and permission() methods.