Using jsf to get SSO Ltpa-token exception - The internal portlet
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > WebSphere > WebSphere Portal Server > Using jsf to get SSO Ltpa-token exception - The internal portlet




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Using jsf to get SSO Ltpa-token exception - The internal portlet  


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-22-07 12:21 PM

Hi all,

Using Portal v.6.0.0.1.

Normally when you want a portlet to access a ltpatoken from the credential v
ault, you can use the following stubcode (mind you, this is just an example-
code):

import javax.naming.Context;
import javax.naming.InitialContext;
import com.ibm.wps.sso.LTPATokenCredential;
import com.ibm.portal.portlet.service.credentialvault.CredentialVaultService
;
import com.ibm.portal.portlet.service.PortletServiceHome;

...
getLTPAToken(PortletRequest request) {
Context ctx = new InitialContext();
PortletServiceHome cvHome = (PortletServiceHome)ctx.lookup("portletservice/c
om.ibm.portal.portlet.service.credentialvault.CredentialVaultService");
CredentialVaultService cvService = (CredentialVaultService)cvHome.getPortlet
Service(CredentialVaultService.class);
Subject sub = cvService.getUserSubject(request);
if (sub != null) {
Iterator privKey=sub. getPrivateCredentials(LTPATokenCredentia
l.class).iterat
or();
LTPATokenCredential token = null;
if(privKey.hasNext()) {
return (LTPATokenCredential) privKey.next();
}
}
return null;
}


If you would've configured SSO, the returned class contains a Ltpa-key.
And it does, <B>but not when using jsf</B>. Since the request are not adress
able directly you use the FacesContext to get the PortletRequest - PortletRe
quest request = (PortletRequest) FacesContext.getCurrentInstance().getExtern
alContext().getRequest();

But using this to get the PortletRequest throws a IllegalStateException - Th
e internal portlet request cannot be found. (pointing to "Subject sub = cvSe
rvice.getUserSubject(request);")


So what am I doing wrong? Is there a "feature" i miss in the jsf-spec?

Thanks in advance,
/Jonas V





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 01:55 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register