The php SDK I am using has 14800 files totaling 37 MB!
I just want to validate a user.
I tried removing unnecessary services from composer.json. Still 14000+ files.
I just want to validate a user.
This just reinforces my general dislike of frameworks. Just so much of unnecessary fluff that your project if never going to use.
I just want to validate a user. It shouldn't require including 14000 files in my project.
By the way, I go out of my way to avoid signing into services using third parties for this reason. I don't use a Google account neither so I would be locked out of any service requiring one.
Your service will be highly dependent on Google if you only allow signing with Google and if they have a failure, your service will be unusable. Allowing other providers would highly improve this.
To paraphrase what @js4ever said, it would make sense to implement it yourself in your backend than depend on Google Sign In.
@jraph, I completely agree with you; it happened to me and stopped using Google, apart from an email I have for my mobile apps and that is rarely used.
It seems so simple to have a global standard for some government API with perhaps some [portable] card reader and perhaps some ISP logic. Nice developer tokens with permission levels that can be revoked?
Or is that [again] one more naive idea?
As a comparison: looking at googles docs for "Google Identity Toolkit" (which is abandoned, thanks google!), the used google/identity-toolkit-php-client[1] composer package installs ~196 files with ~212k LoC PHP source, totaling at around 7MB. Still a lot for validating a token, but most of that is from the google/apiclient library, which seems to be a generic client for google APIs, and the google/identity-toolkit-php-client just adds 10 files and 729 lines of php code, which seems pretty reasonable.
[edit]: Looking at the more recent (and alive) google/auth[2] seems to add around 200 files with 12k LoC PHP, including the guzzlehttp client, some firebase client and some psr API stubs.
[1]: https://packagist.org/packages/google/identity-toolkit-php-c... [2]: https://packagist.org/packages/google/auth
A couple of years back I installed a copy of Sonic Pi[1] on my machine and was horrified to see that the distribution basically dumped tens of thousands of extremely tiny Ruby files on the hard disk. Ever tried copying hundreds of thousands of sub 1 KB files from one disk to another and noticed the file system crying under the load?
Game developers solved this problem decades ago.[2][3] I don't know why other developers continue to be so backward in their thinking when distributing their software. You don't have to do anything special. Just use SQLite as a VFS and end the insanity.[4]
[1] https://github.com/sonic-pi-net/sonic-pi
[2] https://quakewiki.org/wiki/.pak
[3] https://wiki.totalwar.com/w/Community_hints,_tips_and_tutori...
Ugh, please don't do that. The whole point of using this SDK is that people can trust it works, and if there are bugs you can just bump your dependency.
It's a fair point to make that libraries are bloated these days, but manually hacking down dependencies, or re-inventing the wheel are far worse practices!
Besides the topic regarding "roll your own stuff" vs "use a huge library", I would ask a more business-oriented question: would your users be alright regarding signing in to your app using their Google accounts? What if they don't have one? Email address + password is usually a good approach when it comes to login: I can always use a fake email address if I don't trust your service, whereas if only "login via Google" is enabled, I'm just going to pass.
It's definitely the case that if you only want the one call out of the whole thing then you could get by with only a small chunk of that code, but writing the Client SDK so that each feature was entirely independent would be a lot more work for them.
So they make their lives easier, and you get to have an extra 37MB of code on your client.
1. Developers who understand it's not efficient to reinvent the wheel, and also very often more secure.
2. Developers who wouldn't be able to do it without the framework.
3. Personal data stealing businesses.
Learn to recognize each :)
Aren't there any third party oauth libs for php?
Using Sign in with Google just encourages use of Google. Is that really the best thing for users. Google is a privacy disaster
If you and your users truly both need authentication of each other why not let your users use x509 client certificates
You are probably already using x509 server certificates
The term "SDK" is synonymous with "unnecessary fluff". Its been that way since the 1990s
The tone of your post implies it should be easy.
There’s lots of stuff to do when validating a user.
Sure it’s not going to use 14,000 files but it’ll use lots of libraries to get things done.
> I just want to validate one user.
This is important enough to you that you say it multiple times.
And yet, if I have just a single user, I can validate them easily: we agree on terms for exchanging auth info as a one-off, job done. I might agree to meet them in person and they show me their driver's license, or whatever. The details are irrelevant: we just use whatever we agree verifies this person.
I think that, just perhaps, you might have more than one user, and you're trying to scale this.
So, where are the details?
How much are you trying to scale, and what are the constraints around privacy and so forth.
You can't just say "I want a cheap perfect auth system with no constraints except for some hidden constraints which I'll explain later."