123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- import com.cognos.CAM_AAA.authentication.INamespaceTrustedSignonProvider;
- import com.cognos.CAM_AAA.authentication.ITrustedSignonRequest;
- import com.cognos.CAM_AAA.authentication.SystemRecoverableException;
- import com.cognos.CAM_AAA.authentication.UnrecoverableException;
- import com.cognos.CAM_AAA.authentication.UserRecoverableException;
- public class TrustedSignonReplaceSample
- extends Namespace
- implements INamespaceTrustedSignonProvider
- {
- public TrustedSignonReplaceSample()
- {
- super();
- }
- public void processLogonRequest(ITrustedSignonRequest theRequest)
- throws
- UserRecoverableException,
- SystemRecoverableException,
- UnrecoverableException
- {
- String[] username = null;
-
- username = theRequest.getTrustedEnvVarValue("REMOTE_USER");
-
- if (username == null)
- {
- String[] theRequestedVars = new String[] {"REMOTE_USER"};
-
- SystemRecoverableException e = new SystemRecoverableException(
- "Requesting trusted REMOTE_USER.",
- theRequestedVars);
- throw e;
- }
- int slashPosition = username[0].indexOf('\\');
-
- if (slashPosition > 0)
- {
- username[0] = username[0].substring(slashPosition+1);
- }
-
- theRequest.setNamespaceID( "TS" );
-
-
-
- theRequest.removeTrustedEnvVar( "REMOTE_USER" );
- theRequest.addTrustedEnvVar( "REMOTE_USER", username[0] );
- }
- }
|