|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.force.sdk.oauth.AuthFilter
public class AuthFilter
This filter can be used to add Force.com OAuth Authentication to any web application. When configuring web.xml all requests that need to be authenticated should be sent through AuthFilter. The OAuth callback (usually _auth) must also be sent through AuthFilter. To use the connector, add the following servlet filter to your application's web.xml file:
<!-- Enables Security -->
<filter>
<filter-name>AuthFilter</filter-name>
<filter-class>com.force.sdk.oauth.AuthFilter</filter-class>
<init-param>
<param-name>connectionName</param-name>
<param-value>nameOfConnectionToUse</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>AuthFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
The OAuth Connector uses the Force.com API Connector to access the Force.com APIs. The connectionName is used to look up OAuth properties defined in an environment variable, or a Java system property, or in a properties file on the classpath. See @doclink connection-url for more information. Other init parameters that can be set are:
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.sforce.ws.SessionRenewer |
---|
com.sforce.ws.SessionRenewer.SessionRenewalHeader |
Constructor Summary | |
---|---|
AuthFilter()
|
Method Summary | |
---|---|
void |
destroy()
No resources to release. |
void |
doFilter(javax.servlet.ServletRequest sreq,
javax.servlet.ServletResponse sres,
javax.servlet.FilterChain chain)
Handle the secured requests. |
SecurityContextService |
getSecurityContextService()
|
void |
init(javax.servlet.FilterConfig config)
Initialize the filter from the init params. |
com.sforce.ws.SessionRenewer.SessionRenewalHeader |
renewSession(com.sforce.ws.ConnectorConfig config)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AuthFilter()
Method Detail |
---|
public void init(javax.servlet.FilterConfig config) throws javax.servlet.ServletException
init
in interface javax.servlet.Filter
javax.servlet.ServletException
public void doFilter(javax.servlet.ServletRequest sreq, javax.servlet.ServletResponse sres, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException
doFilter
in interface javax.servlet.Filter
IOException
javax.servlet.ServletException
public void destroy()
destroy
in interface javax.servlet.Filter
public SecurityContextService getSecurityContextService()
public com.sforce.ws.SessionRenewer.SessionRenewalHeader renewSession(com.sforce.ws.ConnectorConfig config) throws com.sforce.ws.ConnectionException
renewSession
in interface com.sforce.ws.SessionRenewer
com.sforce.ws.ConnectionException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |