Thank you David, you made my day!
-----Ursprüngliche Nachricht----- Von: David Sean Taylor [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 03. Februar 2006 11:23 An: Jetspeed Users List Betreff: Re: AW: AW: Access SSOProvider from Portlet Andreas Wiesauer wrote: > Hello David, > > thanks for your help. > Is it possible, instead of creating a new one, to take the principle of the > logged in user from the portlet context? > > Principal principal = portletContext.getUserPrincipal(); > Set principals = new PrincipalsSet(); > principals.add(principal); > Yes, from the portletRequest.getUserPrincipal() I meant to show that, thanks > Subject subject = new Subject(true, principals, new HashSet(), new HashSet); > > This would be a perfect solution! > > Best regards, > Andy > > -----Ursprüngliche Nachricht----- > Von: David Sean Taylor [mailto:[EMAIL PROTECTED] > Gesendet: Freitag, 03. Februar 2006 08:53 > An: Jetspeed Users List > Betreff: Re: AW: Access SSOProvider from Portlet > > Andreas Wiesauer wrote: > >>Hello, >> >>What I want to do is: >>I have a CMS with a proprietary API via a proprietary protocol. I want do >>develop my own SSOProxy-Portlet for the CMS using the Jetspeed built in >>SSO-Facility. >> >>My SSOProxy should establish a session with the CMS-API. The address and >>principals and the credentials should be stored as SSOSite via Jetspeed >>SSO-Admin (which is no problem). >> >>The steps my SSOProxy has to do are: >>1. Get the current user from PortletContext >>2. Access the Jetspeed-SSOProvider >>3. Get the SSOContext for the current user and the site from SSOProvider > > and > >>establish a session with remote principal and credential. >> >>My problems are: >>How can I access SSOProvider from my Portlet? > > > public class MyPortlet > { > private SSOProvider sso; > > public void init(PortletConfig config) > throws PortletException > { > super.init(config); > sso = > (SSOProvider)getPortletContext().getAttribute(CommonPortletServices.CPS_SSO_ > COMPONENT); > if (null == sso) > { > throw new PortletException("Failed to find the SSO Provider > on portlet initialization"); > } > } > > .... > > and in your jetspeed-portlet.xml: > > <js:services> > <js:service name="SSO" /> > </js:services> > > >>How can I get the subject of the user, so that I can execute >>SSOProvider.getCredentials(Subject subject, String site)? >> > > > Its not so easy to get Jetspeed's....perhaps you could create one on the > fly: > > Principal principal = new UserPrincipalImpl("anon"); > Set principals = new PrincipalsSet(); > principals.add(principal); > > Subject subject = new Subject(true, principals, new HashSet(), new HashSet); > > > >>It would be nice if you could help me, >> >>Best regards, >>Andy >> >>-----Ursprüngliche Nachricht----- >>Von: Andreas Wiesauer [mailto:[EMAIL PROTECTED] >>Gesendet: Donnerstag, 02. Februar 2006 16:13 >>An: 'Jetspeed Users List' >>Betreff: Access SSOProvider from Portlet >> >>Hello, >> >> >> >>is it possible to acces SSOProvider from my portlet? Does it work like >>accessing the UserManager? >> >> >> >>I can get the UserManager by: >> >> userManager = > > (UserManager)applicationMap.get(cps:UserManager); > >> >> >>It would be nice to access SSOProvider in the same way. >> >> >> >>Thanks for your help! >> >> >> >>Best regards >> >>Andy >> >> >> >> >>--------------------------------------------------------------------- >>To unsubscribe, e-mail: [EMAIL PROTECTED] >>For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> > > > -- David Sean Taylor Bluesunrise Software [EMAIL PROTECTED] [office] +01 707 773-4646 [mobile] +01 707 529 9194 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
