|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.shiro.realm.CachingRealm
org.apache.shiro.realm.AuthenticatingRealm
org.apache.shiro.realm.AuthorizingRealm
com.vii.brillien.services.sso.shiro.BrillienRealm
public class BrillienRealm
Specialized AuthorizingRealm to make Brillien-like DataSources available
Field Summary | |
---|---|
protected String |
authenticationQuery
|
protected String |
datasourcePresence
|
protected static String |
DEFAULT_AUTHENTICATION_QUERY
The default query used to retrieve account data for the user. |
protected static String |
DEFAULT_PERMISSIONS_QUERY
The default query used to retrieve permissions that apply to a particular role. |
protected static String |
DEFAULT_USER_ROLES_QUERY
The default query used to retrieve the roles that apply to a user. |
protected boolean |
permissionsLookupEnabled
|
protected String |
permissionsQuery
|
protected String |
userRolesQuery
|
Constructor Summary | |
---|---|
BrillienRealm()
|
Method Summary | |
---|---|
protected org.apache.shiro.authc.AuthenticationInfo |
buildAuthenticationInfo(String username,
char[] password)
|
protected org.apache.shiro.authc.AuthenticationInfo |
doGetAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken token)
|
protected org.apache.shiro.authz.AuthorizationInfo |
doGetAuthorizationInfo(org.apache.shiro.subject.PrincipalCollection principals)
This implementation of the interface expects the principals collection to return a String username keyed off of this realm's name |
protected Connection |
getConnection()
|
String |
getDatasourcePresence()
|
protected Set<String> |
getPermissions(Connection conn,
String username,
Collection<String> roleNames)
|
protected Set<String> |
getRoleNamesForUser(Connection conn,
String username)
|
protected void |
retrieveConnection(Connection c)
|
void |
setAuthenticationQuery(String authenticationQuery)
Overrides the default query used to retrieve a user's password during authentication. |
void |
setDatasourcePresence(String datasourcePresence)
|
void |
setPermissionsLookupEnabled(boolean permissionsLookupEnabled)
Enables lookup of permissions during authorization. |
void |
setPermissionsQuery(String permissionsQuery)
Overrides the default query used to retrieve a user's permissions during authorization. |
void |
setUserRolesQuery(String userRolesQuery)
Overrides the default query used to retrieve a user's roles during authorization. |
Methods inherited from class org.apache.shiro.realm.AuthorizingRealm |
---|
afterCacheManagerSet, checkPermission, checkPermission, checkPermission, checkPermissions, checkPermissions, checkPermissions, checkRole, checkRole, checkRoles, checkRoles, checkRoles, clearCachedAuthorizationInfo, doClearCache, getAuthorizationCache, getAuthorizationCacheKey, getAuthorizationCacheName, getAuthorizationInfo, getPermissionResolver, getRolePermissionResolver, hasAllRoles, hasRole, hasRole, hasRoles, hasRoles, isAuthorizationCachingEnabled, isPermitted, isPermitted, isPermitted, isPermitted, isPermitted, isPermittedAll, isPermittedAll, isPermittedAll, onInit, setAuthorizationCache, setAuthorizationCacheName, setAuthorizationCachingEnabled, setName, setPermissionResolver, setRolePermissionResolver |
Methods inherited from class org.apache.shiro.realm.AuthenticatingRealm |
---|
assertCredentialsMatch, clearCachedAuthenticationInfo, getAuthenticationCache, getAuthenticationCacheKey, getAuthenticationCacheKey, getAuthenticationCacheName, getAuthenticationInfo, getAuthenticationTokenClass, getCredentialsMatcher, init, isAuthenticationCachingEnabled, isAuthenticationCachingEnabled, setAuthenticationCache, setAuthenticationCacheName, setAuthenticationCachingEnabled, setAuthenticationTokenClass, setCredentialsMatcher, supports |
Methods inherited from class org.apache.shiro.realm.CachingRealm |
---|
clearCache, getAvailablePrincipal, getCacheManager, getName, isCachingEnabled, onLogout, setCacheManager, setCachingEnabled |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.shiro.util.Initializable |
---|
init |
Field Detail |
---|
protected static final String DEFAULT_AUTHENTICATION_QUERY
protected static final String DEFAULT_USER_ROLES_QUERY
protected static final String DEFAULT_PERMISSIONS_QUERY
protected String datasourcePresence
protected String authenticationQuery
protected String userRolesQuery
protected String permissionsQuery
protected boolean permissionsLookupEnabled
Constructor Detail |
---|
public BrillienRealm()
Method Detail |
---|
public String getDatasourcePresence()
public void setDatasourcePresence(String datasourcePresence) throws BrillienException
BrillienException
protected Connection getConnection() throws BrillienException
BrillienException
protected void retrieveConnection(Connection c) throws BrillienException
BrillienException
public void setAuthenticationQuery(String authenticationQuery)
doGetAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken)
or
just getPasswordForUser(java.sql.Connection,String)
authenticationQuery
- the query to use for authentication.DEFAULT_AUTHENTICATION_QUERY
public void setUserRolesQuery(String userRolesQuery)
doGetAuthorizationInfo(PrincipalCollection)
or just
getRoleNamesForUser(java.sql.Connection,String)
userRolesQuery
- the query to use for retrieving a user's roles.DEFAULT_USER_ROLES_QUERY
public void setPermissionsQuery(String permissionsQuery)
doGetAuthorizationInfo(org.apache.shiro.subject.PrincipalCollection)
or just
getPermissions(java.sql.Connection,String,java.util.Collection)
Permissions are only retrieved if you set permissionsLookupEnabled
to true. Otherwise,
this query is ignored.
permissionsQuery
- the query to use for retrieving permissions for a role.DEFAULT_PERMISSIONS_QUERY
,
setPermissionsLookupEnabled(boolean)
public void setPermissionsLookupEnabled(boolean permissionsLookupEnabled)
permissionsLookupEnabled
- true if permissions should be looked up during authorization, or false if only
roles should be looked up.protected org.apache.shiro.authc.AuthenticationInfo doGetAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken token) throws org.apache.shiro.authc.AuthenticationException
doGetAuthenticationInfo
in class org.apache.shiro.realm.AuthenticatingRealm
org.apache.shiro.authc.AuthenticationException
protected org.apache.shiro.authc.AuthenticationInfo buildAuthenticationInfo(String username, char[] password)
protected org.apache.shiro.authz.AuthorizationInfo doGetAuthorizationInfo(org.apache.shiro.subject.PrincipalCollection principals)
name
doGetAuthorizationInfo
in class org.apache.shiro.realm.AuthorizingRealm
AuthorizingRealm.getAuthorizationInfo(org.apache.shiro.subject.PrincipalCollection)
protected Set<String> getRoleNamesForUser(Connection conn, String username) throws SQLException
SQLException
protected Set<String> getPermissions(Connection conn, String username, Collection<String> roleNames) throws SQLException
SQLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |