plp050452 / simplesamlphp

Automatically exported from code.google.com/p/simplesamlphp
Other
0 stars 0 forks source link

[patch] rewrite sspmod_sqlauth_Auth_Source_SQL class to be extendible #462

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. I will extends the sspmod_sqlauth_Auth_Source_SQL class and use my own 
password check method

What version of the product are you using? On what operating system?
trunk

Please provide any additional information below.
At the moment it is not possible to extends the sspmod_sqlauth_Auth_Source_SQL 
class and override only one method to validate the password.
So i have rewrite the class. It has a little bc break you must change the sql 
query it is documented in the docs see patch only remove the password from 
where and add it to the selected fields.

No it is possible to extends the class and only override the checkPassword() 
method.

Also it has now a filterAttributes method.

Original issue reported on code.google.com by gordonfr...@googlemail.com on 7 Dec 2011 at 11:37

Attachments:

GoogleCodeExporter commented 8 years ago
I'd rather avoid breaking backwardscompatibility in this way.

But: When you are implementing a custom function, how much of the 
login()-function do you actually need to use? The current function is slightly 
complex in order to allow for complex joins. If you are implementing a custom 
function in any case, couldn't you just execute the query directly and create 
the attributes-array manually?

Original comment by olavmrk@gmail.com on 7 Dec 2011 at 12:06

GoogleCodeExporter commented 8 years ago
Yes i can, like describe in the docs.

But in the end i have a 95% copy of the existing class and must make sure to 
use the correct exception messages. So i think it is simpler to extends the 
class and only override the one checkPassword method.

Original comment by gordon.f...@web.de on 7 Dec 2011 at 4:30

GoogleCodeExporter commented 8 years ago
Just to be clear: My suggestion was to override the login()-function, instead 
of trying to split out a checkPassword()-function from it. Unfortunately, the 
connect()-function is currently marked as private, but I am not against 
changing that.

You are not required to preserve exception messages, except for the 
"WRONGUSERPASS" error.

Original comment by olavmrk@gmail.com on 8 Dec 2011 at 8:40

GoogleCodeExporter commented 8 years ago

Original comment by jaim...@gmail.com on 26 Feb 2014 at 1:57

GoogleCodeExporter commented 8 years ago
Closing the issue here, moved to:

https://github.com/simplesamlphp/simplesamlphp/issues/34

Original comment by jaim...@gmail.com on 27 Feb 2014 at 7:25