How to get security roles in a JSF portlet

I need to get the LDAP user-roles available in the Sun Portal Server 7 in my JSF-168 portlet.
I've added the mapping file, updated the portlet.xml and web.xml, deployed the portlet (psconsole). But the portlet shows the "content not available" error with javax....title title.
I've probably messed up the descriptors, but I don't see what is wrong. Here they are:
roleMaps.properties
cn\=VSM.Administrator,dc\=neco,dc\=cz=Administrator
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4">
  <context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>server</param-value>
  </context-param>
  <context-param>
    <param-name>javax.faces.CONFIG_FILES</param-name>
    <param-value>/WEB-INF/navigation.xml,/WEB-INF/managed-beans.xml</param-value>
  </context-param>
  <context-param>
    <param-name>com.sun.faces.validateXml</param-name>
    <param-value>true</param-value>
  </context-param>
  <context-param>
    <param-name>com.sun.faces.verifyObjects</param-name>
    <param-value>false</param-value>
  </context-param>
  <filter>
    <filter-name>UploadFilter</filter-name>
    <filter-class>com.sun.rave.web.ui.util.UploadFilter</filter-class>
    <init-param>
      <description>
          The maximum allowed upload size in bytes.  If this is set
          to a negative value, there is no maximum.  The default
          value is 1000000.
        </description>
      <param-name>maxSize</param-name>
      <param-value>1000000</param-value>
    </init-param>
    <init-param>
      <description>
          The size (in bytes) of an uploaded file which, if it is
          exceeded, will cause the file to be written directly to
          disk instead of stored in memory.  Files smaller than or
          equal to this size will be stored in memory.  The default
          value is 4096.
        </description>
      <param-name>sizeThreshold</param-name>
      <param-value>4096</param-value>
    </init-param>
  </filter>
  <filter-mapping>
    <filter-name>UploadFilter</filter-name>
    <servlet-name>Faces Servlet</servlet-name>
  </filter-mapping>
  <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet>
    <servlet-name>ExceptionHandlerServlet</servlet-name>
    <servlet-class>com.sun.errorhandler.ExceptionHandler</servlet-class>
    <init-param>
      <param-name>errorHost</param-name>
      <param-value>localhost</param-value>
    </init-param>
    <init-param>
      <param-name>errorPort</param-name>
      <param-value>25444</param-value>
    </init-param>
  </servlet>
  <servlet>
    <servlet-name>ThemeServlet</servlet-name>
    <servlet-class>com.sun.rave.web.ui.theme.ThemeServlet</servlet-class>
  </servlet>
  <servlet>
    <description>Generated By Sun Java Studio Creator</description>
    <display-name>CreatorPortlet Wrapper</display-name>
    <servlet-name>VSMPortal</servlet-name>
    <servlet-class>org.apache.pluto.core.PortletServlet</servlet-class>
    <init-param>
      <param-name>portlet-class</param-name>
      <param-value>com.sun.faces.portlet.FacesPortlet</param-value>
    </init-param>
    <init-param>
      <param-name>portlet-guid</param-name>
      <param-value>VSMPortal.VSMPortal</param-value>
    </init-param>
  </servlet>
  <servlet-mapping>
    <servlet-name>ExceptionHandlerServlet</servlet-name>
    <url-pattern>/error/ExceptionHandler</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>ThemeServlet</servlet-name>
    <url-pattern>/theme/*</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>VSMPortal</servlet-name>
    <url-pattern>/VSMPortal/*</url-pattern>
  </servlet-mapping>
  <welcome-file-list>
    <welcome-file>faces/null</welcome-file>
  </welcome-file-list>
  <error-page>
    <exception-type>javax.servlet.ServletException</exception-type>
    <location>/error/ExceptionHandler</location>
  </error-page>
  <error-page>
    <exception-type>java.io.IOException</exception-type>
    <location>/error/ExceptionHandler</location>
  </error-page>
  <error-page>
    <exception-type>javax.faces.FacesException</exception-type>
    <location>/error/ExceptionHandler</location>
  </error-page>
  <error-page>
    <exception-type>com.sun.rave.web.ui.appbase.ApplicationException</exception-type>
    <location>/error/ExceptionHandler</location>
  </error-page>
  <jsp-config>
    <jsp-property-group>
      <url-pattern>*.jspf</url-pattern>
      <is-xml>true</is-xml>
    </jsp-property-group>
  </jsp-config>
     <security-role>
          <role-name>Administrator</role-name>
     </security-role>          
</web-app>
portlet.xml
<?xml version='1.0' encoding='UTF-8' ?>
<portlet-app xmlns='http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd                         http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd' version='1.0'>
     <portlet>
          <description>Created By Java Studio Creator</description>
          <portlet-name>VSMPortal</portlet-name>
          <display-name>VSMPortal Portlet</display-name>
          <portlet-class>com.sun.faces.portlet.FacesPortlet</portlet-class>
          <init-param>
               <name>com.sun.faces.portlet.INIT_VIEW</name>
               <value>/Uctarna.jsp</value>
          </init-param>
          <expiration-cache>0</expiration-cache>
          <supports>
               <mime-type>text/html</mime-type>
               <portlet-mode>VIEW</portlet-mode>
          </supports>
          <supported-locale>en</supported-locale>
          <portlet-info>
               <title>VSMPortal</title>
               <short-title>VSMPortal</short-title>
               <keywords>Creator</keywords>
          </portlet-info>
          <security-role-ref>
               <role-name>Administrator</role-name>
               <role-link>Administrator</role-link>
          </security-role-ref>          
     </portlet>
</portlet-app>If I don't use the security-role and security-role-ref tags, the portlet works, and the isUserInRole method obviously doesn't.

Nobody uses the LDAP roles in a portlet? Anybody knows other thread discussing similar issue (I can't find anything)?

Similar Messages

  • How to get security roles

    Hi All,
    I want to know how to get the security roles which we configured in adfsecurity.
    Regards,
    Smaran

    Hi,
    to get all roles associated with the current user, try
    SecurityContext secCtx = ADFContext.getCurrent().getSecurityContext();
    String[] roles = secCtx.getUserRoles();
    To get access to the roles defined on the system (not user specific) then this requires OPSS access. The JavaDocs are here:
    http://download.oracle.com/docs/cd/E17904_01/apirefs.1111/e10686/toc.htm
    From the top of my head. this is how get access to the JPS context to query system resources.
    JpsContextFactory jpsfact = JpsContextFactory.getContextFactory();
    JpsContext jpxCtx = jpdfact.getContext();
    IdentityStoreService store = jpxCtx.getServiceInstance(IdentityStoreService.class);
    ... from here on I have no further hint without trying it myself. However, I hope I go you started
    Frank

  • How to get the role name in which query is published ?

    Hi Experts,
       Is there any table where i can get the name of the role in which a particular query is published. I know that if i have a role , i can check in pfcg giving that role name and in menu tab i can see all the queries published under that role. But if i know query but not role how to get the role name . Is there any table or functon modules or programs to get the information.
    Thanks & Regards
    Vamsi Kiran

    Check this table
    AGR_HIER

  • How to get the customize url of an portlet using PLSQL

    How to get the customize url of an portlet using PLSQL.

    Are you trying to call the portlet Customization form directly from the browser?

  • How to get form input in the same portlet using pageflow

    Hi this is premkumar
    i created 2 portlet in a portal how to get form input in the sampe portlet using
    pageflow
    help as early as possible

    Do to the complexity of the program we need to run it with sequences.  This is because we need to aquire data with DAQ until it reaches a certain point and then stop collecting so that it can do its process (only once for all times criteria is met), and then loop around till again collecting after DAQ drops back below certain point looking to once again reach that point.  Another flat sequence is going outside of this where I want to put the prompt and have a user input to affect how many times that that the inner loop is run (No a For Loop instead of the while loop will not work either for other reasons). 
    I just want to know if after the program starts you can have a user input that will change the effect of the rest of the programs action based on the number inputed.

  • How do get the role from ldap session.

    i am using the follwing getting the role from the request in openldap and j_security_check:
    f(request.isUserInRole("manager")){
    how can i use this in the session:

    You might wanna change permissions for that attribute ...
    Change it from Admin to OWNER and you should be able to then get it for any user ...
    HTH ..

  • How to use security roles in Weblogic server?

    Hello Gurus,
    I am new to Weblogic server and I am trying to investigate how to make
    use of security roles in weblogic server (5.1.0). Can anyone point me
    to some documentation. Specifically, I am looking for instance level,
    and method level security and how to use it.
    Thanks for taking your time to read this e-mail.
    Thank You all in advance,
    Hari.

    You should read the security information in the Servlet 2.2 specification
    that WL 5.1 implements:
    http://java.sun.com/products/servlet/download.html
    Chapter 11 deals with declarative and programmatic security, and includes a
    section on roles:
    11.4 Roles
    A role is an abstract logical grouping of users that is defined by the
    Application Developer or
    Assembler. When the application is deployed, these roles are mapped by a
    Deployer to security
    identities, such as principals or groups, in the runtime environment.
    A servlet container enforces declarative or programmatic security for the
    principal associated with
    an incoming request based on the security attributes of that calling
    principal. For example,
    1. When a deployer has mapped a security role to a user group in the
    operational environment. The
    user group to which the calling principal belongs is retrieved from its
    security attributes. If the
    principal's user group matches the user group in the operational environment
    that the security
    role has been mapped to, the principal is in the security role.
    2. When a deployer has mapped a security role to a principal name in a
    security policy domain, the
    principal name of the calling principal is retrieved from its security
    attributes. If the principal is
    the same as the principal to which the security role was mapped, the calling
    principal is in the
    security role.
    Cameron Purdy
    http://www.tangosol.com
    "Hari" <[email protected]> wrote in message
    news:[email protected]..
    Hello Gurus,
    I am new to Weblogic server and I am trying to investigate how to make
    use of security roles in weblogic server (5.1.0). Can anyone point me
    to some documentation. Specifically, I am looking for instance level,
    and method level security and how to use it.
    Thanks for taking your time to read this e-mail.
    Thank You all in advance,
    Hari.

  • How to get the Role of the logged in User?

    Hi All,
    Enclosed below is the code am trying to use to get the role for a logged in portal user. But it fails
    1. Due to class path errors although I have imported the necessary jar files.
    2. Am unable to invoke/find getSAPUser() method or invoke the UMFactory.
    Iterator rit = null;
    IWDClientUser clientUser = WDClientUser.getCurrentUser();
    IUser user = clientUser.getSAPUser();
    rit = user.getRoles(true);
    IRoleFactory rfact = UMFactory.getRoleFactory();
    while (rit.hasNext()) {
    String roleName = (String) rit.next();
    IRole role = rfact.getRole(roleName);
    wdContext.currentContextElement().setRole(role);
    What could be the problem and what are the jars that need to imported as I am using EP7.0
    Thanks for all your help in advance.
    Best regards,
    Divya

    Hi Divya,
    Add WD_RUNTIME/com.sap.security/lib/com.sap.security.api.jar to your project`s java build path.
    Best regards, Maksim Rashchynski.

  • How Does The security-role Mapping Work?

              I am studying the security part of the deployment descriptor. I am confused about
              how the mapping works.
              Suppose we have
              <security-role>
              <role-name>manager</role-name>
              </security-role>
              and
              <security-role-ref>
              <role-name>FOO</role-name>
              <role-link>manager</role-link>
              </security-role-ref>
              My first question is when a client of the servlet supplies a name for authentication,
              the name supplied should be FOO or can be, say, John Smith?
              Then, according to the Servlet Specification, a security role is a logical grouping
              of users defined by the Application Developer
              or Assembler. When the application is deployed, roles are mapped by a Deployer
              to principals or groups in the runtime environment.
              My second question is how deployer maps the role, say, manager, to principals
              or groups in the runtime environment?
              Thanks in advance.
              

              Thanks a lot, Udit.
              "Udit Singh" <[email protected]> wrote:
              >
              >Hello,
              >The role-name is mapped to principals or gruops based on the security-role-assignment
              >entrires in weblogic.xml. Let us say you have a role-name FOO and you
              >want to
              >assing this role to users John and Mark. You need to make this entry
              >in weblogic.xml-
              ><security_role_assignment>
              > <role-name>FOO</role-name>
              > <principal-name>John</principal-name>
              > <principal-name>Mark</principal-name>
              > </security_role_assignment>
              >
              >so now actually the user need to supply John or Mark as user name at
              >the time
              >of authentication . Hope it helps.
              >
              >Udit
              >
              >
              >"[email protected]" entrance wrote:
              >>
              >>I am studying the security part of the deployment descriptor. I am confused
              >>about
              >>how the mapping works.
              >>Suppose we have
              >><security-role>
              >><role-name>manager</role-name>
              >></security-role>
              >>
              >>and
              >>
              >><security-role-ref>
              >><role-name>FOO</role-name>
              >><role-link>manager</role-link>
              >></security-role-ref>
              >>
              >>My first question is when a client of the servlet supplies a name for
              >>authentication,
              >>the name supplied should be FOO or can be, say, John Smith?
              >>
              >>Then, according to the Servlet Specification, a security role is a logical
              >>grouping
              >>of users defined by the Application Developer
              >>or Assembler. When the application is deployed, roles are mapped by
              >a
              >>Deployer
              >>to principals or groups in the runtime environment.
              >>
              >>My second question is how deployer maps the role, say, manager, to principals
              >>or groups in the runtime environment?
              >>
              >>Thanks in advance.
              >>
              >>
              >>
              >
              

  • How to get the roles/quotas

    Hi all,
    Db:oracle 9.2.0.6
    os:solaris 8
    can anyone please tell me.....how to get below details all of database users..like user roles,quotas....
    userid,default tablespace,default tablespace quota,system roles,other roles,password expairy.
    thanks,
    kk.

    kk001 wrote:
    Hi all,
    Db:oracle 9.2.0.6
    os:solaris 8
    can anyone please tell me.....how to get below details all of database users..like user roles,quotas....
    userid,default tablespace,default tablespace quota,system roles,other roles,password expairy.
    thanks,
    kk.
    You can query,
    -dba_users
    -dba_profiles
    -dba_roles
    -dba_tab_privs
    -etc
    Cheers

  • How to get the Role from a process

    Hi,
    I have a process where I have different role panes with human intervention activities. Each human intervention invokes a screenflow.
    Is there any method by which I can get the role pane from which an intance is generated
    For e.g. in process P1, I have 3 different role panes i.e. R1, R2, R3. Suppose there is an human intervention activity A3 in R3. It invokes a screenflow in which there are different methods. I want to get the roleId here i.e. R3.
    Through creation data I can know the instance creator i.e. participant ID, but a participant can have more than one role. I want to get the role from which the Human Intervention activity is invoked.
    Please suggest / help.
    Thanks
    Jayant

    Hey Thanks a tonn
    It works fine by the following code
    role = Activity.role
    logMessage "message"
    logMessage "Role: " + role.name
    role.id returns an int, so I used role.name
    Thanks and Regards
    Jayant

  • How to get security context in BPEL to get Logged in UserId

    Hi All,
    We have a requirement of getting security context in BPEL flow and from that we want to extract currentUserId. The requirement is to know who has initiated the composite flow. We are not passing userId in the event payload. In ADF we get the same through following expression:
    ADFContext.getCurrent().getSecurityContext().getUserName()
    Is there any similar api which we can access to get currentUserId?
    Thanks,
    Naga

    Hi,
    If your BPEL has oracle/wss_username_token_service_policy you can retrieve the username from the SOAP headers...
    Have a look at this...
    http://yuanmengblog.blogspot.com.au/2012/09/extracting-and-passing-wss-name-token.html
    Cheers,
    Vlad

  • How to get BI role in portal 2004s

    is there any delevered roles of BI/IP in portal 2004s ?
    do we have to download Business Package from SAP site to get more roles as we do not see any delivered roles for BI and IP in user admin of portal

    For BI specifically, there is the
    1. Business Explorer Role
    2. Business Intelligence Role
    3. Business Planning Role
    These are delivered roles and are installed with the BI-JAVA usage type. There is an additional role for admin cockpit called BI Administration Role. This role requires the Business Package for the Admin Cockpit to be downloaded and installed on your portal.

  • How to get Admin Roles using SPML in SUN IdM 7.1

    Hi,
    I am tring to get Roles and Admin roles using SPML in IdM 7.1.
    But i am able to get the Roles of the user using the attribute "Role"; For Admin role i tried with the attributes "AdminRole", "adminRole", "AdminRoles", "adminRoles". But I am not able to get the values.
    What is the attribute name where we can fetch the values of admin roles assigned to a user using SPML.
    Please let me know for any queries.
    Thanks and regards,
    Dinesh.

    Hi Dinesh,
    Try using waveset.adminRoles
    Thanks

  • How to get the bind value of a portlet in a page.

    I want to get the bind value of a portlet on a page. Can you tell me how can I get that.
    I used :
    portal30.wwv_name_value.get_string( l_arg_names, l_arg_values, '');
    It works ok when we run the report alone .But when we add the report as a portlet in page , it does not return any value. Can you tell me which Api does it.
    null

    Here is an example...
    var originalUnits = app.preferences.rulerUnits;
    app.preferences.rulerUnits = Units.PIXELS;
    var doc = activeDocument;
    var Colour1 = GetHexColour(eyeDropperRGB(1,doc.height-1));
    var Colour2 = GetHexColour(eyeDropperRGB(20,doc.height-5));
    var Colour3 = GetHexColour(eyeDropperRGB(40,doc.height-14));
    alert("Colour 1 = " +Colour1 + "\rColour 2 = " +Colour2 + "\rColour 3 = " +Colour3);
    var decColour = eyeDropperRGB(40,doc.height-14);
    alert("Red = " +decColour[0] + "\rGreen = " +decColour[1] + "\rBlue = " +decColour[2]);
    app.preferences.rulerUnits = originalUnits;
    function GetHexColour(reqHex){
    var out='';
    for(No in colours = reqHex){
    out = out.concat(zeroPad(d2h(reqHex[No]),2));
    return out;
    function eyeDropperRGB(x,y) {
    var x2 = x + 1;
    var y2 = y + 1;
    var out = new Array(3);
    activeDocument.selection.select([[x,y], [x2,y], [x2,y2], [x, y2]], SelectionType.REPLACE, 0, false);
    for(ch in list = ["Red", "Green", "Blue"]) {
    histogram = activeDocument.channels[list[ch]].histogram;
      for (i = 0; i <= 255; i++) {
       if (histogram[i]) {
        out[ch] = i;
        break;
      return out; 
    function d2h(d) {return d.toString(16);}
    function zeroPad(n, s) {
       n = n.toString();
       while (n.length < s)  n = '0' + n;
       return n;

Maybe you are looking for

  • Cannot sync ipod error message

    I am getting an error message on my MacBook Pro when I try to sync my ipod on itunes. The error message says "the ipod cannot be synced. The required file cannot be found.

  • Print probelm in po

    when i use po message print,the function below, call function 'ME_READ_PO_FOR_PRINTING'        exporting             ix_nast        = nast             ix_screen      = ent_screen        importing             ex_retco       = ent_retco             ex_

  • Apple tv not Privat Freigabe after update to 6.0

    after the update to 6.0 the apple tv can not find itunes sharings

  • Event as Type

    Hi ABAP-ers, i have one question about events in SAP. Is it possible to implement some event on GRID object in SAP, which handels input in one field. For example, user is typing name of matarials, and system then need to display data(propose) accordi

  • ABAP Cache Refresh: PIAPPLUSER gets locked

    Hi, well we are a little desperate. Concerning ABAP-Cache resfresh we already read in forum and this guide on how to handle XI-Cache (https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/1a69ea11-0d01-0010-fa80-b47a79301290) But the Ca