You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Andreas Wiesauer <an...@gmx.at> on 2006/02/02 16:13:24 UTC
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
AW: AW: AW: Access SSOProvider from Portlet
Posted by Andreas Wiesauer <an...@gmx.at>.
Thank you David,
you made my day!
-----Ursprüngliche Nachricht-----
Von: David Sean Taylor [mailto:david@bluesunrise.com]
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:david@bluesunrise.com]
> 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:andreas.wiesauer@gmx.at]
>>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: jetspeed-user-unsubscribe@portals.apache.org
>>For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>>
>>
>>
>
>
>
--
David Sean Taylor
Bluesunrise Software
david@bluesunrise.com
[office] +01 707 773-4646
[mobile] +01 707 529 9194
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org
Re: AW: AW: Access SSOProvider from Portlet
Posted by David Sean Taylor <da...@bluesunrise.com>.
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:david@bluesunrise.com]
> 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:andreas.wiesauer@gmx.at]
>>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: jetspeed-user-unsubscribe@portals.apache.org
>>For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>>
>>
>>
>
>
>
--
David Sean Taylor
Bluesunrise Software
david@bluesunrise.com
[office] +01 707 773-4646
[mobile] +01 707 529 9194
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org
AW: AW: Access SSOProvider from Portlet
Posted by Andreas Wiesauer <an...@gmx.at>.
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);
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:david@bluesunrise.com]
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:andreas.wiesauer@gmx.at]
> 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: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>
>
--
David Sean Taylor
Bluesunrise Software
david@bluesunrise.com
[office] +01 707 773-4646
[mobile] +01 707 529 9194
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org
Re: AW: Access SSOProvider from Portlet
Posted by David Sean Taylor <da...@bluesunrise.com>.
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:andreas.wiesauer@gmx.at]
> 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: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>
>
--
David Sean Taylor
Bluesunrise Software
david@bluesunrise.com
[office] +01 707 773-4646
[mobile] +01 707 529 9194
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org
AW: Access SSOProvider from Portlet
Posted by Andreas Wiesauer <an...@gmx.at>.
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?
How can I get the subject of the user, so that I can execute
SSOProvider.getCredentials(Subject subject, String site)?
It would be nice if you could help me,
Best regards,
Andy
-----Ursprüngliche Nachricht-----
Von: Andreas Wiesauer [mailto:andreas.wiesauer@gmx.at]
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: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org