public class PicketBoxAuthorizationModule extends Object implements AuthorizationModule
Simple Authorization Module that authorizes users with the configured roles Note:The roles need to be placed as a comma separated list of values.
Example:
<policy xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:jboss:security-config:5.0"
xmlns="urn:jboss:security-config:5.0"
xmlns:jbxb="urn:jboss:security-config:5.0">
<application-policy name = "test">
<authentication>
<login-module code = "org.jboss.security.auth.spi.UsersRolesLoginModule"
flag = "required">
<module-option name = "name">1.1</module-option>
<module-option name = "succeed">true</module-option>
<module-option name = "throwEx">false</module-option>
</login-module>
</authentication>
<authorization>
<policy-module
code="org.picketbox.plugins.authorization.PicketBoxAuthorizationModule">
<module-option name="roles">validuser</module-option>
</policy-module>
</authorization>
</application-policy>
</policy>
Constructor and Description |
---|
PicketBoxAuthorizationModule() |
Modifier and Type | Method and Description |
---|---|
boolean |
abort()
Abort the Authorization Process
|
int |
authorize(Resource resource)
Authorize the resource
|
boolean |
commit()
Overall authorization process has succeeded.
|
boolean |
destroy()
A final cleanup opportunity offered
|
void |
initialize(Subject subject,
CallbackHandler handler,
Map<String,Object> sharedState,
Map<String,Object> options,
RoleGroup roles)
Initialize the module
|
public boolean abort() throws AuthorizationException
AuthorizationModule
abort
in interface AuthorizationModule
AuthorizationException
public int authorize(Resource resource)
AuthorizationModule
authorize
in interface AuthorizationModule
public boolean commit() throws AuthorizationException
AuthorizationModule
commit
in interface AuthorizationModule
AuthorizationException
public boolean destroy()
AuthorizationModule
destroy
in interface AuthorizationModule
public void initialize(Subject subject, CallbackHandler handler, Map<String,Object> sharedState, Map<String,Object> options, RoleGroup roles)
initialize
in interface AuthorizationModule
subject
- the authenticated subjecthandler
- CallbackHandlersharedState
- state shared with other configured modulesoptions
- options specified in the Configuration
for this particular moduleroles
- Roles of the subjectCopyright © 2021 JBoss by Red Hat. All rights reserved.