Google Sign-in Requesting “Have offline access” – HybridAuth Fix
A customer of our ProfilePress WordPress plugin reported an issue where previously Google-authorized users of his website were being requested to grant his website offline access to their account.
We use the popular HybridAuth library to power the social login feature of ProfilePress. In this tutorial, I am going to show us how to fix this issue in it.
Fixing this issue is as easy as making the following modification to your existing Google HybridAuth config array.
- Change the profile and email scope to the newer ones.
- Include
approval_prompt
andaccess_type
parameter to the config with their values set toauto
andonline
respectively.
Below is the code for the Google HybridAuth configuration with the modification above applied.
"Google" => array( "enabled" => true, "scope" => "profile " . "https://www.googleapis.com/auth/plus.profile.emails.read", // optional "keys" => array( "id" => "", "secret" => "", "approval_prompt" => "auto", // optional "access_type" => "online", // optional |
La Fin!
0 comments:
Post a Comment