| java.lang.Object org.sakaiproject.util.BasicAuth
BasicAuth | public class BasicAuth (Code) | | This is implemented in a filter, since most httpclients (ie non browser
clients) dont know what to do with a redirect.
There are 2 mechanisms for selecting basic authentication. 1. The client is
not a browser as reported by the BasicAuthFilter.isBrowser method. 2. The
user requested basic auth in the URL and the
BasicAuthFilter.requestedBasicAuth confirms this.
in sakai.properties if allowbasicauth.login = true, then this feature is
enabled in BasicAuthFilter, the determination of non browser clients is
driven by matching user agent headers against a sequence of regex patterns.
These are defined in BasicAuthFilter with the form if the pattern matches a
browser 1pattern or if it does not match 0pattern
Addtional patterns may be added to sakai.properties as a multiple string
property against login.browser.user.agent
The list is matched in order, the first match found being definitive. If no
match is found, then the client is assumed to be a browser.
e.g. if itunes was not listed as a client, either:
Add
login.browser.user.agent.count=1
login.browser.user.agent.1=0itunes.*
to sakai.properties, or
Add __auth=basic to the end of the url, e.g.
http://localhost:8080/access/wiki/123-1231-32123-132123/-.20.rss?someparam=someval&__auth=basic
This string is available in BasicAuthFilter.BASIC_AUTH_LOGIN_REQUEST
|
BASIC_AUTH_LOGIN_REQUEST | final public static String BASIC_AUTH_LOGIN_REQUEST(Code) | | The query parameter and value that indicates the request will want basic
auth if required
|
init | public void init()(Code) | | Initialise the patterns, since some of the spring stuf may not be up when
the bean is created, this is here to make certain that init is performed
when spring is ready
|
isBrowser | protected boolean isBrowser(String userAgentHeader)(Code) | | If this method returns true, the user agent is a browser
Parameters: header - |
requestedBasicAuth | protected boolean requestedBasicAuth(HttpServletRequest request)(Code) | | This method looks at the returnUrl and if there is a request parameter in
the URL requesting basic authentication, this method returns true
Parameters: returnUrl - |
|
|