|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jena.atlas.web.auth.AbstractCredentialsAuthenticator
org.apache.jena.atlas.web.auth.AbstractScopedAuthenticator<FormLogin>
org.apache.jena.atlas.web.auth.FormsAuthenticator
public class FormsAuthenticator
An authenticator capable of making Form based logins and using cookies to maintain authentication state. Different logins may be used for different services as required.
Note that logins are not exclusively scoped to the exact URI rather they are
scoped to any URI derived from the given URI. For example if you declared
logins for http://example.org they would also apply to
http://example.org/some/path/. When determining credentials the
longest match applies, so in the previous example you could define different
logins for the two URIs and URIs derived from
http://example.org/some/path/ would prefer the login for that URI
over those for http://example.org
| Constructor Summary | |
|---|---|
FormsAuthenticator(Map<URI,FormLogin> logins)
Creates a new authenticator with the given logins |
|
FormsAuthenticator(URI target,
FormLogin login)
Creates a new authenticator with the given login |
|
| Method Summary | |
|---|---|
void |
addLogin(URI target,
FormLogin login)
Adds a login to the authenticator preserving any existing cookies associated with the login |
void |
apply(org.apache.http.impl.client.AbstractHttpClient client,
org.apache.http.protocol.HttpContext httpContext,
URI target)
Applies any necessary authentication methods to the given HTTP Client |
void |
invalidate()
Invalidates the authenticator |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FormsAuthenticator(URI target,
FormLogin login)
target - Target URIlogin - Loginpublic FormsAuthenticator(Map<URI,FormLogin> logins)
logins - Logins| Method Detail |
|---|
public void apply(org.apache.http.impl.client.AbstractHttpClient client,
org.apache.http.protocol.HttpContext httpContext,
URI target)
HttpAuthenticator
The target parameter indicates the URI to which the request is
being made and so may be used by an authenticator to determine whether it
actually needs to apply any authentication or to scope authentication
appropriately.
apply in interface HttpAuthenticatorapply in class AbstractCredentialsAuthenticatorclient - HTTP ClienthttpContext - HTTP Contexttarget - Target URI to which code wants to authenticatepublic void invalidate()
HttpAuthenticatorAllows code to inform the authenticator that any cached authentication information should be invalidated. This can be useful after an authentication attempt fails or after a certain amount of time is passed. For many authenticators this may actually be a no-op since when using standard HTTP authentication typically you authenticate on every request and there are no cached authentication information. However more complex authentication mechanisms such as Form Based authentication may have cached information that discarding will force subsequent requests to re-authenticate.
invalidate in interface HttpAuthenticatorinvalidate in class AbstractCredentialsAuthenticator
public void addLogin(URI target,
FormLogin login)
target - Target URIlogin - Login
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||