@Context SecurityContext.isUserInRole does not work in RESTful Service

Hello


I have the following code in the ADF 12 c. It is a new Application, just to have a resource and the Adf security configured, without anything else.


GenericResource.java

Overview;

Import javax.ws.rs.GET;

Import javax.ws.rs.Path;

Import javax.ws.rs.core.Context;

Import javax.ws.rs.core.SecurityContext;

@Path ("view")

public class GenericResource {}

@Context

SecurityContext sc;

public GenericResource() {}

}

@GET

public String GetData {}

System.out.println (SC.getUserPrincipal ()); Returns the user name

System.out.println (SC. IsUserInRole ("HrRole")); It always returns false

System.out.println (SC.getUserPrincipal (). GetName()); Returns the user name

return "s";

}

}

I have test the code in the browser after login, the question is why sc.isUserInRole ("HrRole") always return false? I can get the user name of securityContext.

I tried to create a jsf page and the EL: #{securityContext.userInRole ['MyRole']} can return true on the page.

Is - this bug?

There is sth. I find on:

1. use the following code returns the right roles

String[] allUserRoles = ADFContext.getCurrent().getSecurityContext().getUserRoles();

2. the following code is not available, REST with secure ADF resources

sc.isUserInRole("HrRole")
#{securityContext.userInRole['MyRole']}
@AllowRoles.(...)

@@@

Thanks for the help!

Tags: Java

