WebSphere Portal Server - How can I get the current user's password in Websphere Portal Extend v4.2 from a portl

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Portal Server > January 2004 > How can I get the current user's password in Websphere Portal Extend v4.2 from a portl





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author How can I get the current user's password in Websphere Portal Extend v4.2 from a portl
David Contreras

2004-01-19, 3:00 pm

Hi!!

How can I get the current user's password in
Websphere Portal Extend v4.2 from a portlet??

I've tried with JAAS, but i received this error in the
portal's log:

Nested Exception is java.lang.LinkageError: Class
javax/security/auth/Subject violates loader
constraints: parent and child already loaded
different classes

the problem in my code is when i put this line:

Object[] principals =
subject.getPrincipals().toArray();

so i've tried with this one:

Object[] principal =
subject.getPrincipals(Class.forName("com.ibm.wps.sso.PasswordCredential")).t
oArr\
ay();

but nothing, it's the same.

Well, if someone can help me, i'll be thankful!!!

Bye


David Contreras

2004-01-19, 3:00 pm

Hi!!

I tried with your advice but i recive this message in the portla's log:

2003.11.14 11:12:56.734 LogServiceImpl log()
org.apache.jetspeed.portlet.PortletException: com.ibm.wps.engine.RunData:
method getUser()Lorg/apache/turbine/om/security/User; not found
And this one
Nested Exception is java.lang.NoSuchMethodError: com.ibm.wps.engine.RunData:
method getUser()Lorg/apache/turbine/om/security/User; not found

This is my code:

package com.meve.portlets;

import java.io.*;

import com.ibm.wps.engine.*;

import org.apache.jetspeed.portlet.*;

import org.apache.jetspeed.portlets.*;





public class Prueba extends PortletAdapter

{



public void doView(PortletRequest request, PortletResponse response)

throws PortletException,IOException

{

PrintWriter salida = response.getWriter();

User currentUser =
(User)RunData.from(request).getUser();

String login= (String)currentUser.getAttribute("uid");

String password
=(String)currentUser.getAttribute("userPassword");

salida.println("<br>Login: " + login);

salida.println("<br>Password: " + password);


}

}


"Fernanda Emanuella Silveira" <fe@inf.ufsc.br> wrote in message
news:Pine.GSO.4.44.0311131120150.12937-100000@venus...
quote:

>
>
> Inside a portlet try that:
>
> User currentUser = (User) RunData.from(request).getUser();
> String login = (String) currentUser.getAttribute("uid");
> String password = (String) currentUser.getAttribute("userPassword");
>
>
> Fernanda Silveira
> fe@inf.ufsc.br
>
> On Wed, 12 Nov 2003, David Contreras wrote:
>
subject.getPrincipals(Class.forName("com.ibm.wps.sso.PasswordCredential")).t[QUOTE][color=darkred]
>




2004-01-19, 3:00 pm

try this:

User currentUser = request.getUser();

String userid = currentUser.getUserID();

String password = currentUser.getAttribute("userPassword");

(i'm not sure about the attribute name for password)


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com