com.filenet.wcm.toolkit.server.base
Interface UserTokenPolicyInterface

All Known Implementing Classes:
InternalTokenPolicy, UserTokenPolicy

public interface UserTokenPolicyInterface

This interface represents token-based authentication. Implement this interface within your signin policy.


Method Summary
 int getTokenTimeoutInterval()
          Get the timeout interval for user tokens in seconds.
 java.lang.String getUserToken(java.lang.String user, java.lang.String password, WcmRequestMap extraParameters, boolean verify)
          Get an expirable user token.
 boolean isSignedIn(java.lang.String userToken)
          If the specified token represents a current signed in user, and is within the timeout, return true.
 boolean isTokenEnabled(boolean silent)
          Verify that any configuration required for dealing with user tokens has been done.
 java.lang.String setCredentials(java.lang.String userToken, boolean useAll)
          Set credentials via token by decoding the token, and validating credentials via WcmSignInPolicy.setCredentials.
 

Method Detail

isTokenEnabled

public boolean isTokenEnabled(boolean silent)
                       throws java.lang.Exception
Verify that any configuration required for dealing with user tokens has been done. If silent is true, and configuration is incomplete, false will be returned. Exceptions are caught and discarded in this case as well. If silent is false, and configuration is incomplete, an exception will be thrown in order to report details on any configuration issues.

Parameters:
silent -
Returns:
boolean true or false.
Throws:
java.lang.Exception

getUserToken

public java.lang.String getUserToken(java.lang.String user,
                                     java.lang.String password,
                                     WcmRequestMap extraParameters,
                                     boolean verify)
                              throws java.lang.Exception
Get an expirable user token.

Parameters:
user - - The user name.
password - - The user's password.
extraParameters - - Any additional parameters such as appId or domain, or others.
Returns:
A token that can be passed into the setCredentials signature in this interface to authenticate.
Throws:
java.lang.Exception

isSignedIn

public boolean isSignedIn(java.lang.String userToken)
If the specified token represents a current signed in user, and is within the timeout, return true.

Parameters:
userToken -
Returns:

setCredentials

public java.lang.String setCredentials(java.lang.String userToken,
                                       boolean useAll)
                                throws java.lang.Exception
Set credentials via token by decoding the token, and validating credentials via WcmSignInPolicy.setCredentials. Return the value returned from WcmSignInPolicy.setCredentials.

Parameters:
userToken - The user token retrieved via the getToken method in this interface.
useAll - When true, use all of the parameters contained in the token when signing in. If false, some parameters may be ignored and/or hard coded.
Returns:
String value of the page to redirect to, if successful.
Throws:
java.lang.Exception

getTokenTimeoutInterval

public int getTokenTimeoutInterval()
Get the timeout interval for user tokens in seconds.

Returns:
The timeout interval in seconds.


© Copyright IBM Corp. 2002, 2007. All Rights Reserved.