How do I get the Principals as well as the Permissions from Policy?

I know how to get the permissions from a Policy:
  MyPolicy.getPermissions()
How do i get the Principals and Permissions?
If I have:
grant MyPrincipalClass "Jeff" {
   permission MyPerm "doIt"
how do I then (in my code) get both the permission and the Principal?
I am currently doing this:
java.security.PermissionCollection pc = pol.getPermissions(new java.security.CodeSource(new java.net.URL("file:/D:/JAAS/"), null));
for (java.util.Enumeration en = pc.elements(); en.hasMoreElements(); )
                System.out.println(en.nextElement());
}

In reference to your earlier question about "setting the Principal"; those responders pointed you to the JAAS documentation, and that's the answer here, too. You need to implement a Policy class that uses the JAAS Subject as a parameter to the Policy constructor as well as to the getPermissions() method. The Subject contains the Principals that have been added to it by (your) involved LoginModules. I'm still using JAAS 1.0 on JDK 1.3, and am real not familiar yet with the JDK 1.4 version of Security, but; I think the same applies there. Keep in mind; the "grant" only declares the permissions for a Principal; it's up to the LoginModules to establish the identity (identities) of the authenticated Principal(s) to which those permissions are to be granted.

Similar Messages

  • I have subscribed to itunes match. How do I get the songs from my iphone into my itunes library which only shows the songs I have purchased? Lots of the songs on my iphone were taken from CD's years ago which is why I thought itunes match would help.

    I have subscribed to itunes match. How do I get the songs from my iphone 5 into my itunes library which  currrently only shows the songs I have purchased? I can see the songs on my iphone when I plug it into itunes on my computer, but don' know how to get them into the library.Lots of the songs on my iphone were taken from CD's years ago which is why I thought itunes match would help.I want to make the songs on my phone's itunes available to my husbands iphone and to my ipad as well.  All devices share the same itunes account.

    Hi,
    Read this user tip Recover your iTunes library from your iPod or iOS device
    Does it help?
    Jim

  • How can i get thes songs from ipod nano to the itunes libary??

    hi
    i have ipod nano and i sync it with over 500 songs .....my bad i lose all that songs on my libary  .... how can i get thes songs from ipod nano to the itunes libary??

    See this older post from another forum member Zevoneer on different ways to copy content from your iPod to your computer.
    https://discussions.apple.com/thread/2452022?start=0&tstart=0
    B-rock

  • How we can get the values  from one screen to another screen?

    hi guru's.
         how we can get the values  from one screen to another screen?
              we get values where cusor is placed but in my requirement i want to get to field values from one screen to another screen.
    regards.
      satheesh.

    Just think of dynpros as windows into the global memory of your program... so if you want the value of a field on dynpro 1234 to appear on dynpro 2345, then just pop the value into a global variable (i.e. one defined in your top include), and you will be able to see it in your second dynpro (assuming you make the field formats etc the same on both screens!).

  • How do I get the values from a form?

    How do I get the values from a form?

    You can try using request method..
    request.getParameter("yourFormInputName");
    Try this.

  • How do I get the contacts from my mac to syn with icloud? I need to back up my phone and don't want to lose my contacts when I get a new phone.

    How do I get the contacts from my mac to sync with Icloud? I need to back up my phone since I will be receiving a new one tomorrow and the icloud contacts are not the same as the ones on my mac.  Help me

    OS X Lion. 10.7. Your profile says your running 10.6.8, which is Snow Leopard. You need 10.7 to use iCloud with your Mac.

  • HT204053 i have an itunes library with 1,000+ songs on a pc.  my daughter has a macbook air and i loaded my apple ID onto it.  how do i get the songs from my itunes account to show up?  This works fine on her iPhone, but having trouble on the new macbook

    i have an itunes library with 1,000+ songs on a pc.  my daughter has a macbook air and i loaded my apple ID onto it.  how do i get the songs from my itunes account to show up?  This works fine on her iPhone, but having trouble on the new macbook air

    Hey kbert73
    I would do a transfer of purchases from the phone and not sync. If you sync then it will want to start over and sync music that is on the MacBook Pro. If you want to transfer the music, check out the article below that will give you multiple options on how to move. I have also provided on how to sync with multiple computers.
    iTunes: How to move your music to a new computer
    http://support.apple.com/kb/ht4527
    Using iPhone, iPad, or iPod with multiple computers
    http://support.apple.com/kb/ht1202
    Thanks for using Apple Support Communities.
    Regards,
    -Norm G.

  • I have signed into a new account on my itunes on my computer. How do I get the music from the new account to be displayed in my library, because I can only see the old accounts music.

    I have signed into a new account on my itunes on my windows computer. How do I get the music from the new account to be displayed in my library if only the old account's music is showing up?

    You can transfer the music purchased from iTunes Store to the computer but not music acquired somewhere else.
    Syncing is one way street, computer to iPhone. You have to use 3rd party tool to transfer music not from iTunes Store to the computer.

  • HT4437 I want to develop a software with AirPaly service for business things. How can I get the permission from Apple?

    I want to develop a software with AirPaly service for business things. How can I get the permission from Apple?
    This one is used in Windows laptop, and I want it support AirPlay service, but Apple doesn't publish the AirPlay protocol.
    Many thanks.

    Create a developer account, then access he developers forums and see if you can find the information that way 
    The other option would be to simply contact Apple directly.

  • My wife has an I Tunes account on our PC, I have an I tune account on my Mac Book Pro.   How can I get the music from her account on the PC to my account on the Mac Book and I phone?

    My wife has an I Tunes account on our PC, I have an I tune account on my Mac Book Pro.   How can I get the music from her account on the PC to my account on the Mac Book and I phone?

    IflyDavie wrote:
    I need help to delete my icloud account from my iPad.  It has "Find my iPad" on it and won't let me delete without the old password.  I don't want to reset password as it will require reset of Mac Book Pro and 2 iphones.  Help appreciated.
    Your description of the problem is a bit confusing.  Do you have ONLY ONE Apple ID or do you have MORE THAN ONE?

  • Can anyone let me know how can i get the ouput from BW in .txt format.

    Can anyone let me know how can i get the ouput from BW in .txt format. See we can get output as Excel(i.e BEX) and manually convert it into txt format. I need a direct or automated way to do the same.no human intervention.
    mail me at [email protected] or post answer in sdn.

    Please do not multiple post across forums..
    how can i save the data in BEX reports in .txt format automatically
    This helps in keeping track of answers and avoids the issue of repeated answers across forums...
    Please close one of the threads as answered and provide the link that you want to follow
    Arun

  • How Can we get the data from Non-SAP to SAP in WebDynpro

    Hi,
    I hope u understand my query, How can we get the data from Non-SAP to SAP thru WebDynpro Programming.
    Help out with the steps for getting the data or procedure.
    Regards,
    Mutyapu

    You can expose the APIs in the Non-SAP backend as Web Services, and consume them in SAP by creating an Enterprise Proxy. Then these can be called just like normal class methods from Web Dynpro.
    Regards,
    Nithya

  • How can I get the events from a java program?

    I want to make a monitor to watch a java program.How can I get the events from the GUI of this program some as mouse cliking, keyinput. So I can watch these in my monitor.
    Thanks

    Hi,
    To put a monitor to the events occuring in the GHUI u need to register required components with the appropriate EventListeners.
    Liek if u want to get notified when a mouse is clicked, then u need to add The MouseListener to the component which u want to be monitored.
    Say
    myFrame which is the JFrame object which shuld be monitored for the events.
    Then in ur program u have to add following code
    myFrame.addMouseListener( someObectReference );
    Here the someObjectReference should be an instance to a concrete class ..i.e. U write a class like the following
    public class MyMouseListener implements MouseListener {
    // override the followig methods
    public void mouseClicked(MouseEvent me){ sop("MOUSE CLICKED ON THE FRAME");}
    public void mousePressed(MouseEvent me){}
    public void mouseReleased(MouseEvent me){}
    If u dont want to use another class for listening to the events. Then u can make teh current class monitor the events. To do so ur class should implement the appropriate listener and should override the required methods.
    and u should say myFrame.addMouseListenet( this );
    thats it

  • My computer crashed and I no longer have the itunes library. i get an error msg that my iphone is synced to another library - how can I get the info from the phone to the itunes library?

    my computer crashed and I no longer have the itunes library. i get an error msg that my iphone 3g is synced to another library - how can I get the info from the phone to the itunes library without losing everything? How do I delete old audiobooks from my iphone?

    You can transfer itunes purchases:  File>Devices>Transfer Purchases
    The iphone is not a storage/backup device.  The sync is one way - computer to iphone.  The exception is itunes purchases.
    It has always been very basic to always maintain a backup copy of your computer.  Use your backup copy to put everything back.

  • My old computer crashed how do i get the music from my ipod to sinc with my itunes library?

    My old computer crashed how do i get the music from my ipod to sinc with my itunes library?

    You should be able to copy iTunes purchases to your computer's iTunes via File > Transfer Purchases. For music that you've bought from other sources or copied from your own CDs then have you not got a backup of them on, for example, an external drive that you can copy onto the computer ? If not then you will need to find a third-party program to copy them off - this post mentions some that were around a couple of years ago, whether they still exist and work I don't know.

Maybe you are looking for

  • Cant sync

    i have a problem with syncing as it states it cant begin with the iphone, what should i do ?

  • Weblogic 12.1.3 does not have jdk8 inbuilt

    Hi All, I have installed weblogic 12.1.3 with Java 8. but i when i go into the installation directory i do not come across any jdk or jrockit directories with Java8. Is there any reason these directories are not present as they were present in weblog

  • Lighning to 30-Pin Connector: iPhone not charging anymore

    My Lightning to 30-Pin Connector doesn't charge my iPhone anymore. Anyone similar problem? Can it be exchanged in the warranty time?

  • Retrieve available server names for MS SQL server

    hello Can somebody tell me how I can retrieve available server names for MS SQL server. When MS SQL server loads it asks for server name to connect but on the same time has a combobox with the available server names(instace+database name). How can I

  • What is the best way to ship a Mac Pro from Australia to New York

    I am migrating from Melbourne Australia to New York next month and naturally, i want my Mac Pro to come along for the ride. Has anyone expereienced a move like this?  Who would you reccommend as a transport company?