|
Wildfire 3.2.4 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jivesoftware.wildfire.sasl.AbstractAuthorizationProvider
public abstract class AbstractAuthorizationProvider
Provider for authorization. Unlike the AbstractAuthorizationPolicy class, this is intended for classes that need a more "heavyweight" solution, often that requires consulting some storage or external entity about each specific case. This class allows individual mappings between authenticated principals and usernames, and if the storage mechanism allows it, management of those mappings. Users that wish to integrate with their own authorization system must extend this class and implement the AuthorizationProvider interface then register the class with Wildfire in the wildfire.xml file. An entry in that file would look like the following:
<provider> <authorizationpolicy> <classlist>com.foo.auth.CustomPolicyProvider</classlist> </authorizationpolicy> </provider>
Constructor Summary | |
---|---|
AbstractAuthorizationProvider()
|
Method Summary | |
---|---|
abstract void |
addAuthorized(String username,
Collection<String> principals)
Add a Collection of users authorized to use the named user. |
abstract void |
addAuthorized(String username,
String principal)
Add a single authorized principal to use the named user. |
abstract boolean |
authorize(String username,
String principal)
Returns true if the principal is explicity authorized to the JID |
abstract String |
description()
Returns a description of the Policy |
abstract Collection<String> |
getAuthorized(String username)
Returns a String Collection of principals that are authorized to use the named user. |
abstract boolean |
isWritable()
Returns true if this AuthorizationProvider supports changing the list of authorized principals for users. |
abstract String |
name()
Returns the short name of the Policy |
abstract void |
setAuthorized(String username,
Collection<String> principals)
Set the users authorized to use the named user. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractAuthorizationProvider()
Method Detail |
---|
public abstract boolean authorize(String username, String principal)
authorize
in interface AuthorizationProvider
username
- The username requested.principal
- The principal requesting the username.
public abstract Collection<String> getAuthorized(String username)
username
- The username.
public abstract boolean isWritable()
public abstract void addAuthorized(String username, String principal) throws UnsupportedOperationException
username
- The username.principal
- The principal authorized to use the named user.
UnsupportedOperationException
- If this AuthorizationProvider cannot be updated.public abstract void addAuthorized(String username, Collection<String> principals) throws UnsupportedOperationException
username
- The username.principals
- The Collection of principals authorized to use the named user.
UnsupportedOperationException
- If this AuthorizationProvider cannot be updated.public abstract void setAuthorized(String username, Collection<String> principals) throws UnsupportedOperationException
username
- The username.principals
- The Collection of principals authorized to use the named user.
UnsupportedOperationException
- If this AuthorizationProvider cannot be updated.public abstract String name()
public abstract String description()
|
Wildfire 3.2.4 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |