I am new to cssdk and looking into Package com.interwoven.cssdk.access.Can any sugeest how can we fetch user credential using cssdk and authenticate them .Sample artifacts would be helpful .
Well, the first thing is you're either in the wrong forum, or your approach couldn't be more wrong.
Second, there's a bunch of different ways to get a CSClient object depending on the context.
1- Many places, workflow tasks in particular, will already provide you with one
2- Other places running within TeamSite (e.g. datasources) will provide you with the context string from which you can obtain a CSClient like this:
private static final String FACTORY_PARAMNAME = "csFactory"; private static final String FACTORY_PROPNAME = "com.interwoven.cssdk.factory.CSFactory"; private static final String FACTORY_DEFAULT = "com.interwoven.cssdk.factory.CSJavaFactory"; /* ... */ protected CSClient getClient(DataSourceContext context) throws CSException { Properties localProperties = new Properties(); String factoryClass = context.getParameter(FACTORY_PARAMNAME); if (StringUtils.isBlank(factoryClass)) { factoryClass = FACTORY_DEFAULT; } localProperties.setProperty(FACTORY_PROPNAME, factoryClass); CSFactory csFactory = CSFactory.getFactory(localProperties); CSClient client = csFactory.getClient(context.getSessionId(), Locale.ENGLISH, "MyDataSource", null); if (LOGGER.isDebugEnabled()) { LOGGER.debug("Datasource CurrentUser: " + (client == null ? null : client.getCurrentUser())); } return client; }
3- If you're building a custom servlet or JSP running within /iw-cc, you can get the CSClient from request.getAttribute("iw.csclient")
4- If none of the above apply, you must be writing a standalone Java app and you should carefully consider whether that's the best way to accomplish whatever you're doing. For such cases, you should refer to the examples under TeamSite/cssdk/samples/java.
Thanks rpoulin actually idea is to implement single sign on where we can authenticate at one place and redirect to respective servers on success .So I was figuring wheather we can use cssdk for that and for that we need to pull out username and pwd .Also I is it possible to use CSSDK beyond teamsite like on third party server may be Apache.
Rick's point is that you posted this in the LiveSite forum, which implies the runtime.
Maybe the moderators can move this thread to the TeamSite forum
The CSSDK cannot be used to find out a user's password. That would be a horrendous security violation.
Typically what happens is that your SSO provider acts as an "umbrella" and by the time you get to TeamSite, it has already validated the user credentials. In such a case, the CSFactory provides a getTrustedUser method that doesn't ask for a password, thereby allowing you to create a CSClient without revalidating the credentials. You could implement your own TS authentication filter that way, but it would be very unsupported. You certainly cannot use TeamSite to validate credentials and then tell other services that the user is who they say they are.
The CSSDK is the API for TeamSite, not a generic authentication framework, so it cannot be used anywhere else.
I am really thankful to you for such a indepth insight rpoulin.
With respect to SSO - there's documentation about it in one of the manuals.
I don't know if the manuals cover this, but (from my limited experience with SSO on Unix) SSO implies LDAP, which tends to imply Non-OS users (i.e. users not registered in /etc/passwd and /etc/shadow on the TS server) which then means that most (~ 95% +/-) of any Perl code customizations will fail to work in TeamSite.
So, depending on what kind of existing customizations you have - this could mean a significant amount of work...