public class DefaultAuthService extends Object implements AuthService
| Modifier and Type | Field and Description |
|---|---|
protected Set<String> |
applicationRoles |
protected Authenticator |
authenticator |
protected GroupDetailsService |
groupDetailsService |
protected MapWithSets<String,String> |
groupIdToApplicationRoleMappings |
protected AuthListener |
listener |
protected MapWithSets<String,String> |
uriPatternsToApplicationRoleMappings |
protected UserDetailsService |
userDetailsService |
| Constructor and Description |
|---|
DefaultAuthService() |
protected Authenticator authenticator
protected GroupDetailsService groupDetailsService
protected MapWithSets<String,String> groupIdToApplicationRoleMappings
protected AuthListener listener
protected MapWithSets<String,String> uriPatternsToApplicationRoleMappings
protected UserDetailsService userDetailsService
public void assertAuthenticated()
throws PermissionDeniedException
assertAuthenticated in interface AuthServicePermissionDeniedExceptionpublic void assertIdentity(String userId) throws PermissionDeniedException
assertIdentity in interface AuthServicePermissionDeniedExceptionpublic void assertRole(String applicationRole) throws PermissionDeniedException
assertRole in interface AuthServicePermissionDeniedExceptionpublic void assertURIAccess(String uri) throws PermissionDeniedException
AuthServiceassertURIAccess in interface AuthServiceuri - resource address that for checkingPermissionDeniedException - throw if required are not availablepublic Authentication getAuthentication()
getAuthentication in interface AuthServicepublic Set<String> getGrantedRoles()
AuthServicegetGrantedRoles in interface AuthServicepublic Set<String> getGroupIds()
getGroupIds in interface AuthServicepublic boolean hasRole(String applicationRole)
hasRole in interface AuthServicepublic boolean isAuthenticated()
AuthServiceisAuthenticated in interface AuthServiceTRUE if user is authenticatedFALSE if user is not authenticatedpublic boolean isIdentity(String userId) throws PermissionDeniedException
isIdentity in interface AuthServicePermissionDeniedExceptionpublic void login(String logonName, String password) throws AuthenticationFailedException, AlreadyAuthenticatedException
login in interface AuthServiceAuthenticationFailedExceptionAlreadyAuthenticatedExceptionpublic void logout()
logout in interface AuthService@Inject public void setApplicationRoles(String[] applicationRoles)
applicationRoles - the applicationRoles to set@Inject public void setAuthenticator(Authenticator authenticator)
authenticator - the authenticator to set@Inject public void setGroupDetailsService(GroupDetailsService groupDetailsService)
groupDetailsService - the groupDetailsService to setpublic void setGroupIdToApplicationRoleMappings(Map<String,String> mappings) throws UnknownApplicationRoleException
mappings - format ? groupIdXXX -> roleXXXUnknownApplicationRoleExceptionpublic void setGroupIdToApplicationRoleMappingsViaStringArray(String[] mappings) throws UnknownApplicationRoleException
mappings - format = "groupIdXXX=roleXXX"UnknownApplicationRoleExceptionpublic void setListener(AuthListener listener)
setListener in interface AuthService@Inject public void setUriPatternsToApplicationRoleMappings(String[] mappings) throws UnknownApplicationRoleException
mappings - format = "/myuri*=roleXXX"UnknownApplicationRoleException@Inject public void setUserDetailsService(UserDetailsService userDetailsService)
userDetailsService - the userDetailsService to setCopyright © 2010–2021 Vegard IT GmbH, Germany. All rights reserved.