Hi Steven,

I don't think the statement "Credentials are actually an empty interface" is true. Well, it is *literally* true; the Credentials interface itself is empty. But it extends the Validated interface, which requires implementing a whole lot of methods that aren't necessarily relevant to arbitrary user-supplied credentials. For example, if your site uses an outside single-sign-on service, it never needs to present a login form to the user, and so never needs to do input validation on the user's credentials.

If you do single sign on, then you need to probably validate the authentication sessions differently also and you end up implementing a custom validation scheme.

To what extent can those methods just be implemented as stubs to keep the compiler happy?

Actually this is pretty easy to solve with MetaData merging. You should be able to just implement the Credentials interface in your CustomCredentialsMetaData sibling class and you should be set. More info here: http://rifers.org/docs/api/com/uwyn/rife/site/ MetaDataMerged.html

I think it would be swell if Credentials really was an empty interface as described. Any reason it can't stop subclassing Validated, if the RIFE classes that currently implement Credentials are also made to implement Validated explicitly?

Well, the whole point of using that Credentials interface is to be able to reuse the rest of the default authentication implementation. This implementation relies on the validation features to check the validity of the credentials data. While it is certainly technically possible to start splitting up the Credentials interface in only the methods that are needed for authentication, and the rest, I'm not sure it's a good approach. What happens when the authentication becomes more powerful and might need more? What happens if other elements are included in RIFE (like the Ajax validation), that will certainly need more (though not all of them)? The notion of splitting up the interface for making customization easier is an accident waiting to happen imho. I think that MetaData merging provides a solution here that should satisfy both requirements.

Take care,

Geert

--
Geert Bevin
Uwyn "Use what you need" - http://uwyn.com
RIFE Java application framework - http://rifers.org
Music and words - http://gbevin.com


_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users

Reply via email to