Similar Questions

  • Logitech USB microphone does not work with Vista, Service Pack 2, PC. ____

    My Logitech USB Desktop Microphone does not work with my Vista, Service Pack 2, the PC.  He asks the driver, but Logitech says it's in the Vista software, here is the largest part of the error message:

    Windows has detected a new device attached to your computer, but did not find the driver software, to make the device usable. Each device manufacturer typically includes the driver from a CD that comes with the device, or for download on its Web site.

    Signature of the problem: Problem event name: PnPDriverNotFound Architecture: x 64

    This seems to be a problem that's happened, but after searching for hours, I can't find a quick solution.  Any help?

    Hello

    Please do as I suggested in the answer above is probably the solution.

    You can also do this after the above.

    Follow these steps to remove corruption and missing/damaged file system repair or replacement.

    Run DiskCleanup - start - all programs - Accessories - System Tools - Disk Cleanup

    Start - type in the search box - find command top - RIGHT CLICK – RUN AS ADMIN

    sfc/scannow

    How to analyze the log file entries that the Microsoft Windows Resource Checker (SFC.exe) program
    generates in Windows Vista cbs.log
    http://support.Microsoft.com/kb/928228

    Then, run checkdisk - schedule it to run at next boot, then apply OK your way out, then restart.

    How to run the check disk at startup in Vista
    http://www.Vistax64.com/tutorials/67612-check-disk-Chkdsk.html

    -----------------------------------------------

    Then lets refresh the USB stack

    Control Panel - right CLICK on EVERYTHING - Serial USB controllers - Device Manager and UNINSTALL
    all except the category itself - REBOOT - it refreshes the drive and battery USB

    This KB shows XP how to and the method of Vista is identical
    http://support.Microsoft.com/kb/310575

    ----------------------------------------------

    If necessary try these two:

    Tips for solving problems of USB devices - and a Mr Fixit
    http://windowshelp.Microsoft.com/Windows/en-us/help/c39bd203-f729-47a4-8351-83291e13c8a81033.mspx#EGB

    Hardware devices not detected or not working - Mr. Fixit
    http://support.Microsoft.com/GP/hardware_device_problems

    I hope this helps.

    Rob - bicycle - Mark Twain said it is good.

  • PhotoShop CS3 authorization key does not work and customer service solution is to go to forum

    I reloaded my Photoshop CS3 after a hard drive crash and the authorization code provided after my last accident a year ago does not work. Adobe support claims to be unable to help and ask in the forum. How can I obtain a new authorization code or disable licensing for this very old but useful for my copy of Photoshop purposes so I do not continue to lose hours of frustration on this.

    I decided that maybe there is a problem of language/terminology at the heart of it, so I went back and very clearly identified in a new chat session, the serial number, activation number and requested the AUTHORIZATION CODE. The second session went well and I got my code without requests for screenshots, operating systems, and others.

  • Keyboard does not work after the service pack update

    Original title: keyboard problems

    I installed an update of the service Park on my laptop and now it's like my fn key is stuck. the correct key type if I hold down the fn key.

    Hello

    Method 1:

    Follow the steps in troubleshooting section and check if that helps.

    Some function keys or keyboard shortcuts do not work correctly on a computer that is running Windows 7

    http://support.Microsoft.com/kb/975741

    Method 2:

    Try to download and install the latest keyboard software drivers from the manufacturer's Web site and see if the problem is resolved.

    Updated a hardware driver that is not working properly

    http://Windows.Microsoft.com/en-us/Windows-Vista/update-a-driver-for-hardware-that-isn ' t-work correctly

  • Internet Explorer does not work after Vista Service Pack 2 installation with IE 8

    I accepted the installation of Vista Service Pack 2 yesterday with IE 8 upgrade.  Now, I can't get IE 8 or Firefox to connect to the Internet.  I checked my config proxy and it is set to auto detect.  I had Vista analyze my connection with my wireless router and it is no problem. Please notify.

    Uninstall IE8 and see if that helps:

    Click Start > right click on computer > properties > Windows updates down the lower left corner > updates installed in the lower left corner in the next window

    > then click the one that you don't want > uninstall will appear at the top > uninstall it.

    In addition, on the page where you clicked "Installed updates", click on change settings at the top left corner it

    > Change update settings in the next page of AutoUpdate to "check for updates but let me choose etc" > OK ".

    When you take a look at pending updates, you can either download/install them one at the time, namely the bad.

    > or if you do not need an individual > right-click on > UAC prompt > hide it

    See you soon.

    Mick Murphy - Microsoft partner

  • Satellite L505-13D - Fn key does not work

    Hello
    I have some problems in my laptop

    Key Fn - 1 does not work with any service of Toshiba, only with windows keys, this happened after some windows critical updates (win 7 64 bit)
    2. I have not found my cell phone ' number series or in the site Web of Toshiba part number.

    Please can someone help me
    Thank you

    Hello

    The FN keys are controlled by the Support of Flash memory card utility.
    You will need to reinstall this tool.
    But also the VAP (value added package) must be reinstalled.

    I recommend first of all remove the system from the Flash and the PPV card.
    Then restart the device and clean the registry with CCleaner.
    After that, you need to install the two tools VAP and Flash memory card Support utility

    Good bye

  • Context right click menu, in the MS apps does not work.

    When an application MS Office shortcut menu right click does not work; the material of Mouse & touchpad work. When this and other applications (especially when online) the menu pop-up Windows Live is automatically displayed when the cursor is over the menu options of the application (file, publishing, display, etc.).  ESC should be pressed to remove Windows Live menus so that the menu of the application are available.  I ran a Virus and SpyBot check, but nothing was detected.  Can you please help.

    Hello

    A defective Explorer shell extension in the right click menu seems to be the problem. It could also be linked to the third-party software.

    Follow the method 1 and method 2 to resolve this problem.

    Method 1:

    To check if the problem is caused by a third-party application, put your system at startup boot and see if right click works fine then.

    See this article for more details.

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7
    http://support.Microsoft.com/kb/929135

    Method 2:

    To see if the Explorer shell extension is corrupted or not, open the registry editor and save the selected branch, remove managers of context menus one by one.

    Important: This section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following link.

    http://Windows.Microsoft.com/en-us/Windows7/back-up-the-registry

    Open the registry editor and save the branch selected, delete management context menus one by one.

    To access the Registry Editor:

    (a) go to start and type regedit.exe.

    (b) managers of context menus are located in

    ·        [HKEY_CLASSES_ROOT\AllFileSystemObjects\shellex\ contextmenuhandlers]

    ·        [HKEY_CLASSES_ROOT\Folder\shellex\contextmenuhandlers]

    ·        [HKEY_CLASSES_ROOT\Directory\shellex\contextmenuhandlers]

    (c) select 'Register' - 'Export register', so you can restore your changes later. Choose to export only the selected branch.

    (d) now remove a context menu Manager after another, and then every time try (Windows Explorer) if right click works again. In this way, you should find the faulty extension.

    (e) when you've found, you must double-click on the .reg created above to restore all shell extensions and then only delete the faulty extension.

    Also check the properties of sensitivity of touchpad and mouse under the controls of the mouse.

    http://Windows.Microsoft.com/en-us/Windows7/change-mouse-settings

    Hope this information is useful.

    Amrita M

    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Service Web REST-output parameter does not work in the Manager POSITION

    I created a RESTful Web Service in Oracle Apex, using a POST method as a 'Manager'   I have installation 11 input parameters which all work fine, this is my setting an output that does not return successfully.

    Here are details on the output parameter

    Name: returns

    Name of the bind Variable: : return

    Access method: OUTPUT

    Source type: response

    Parameter type: String

    The actual source is a call to a pl/sql package that returns a value that I set: Returns equal to (for example: Returns: = v_result).   I tried this with header Type of Source and still the same result, "no exit".

    I see APEX calls wwv_flow_api.create_restful_param to generate the (import) settings, is there documentation on this procedure?

    How can I get this output parameter to return something to the answer?

    The application accepts a load of Json.

    Any help greatly appreciated

    Thank you

    James

    Solved my problem: feedback does not need to go back

    Does not work

    Name: returns

    Name of the bind Variable: : return

    Access method: OUTPUT

    Source type: response

    Parameter type: String

    Works

    Name: returns

    Name of the bind Variable: returns

    Access method: OUTPUT

    Source type: response

    Parameter type: String

  • My Pc came with Photoshop elements 11 I did a factory rest on my pc and now Photoshop does not work. The error code is 213:19 I have not the disc to install it came with the pc already installed.

    My Pc came with Photoshop elements 11 I did a factory rest on my pc and now Photoshop does not work. The error code is 213:19 I have not the disc to install it came with the pc already installed.

    I hope this will help:

    Error 213:19 | Problem is the license for this product

  • I installed photoshop cc 2014, but rest Camera Raw on Version 8.0. 8.5 update does not work.

    I installed photoshop cc 2014, but rest Camera Raw on Version 8.0. 8.5 update does not work.

    It is a common problem.  see if this helps you,

    After the Camera Raw 8.4.1 update 8.5, he return to 8.0

  • Shortcut Ctrl-Qoute for Refacturing in the context of SQL-worksheet does not work

    Hello

    the shortcut ctrl-quote in the contextmenu for SQL-worksheet Refacturing does not work on my German keyboard. I am tired of all combinations... functionality works via the context menu, but it's too slow to call him 3 times to get the source code in lower case.

    ... Any help?

    Thanks, Jürgen

    Try redefining it in tools | Preferences | Accelarators.

  • Satellite A60-122: screen does not work - rest black

    Hello!!

    Can someone help me please on a screen problem? I have a Toshiba Satellite A60-122 and when I turn it on the screen does not work. It remains black as if the power of the laptop was turned off. I tried to connect the laptop to an external monitor, but it still does not work. I have no more ideas of what can do to make it work.

    I already told to format the pc with the cd of restoration but without an image, it is impossible to do anything...
    Thank you

    Isabel

    Hello Isabel

    I'm not an expert, but if there is no image on LCD internal display and the external monitor, I assume that there is a problem with the graphics card. I think you should contact the customer Service of your country partner and let check the device.

    I also hope that the warranty is still valid and if something needs to be replaced they will do it for free.

    Bye and let us know if you have more information about it.

  • Search for Time Machine does not work in the mail.

    Hello

    I'm trying to retrieve/view old e-mail my Time Machine ups back. I am backup on an external hard drive.

    When I get TM since the Mail, search application 'in time' does not work. If I go TM said Finder, or from the desktop, it works fine.

    I had to reinstall my OS and am trying to update on El Capitan, (thanks to the kind assistance of AppleCare!), but in the meantime I am eager to find those old emails.

    Any suggestions please? Thank you.

    Although you can restore a snapshot of Time Machine messages in the Mail application, it usually will not work with messages that were saved by an outdated version of the mail. In this case, you must use another method.

    Please triple - click anywhere in the line below on this page to select:

    ~/Library/Mail

    Right-click or Ctrl-click on the highlighted line and select

    Services ▹ Open

    the contextual menu.* should open a folder.

    Enter Time Machine and scroll to the snapshot that you want to restore from. The folder named "Mail" are subfolders named "V2" and/or "V3" (according to the version of Mac OS X that was used at the time that the snapshot was taken.) Inside of one of these subfolders are several subfolders representing your e-mail accounts. The name refers to the email addresses that you use. Select the account folders you want and then select restore... to... in the action menu (gear icon) in the toolbar of the Snapshot window. Restore the files on the desktop and not in their original location.

    Import the mailbox in the folders that you restored to the office. The imported messages appear in a new mailbox. Move those you want to keep everywhere where you want and delete the rest. Then, delete the files on the desktop.

    * If you do not see the item context menu copy the selected text in the Clipboard by pressing Control-C key combination. In the Finder, select

    Go ▹ go to the folder...

    from the menu bar and paste it into the box that opens by pressing command + V. You won't see what you pasted a newline being included. Press return.

  • BUG theatre iMovie does not work since the Sierra

    A clean installed on my iMac end 2013. Since iMovie Theater connecting to iCloud does not work. Spinning Beachball. iCloud in the iMovie Theater tab symbol is not white. His gray-wash with a wave in it. It's still a bug in connection to the cloud. Same thing happened with the update to El Capitan or was he Yosemite? Rest of the app works, but cannot connect to my films.

    IMovie last Version.

    in the hope of a quick update

    Best regards

    Hello

    Maybe after the upgrade, you must re - connect to iCloud.   You could try to go to Apple system/preferences/iCloud and see.

    I don't have not yet upgraded to Sierra pending the resolution of any problem of bug.

    Best,

    Rich

  • Finger remains open does not work

    I am very concerned by exhaust on my 6s iphone home button so I put "Rest finger to open" but it doesn't work? Am I supposed to do something else?

    Just to clarify - when you say that it does not work you can answer with more details.

    If the phone is locked, you must physically, press the home button or the sleep/wake button and then rest your finger on the button Home. If you physically push the Home button, it should wake up and unlock the phone in virtually a single step, as the press wake up the phone and the finger being almost immediately this button indicates the contact id and unlocks the phone. Note that before iOS 10 physical pressure on one of the buttons was also required.

Maybe you are looking for