org.nakedobjects.plugins.hibernate.authentication
Class DatabaseAuthenticator
java.lang.Object
org.nakedobjects.runtime.authentication.standard.AuthenticatorAbstract
org.nakedobjects.plugins.hibernate.authentication.DatabaseAuthenticator
- All Implemented Interfaces:
- ApplicationScopedComponent, Component, Authenticator
public class DatabaseAuthenticator
- extends AuthenticatorAbstract
example properties for various database types:
nakedobjects.component.authenticator.algorithm= MD5
nakedobjects.component.authenticator.selectusersql.default = \
select count(*) \
from user u \
where username = ? and password = ?
nakedobjects.component.authenticator.selectrolessql.default = \
select r.rolename as rr \
from role r, user u, user_role ur \
where r.id = ur.role and ur.user = u.id and u.username = ?
nakedobjects.component.authenticator.selectusersql.hsqldb = \
select count(*) \
from user u \
where username = ? and password = ?
nakedobjects.component.authenticator.selectrolessql.hsqldb = \
select r.rolename as rr \
from role r, user u, user_role ur \
where r.id = ur.role and ur.user = u.id \
and u.username = ?
nakedobjects.component.authenticator.selectusersql.mysql =
select count(*) from `user` u \
where `username` = ? and `password` = ?
nakedobjects.component.authenticator.selectrolessql.mysql = \
select r.`rolename` as rr \
from `role` r, `user` u, `user_role` ur \
where r.`id` = ur.`role` and ur.`user` = u.`id` and u.`username` = ?
nakedobjects.component.authenticator.selectusersql.postgresql = \
select count(*) \
from "user" u \
where "username" = ? and "password" = ?
nakedobjects.component.authenticator.selectrolessql.postgresql = \
select r."rolename" as rr \
from "role" r, "user" u, "user_role" ur \
where r."id" = ur."role" and ur."user" = u."id" and u."username" = ?
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DatabaseAuthenticator
public DatabaseAuthenticator(NakedObjectConfiguration configuration)
generateHash
public java.lang.String generateHash(java.lang.String key)
isValidUser
public final boolean isValidUser(AuthenticationRequest request)
isValid
public final boolean isValid(AuthenticationRequest request)
canAuthenticate
public final boolean canAuthenticate(AuthenticationRequest request)
Copyright © 2001-2009 Naked Objects Group Ltd.. All Rights Reserved.