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

Similar Messages

  • 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)?

  • 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 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 security token from a URL in BPM

    Hi,
    I need to get a security token from a url in a business process.
    The URL is like:
    https://services.sapo.pt/STS/GetToken?ESBUsername=test&ESBPassword=test1
    If I paste it on the browser i get the token in the form:
    <ESBToken>
    a7d1cd4e20c9c1b437513d434abbfee83b1f8f32839b54e6632f2865631303b815547cf898...
    </ESBToken>
    What is the best way to get and map the token in an Integration Process in SAP XI? Is it possible by user defined function in mapping? How?
    Thanks in advance.

    I am not sure what you want to do!? Do you want to display the image file, save the image file? When you say you don't want it to exit, do you want it to be a persistant application?

  • How to get Default Role fron the EmployeeInfo

    How i can get the default role from the EmployeeInfo object ?

    When you search for "default role" in the SDK Helpcenter you will find that the Type property keeps this information...
    I have to admit though that this is far from being intuitive
    I only found it through checking the SQLs in MS SQL Profiler though.

  • How to get entitlement role list

    How can I get the portal entitlement role list by API?
    If I use
    RolePolicyManager.listRolesForResource(String anEntAppName,
    String aWebAppName,
    String aResourceId)
    How can I specified the aResourceId such that the roles of entire portal will
    be retreived?
    Or it is just a wrong approach? Thx a lot!!
    Ken

    I can get it by calling
    String str[] = RolePolicyManager.listRolesForResource(
    ApplicationHelper.getApplicationName(),
    ApplicationHelper.getWebAppName(getRequest()),
    EntitlementConstants.P13N_ROLE_POLICY_POOL
    "Ken" <[email protected]> wrote:
    >
    How can I get the portal entitlement role list by API?
    If I use
    RolePolicyManager.listRolesForResource(String anEntAppName,
    String aWebAppName,
    String aResourceId)
    How can I specified the aResourceId such that the roles of entire portal
    will
    be retreived?
    Or it is just a wrong approach? Thx a lot!!
    Ken

Maybe you are looking for