WebSphere Portal Server - How to get the User Name from the Principal Object using the JACC Policy Class

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Portal Server > September 2005 > How to get the User Name from the Principal Object using the JACC Policy Class





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 to get the User Name from the Principal Object using the JACC Policy Class

2005-09-16, 2:49 am

Here is the code which I trying to read the principal
,but I am getting null.

import javax.security.jacc.*;
import java.security.*;
import javax.security.auth.Subject;
import java.util.*;
public class SamplePolicy extends Policy
{
public boolean implies(ProtectionDomain domain, Permission permission){

Principal[] subjects = domain.getPrincipals();
if(subjects !=null && subjects.length>0){
sub = subjects[0].getName();
}

Can any one help me out.

Thanks,
B.Saroj kumar

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com