开发者

Google Analyrics gapi PHP uses unencrypted username and password

开发者 https://www.devze.com 2023-04-10 16:20 出处:网络
I\'m working on an dashboard for my cms containing widgets. On of the widgets uses Google Analytics data.

I'm working on an dashboard for my cms containing widgets. On of the widgets uses Google Analytics data.

开发者_StackOverflow社区

For retreiving the data I'm using the G Analytics php library 'gapi' (click). This class requires me to give the username and password for google analytics. That would mean I can't encrypt the password.

I don't have to tell you guys that storing unencrypted passwords is a bad idea. Though it would cost me a lot of extra time to abandon the gapi class and build the widgets all over again.

Is there any other way of authenticating with google without me having to abandon the gapi class.

Thanks in advance!


Short answer: Not really. That's par for the course with ClientLogin.

If you're concerned about plaintext password storage (which you rightly should be), then you should be implementing one of the 2 secure authentication methods that Google Analytics provides.

Either:

OAuth Authentication with Google Analytics

or

AuthSub Authentication with Google Analytics

Now, I actually jerry-rigged the GAPI.php to work with AuthSub, because the Google Analytics Client Library that Google provided wasn't working for me. I can pass that along if you're interested, but its kind of messy.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号