How to make the JMX custom authentication work ?

I am using the password and access file based authentication on JMX. When building my JMXConnectorServer, i use the property names and it works fine.
    Map<String, String> env = new HashMap<String, String>();
    env.put(ApplicationProperties.JMX_PWD_FILE_PROP, pwdFile);
    env.put(ApplicationProperties.JMX_ACCESS_FILE_PROP, accFile);
    connectorServer = JMXConnectorServerFactory.newJMXConnectorServer(jmxServiceURL, env, mBeanServer);However, now i want to use a custom authenticator and i implemented my own LoginModule to have a encrypted password in the password file. Thus the ideas is to have an encrypted password and plain text user name in the password file.
    public class ABCDJMXLoginModule implements LoginModule {
        private CallbackHandler callbackHandler;
        private Subject subject;
        private String u_username;
        private String u_password;
        private JMXPrincipal user;
        private Properties userCredentials;
        private String passwordFile;
        private String f_username;
        private String f_password;
        private static final Logger logger = LoggerFactory.getLogger(ABCDJMXLoginModule.class);
        public boolean abort() throws LoginException {
            // TODO Auto-generated method stub
            return false;
        public boolean commit() throws LoginException {
            // TODO Auto-generated method stub
            return true;
        public void initialize(Subject subject, CallbackHandler callbackHandler, Map<String, ?> sharedState,
                Map<String, ?> options) {
            this.subject = subject;
            this.callbackHandler = callbackHandler;
        public boolean login() throws LoginException {
            try {
                attemptLogin();
                loadPasswordFile();
            } catch (Exception e) {
                logger.info("Exception, e");
            if (u_username == null || u_password == null) {
                throw new LoginException("Either no username or no password specified");
            logger.info("Password from user and file : " + u_password + " :: " + f_password);
            if (u_password.equals(f_password)) {
                return true;
            return false;
        public boolean logout() throws LoginException {
            // TODO Auto-generated method stub
            return true;
        private void attemptLogin() throws LoginException {
            Callback[] callbacks = new Callback[2];
            callbacks[0] = new NameCallback("u_username");
            callbacks[1] = new PasswordCallback("u_password", false);
            try {
                callbackHandler.handle(callbacks);
            } catch (IOException e) {
                logger.error("IOException", e);
            } catch (UnsupportedCallbackException e) {
                logger.error("UnsupportedCallbackException", e);
            u_username = ((NameCallback) callbacks[0]).getName();
            user = new JMXPrincipal(u_username);
            char[] tmpPassword = ((PasswordCallback) callbacks[1]).getPassword();
            u_password = tmpPassword.toString();
            logger.info("UserName : " + u_username);
            logger.info("Password : " + u_password);
            System.arraycopy(tmpPassword, 0, u_password, 0, tmpPassword.length);
            ((PasswordCallback) callbacks[1]).clearPassword();
        private void loadPasswordFile() throws IOException {
            FileInputStream fis = null;
            passwordFile = "c:\\abcd.jmx.enc.password.file";
            try {
                fis = new FileInputStream(passwordFile);
            } catch (SecurityException e) {
                logger.error("Security Exception", e);
            BufferedInputStream bis = new BufferedInputStream(fis);
            userCredentials = new Properties();
            userCredentials.load(bis);
            bis.close();
            f_username = u_username;
            f_password = (String) userCredentials.get(f_username);
            logger.info("UserName before Decrypt : " + f_username);
            logger.info("Password from file before Decrypt : " + f_password);
            // decrypt the password from file and later compare it with user password from JConsole
            if (f_password != null) f_password = Cryptography.decrypt(f_password);
            logger.info("Password from file after Decrypt : " + f_password);
    }When i use the following code and try to connect via JConsole nothing happens.
    Map<String, String> env = new HashMap<String, String>();
    env.put(ApplicationProperties.JMX_PWD_FILE_PROP, pwdFile);
    env.put(ApplicationProperties.JMX_ACCESS_FILE_PROP, accFile);
    env.put("jmx.remote.x.login.config", "com.splwg.ejb.service.management.ABCDJMXLoginModule");
    connectorServer = JMXConnectorServerFactory.newJMXConnectorServer(jmxServiceURL, env, mBeanServer);Any ideas on why this happens ? For sure, i am also not coming into the ABCDJMXLoginModule class - I have some print statements there and none of them get printed. Any sort of ideas and solutions are appreciated. I tried with the property "com.sun.management.jmxremote.login.config" too. I was expecting that mentioning the property in the environment and passing it to the JMXCOnnectorServer would do all the trick.
Am i missing something ?

Hello dcloko_BR,
I downloaded and installed Lenovo´s The Lenovo Solution Center and now the solution center starts after pressing the blue button. Perhaps give it a try.
Edit: Upps sorry, only newer models are supported according to the readme.txt.
Best regards
Andreas
Follow @LenovoForums on Twitter! Try the forum search, before first posting: Forum Search Option
Please insert your type, model (not S/N) number and used OS in your posts.
I´m a volunteer here using New X1 Carbon, ThinkPad Yoga, Yoga 11s, Yoga 13, T430s,T510, X220t, IdeaCentre B540.
TIP: If your computer runs satisfactorily now, it may not be necessary to update the system.
 English Community       Deutsche Community       Comunidad en Español

Similar Messages

  • Has anyone figured out how to make the Yamaha 01V96i mixer work with Logic 9.1.8

    Has anyone figured out how to make the Yamaha 01V96i mixer work with Logic 9.1.8 as a control surface ?

    In YAMAHA01v96i:
    Go to DIO/SETUP select Generic DAW. Go to MIDI settings page and set the desired port (personally I use Number 1), Select the same audio frequency you use in your DAW (I use 44.1KhZ)...at this point You should save a scene in you 01V96i to avoid to repeat all the procedure again.
    Open studio manager, go to patch and set the input port from 17 to 32 respectively to USB1-USB16 (this will give you the return from you DAW to the 01v96i
    Save again the scene overwriting the old one.
    in LOGIC
    Click on preferences, select Audio then select 01v96i, then click on control surface and select Mackie design Baby HUI and in the midi session set the same port that you've been setting on the Yamaha 01V96i (Port 1 if you follow this example).
    That's more or less it.
    It worked for me...so far

  • How to make the same code that works only?

    how to make the same code that works only?
    code:
    Form2.Close = Me.Enabled = true
    effect such as this code

    I have this code:
    Public Class Form1
    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
    Form2.Show()
    Me.Enabled = False
    End Sub
    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
    Form3.Show()
    Me.Enabled = False
    End Sub
    End Class
    he wants to after closing Form2 and Form3 unblocked the whole form1
    it means that:
    when I click the button, displays the himself form2 and blocks himself form1" and after closing Form2 , unlocks himself Form1"
    the same with Form3

  • How to make the print, email button work in PDF output

    Hello,
    I'm using LC  Designer ES2 to create a xdp form with print, email and httpSubmit  button. Then using LC server to generatePDF output, binding with xml  dynamically. But after that I got the static pdf file and none of the  button work,
    I really need help on how to make it work. Any configuration, plug-in....
    Thanks,

    Hi,
    This is solved by note 1281208.
    Thanks,
    Edited by: Zhijie Kong on May 24, 2011 6:06 PM

  • How to make the Access Gate SDK work with Web Gate

    When we want control the display of one area in one page, we can define this area as one resource then control the access of it. But when the user has been authenticated in the application, how can we get the user session and then call Access Gate SDK to check if the user is authorized? The following is one utility class to archive it.
    * $Id: CreateUserAction.java,v 1.1 2005/10/11 23:19:34 jason Exp $
    * $Revision: 1.1 $
    * $Date: 2005/10/11 23:19:34 $
    * Copyright (C) 1972 - 2005, Oracle Co. All Rights Reserved
    * The program(s) herein may be used and/or copied only with
    * the written permission of Oracle Co. or in accordance with
    * the terms and conditions stipulated in the agreement/contract
    * under which the program(s) have been supplied.
    package oblix.view;
    import com.oblix.access.ObAccessException;
    import com.oblix.access.ObConfig;
    import com.oblix.access.ObResourceRequest;
    import com.oblix.access.ObUserSession;
    import javax.servlet.http.Cookie;
    import javax.servlet.http.HttpServletRequest;
    * @author zhoujian
    public class OblixUtil {
    private static String ObSSOCookie = "ObSSOCookie";
    private OblixUtil() {
    * Check if the user is Authorized
    * @param request
    * @param rescourceUrl
    * @return
    public static boolean isAuthorized(HttpServletRequest request,
    String rescourceUrl) {
    return isAuthorized(request, "http", rescourceUrl, "GET");
    * Check if the user is Authorized
    * @param request
    * @param resourceType
    * @param rescourceUrl
    * @param resourceMethod
    * @return
    private static boolean isAuthorized(HttpServletRequest request,
    String resourceType, String rescourceUrl, String resourceMethod) {
    try {
    ObConfig.initialize();
    ObResourceRequest resource = new ObResourceRequest(resourceType,
    rescourceUrl, resourceMethod);
    ObUserSession session = getObUserSession(request);
    return session.isAuthorized(resource);
    } catch (ObAccessException oe) {
    oe.printStackTrace();
    ObConfig.shutdown();
    return false;
    * Get the Oblix user session from the request.
    * @param request
    * @return
    * @throws ObAccessException
    private static ObUserSession getObUserSession(HttpServletRequest request)
    throws ObAccessException {
    String token = getCookieValueByName(request.getCookies(), ObSSOCookie);
    if (token != null) {
    return new ObUserSession(token);
    return null;
    private static String getCookieValueByName(Cookie[] cookies, String name) {
    for (int i = 0; i < cookies.length; i++) {
    if (cookies[i].getName().equalsIgnoreCase(name)) {
    return cookies[i].getValue();
    return null;
    }

    Couple of options. You seem have to taken the Access Gate based approach. I will throw this in any way and you can make a call which one you want to use.
    If its a web application you can control authorization based on Resource by defining policy in the Access Manager.
    You mentioned aout display of one area in one page. That should be driven off of User attribute or custom logic. If it is driven off of User attribute then you can return header variable and you can check in the code as opposed to writing custom access gate.
    Now if you do want to write custom access gate when the resource is already protected by a Web gate,
    you can get the ObSSOCookie from the users browser session.
    You can pass the URL to the IsAuthorized method and call.
    Now here you have to install the Access Server SDK on the server, create custom access gate and then write the code and deploy it on that server.
    THanks
    Ram

  • How to make the Sony HDR-HC3 work w/ you Mac.

    So I bought this amazing camera yesterday only to find out that true to form, Sony does NOT include ANY cables to transfer video from the tape to a computer (windows or Mac). They only supply a usb cable which only transfers pics from the memory stick.
    It does work! NO you don't have to do anything special to the settings as I've read in other posts. All you need to do is go to your local electronics store and buy a 6 to 4 pin (Firewire to iLink (Ieee) cable. The iLink port on your camera is actually at the front of your camera next to the lens (there's a hard to see cover).
    Open iMovieHD plug in the firewire/iLink cable. iMovie will instantly recognize your camera. If you have it camera mode, it will record. If it's in VCR mode, it will import the video.
    Once the video is imported. SAVE your movie immediately because as soon as you do anything, it crashes. Open iMovie back up and the movie is there, edit, play, etc.
    However I'm getting FinalCut tomorrow. iMovieHD just isn't that great of a program after all.

    I have the MSI DVD DR-8A and i've already burnt over a dozen HD-burn CDs without any problem  
    My only road block was to find how to use it with nero (it is presented as a different type of disk), but after i read nero doc and chose the right option, it has been flying. I'll report on my media later (i dont have them here).
    Edit: I've used
     - FujiFilm CDR 80minutes 24x
     - Memorex CDR 80 mins 48x
    No problem with either, burnt at the maximum 24x HD burn speed.
    My only gripe with HD burn is that it does not allow any overburning. Not a bit over the 1400Meg limit. not a big problem, though.
    Also, be cautious on WHAT you burn. CD are not a very good archival method. They can degrade quite fast and i would bet that HD-burn, being more precise, is more sensitive to those degradations too.

  • How to Make the Win7 Enterprise ISO work with Boot Camp?

    Hey...
    So I've acquired a new MBA. I didn't really want to considering all the issues out there (of which so far the volume fluctuation issues applies to me as well), but on Friday I need to bring some kind of laptop with me on a trip to record a song for a wedding next month. And for that, to make it worse, I need Winblows.
    So I got the Windows 7 Enterprise evaluation ISO. I let Boot Camp modify it and write it to a USB stick.
    But when I boot into the thing, I never get to actually install Windows, because I get "Install Windows": "Windows Setup encountered an internal error while loading or searching for an unattend answer file."
    What to do??!?!!

    Hmmm... That's strange!
    Seems there are some differences between DVDs for Windows 7 that the Apple tool doesn't know how to handle?
    The image I used to install with was the "7600.16385.090713-1255_x64fre_client_en-us_OEM_Ultimate-GRMCULXFREO_EN_DVD.iso " one — I believe I downloaded this from Microsoft at some point when they had it up for developer trials or something?
    The MD5 sum of that image is dad9f7a0b4d5d928a6a67ba6cd896350. You can check yours in Terminal by writing "md5 <path to your image file>".
    Perhaps if yours is different, you can find that other image online somewhere.
    HTH

  • How to make the Micrphone and speaker work?

    Just installed the new version of Conexant Smart Audio driver version 4.92.7.0/3.64.7.0 Release 2009/08/06
    on Lenevo T400 Windows Vista 32. My microphone was able to record voice but i cannot hear my voice on the speaker. No other devices are installed in the Recording Tab of Sound property except Internal Microphone. 
    Hope some was able to make this work. 
    botnoe 

    Hello dcloko_BR,
    I downloaded and installed Lenovo´s The Lenovo Solution Center and now the solution center starts after pressing the blue button. Perhaps give it a try.
    Edit: Upps sorry, only newer models are supported according to the readme.txt.
    Best regards
    Andreas
    Follow @LenovoForums on Twitter! Try the forum search, before first posting: Forum Search Option
    Please insert your type, model (not S/N) number and used OS in your posts.
    I´m a volunteer here using New X1 Carbon, ThinkPad Yoga, Yoga 11s, Yoga 13, T430s,T510, X220t, IdeaCentre B540.
    TIP: If your computer runs satisfactorily now, it may not be necessary to update the system.
     English Community       Deutsche Community       Comunidad en Español

  • Anybody know how to make the upgrade kit remote work with Vi

    I have a X-Fi extreme music & an upgrade kit.{ remote & receiver} The remote will allow me to select music tracks under the the entertainment center, but will not control the volume. I can push +-or - volume all day long, but it always says 00% and dosn't change in intensity. Any Ideas?

    Hi
    I take it you have used the youp-pax software? If not, then do so. Install revision 2. I did this and my remote is fully working once more.
    Must admit I am a little annoyed creative did not provide a link to youp-pax for people wanting to update their drivers. They could have said it was use at your own risk etc, but instead I had to waste two weeks fiddling with vista until I discovered it.
    /rant off

  • How to make the rating/flagging feature work with impromptu slideshow?

    I have LR 5.2 and when I review newly imported images with an impromptu slideshow to rate and flag the image in the slideshow, the relevant "flag as pick" or "set as rejected" notification shows on the screen but at the end of the slideshow only the first image is picked or rejected and the rest remain unchanged.
    I have tried the fix that adobe published for 5.0 - changing the ui.dll but that fix prevents LR5.2 from loading alltogether.
    Any suggestions please?

    FurryHerbington wrote:
    I have tried the fix that adobe published for 5.0 - changing the ui.dll but that fix prevents LR5.2 from loading alltogether.
    the ui.dll is for 5.0 only, not compatible with 5.2, and since the fix was incorporated in 5.2, ui.dll is no longer needed.
    Unfortunately, I can't help with the pick flags - they sorta work on my copy, but slideshow has been so problematic for me for so long that I just don't use it. In the tests I just did for you to check the pick flags - first test: the pick flags did not work correctly (behavior as you stated), the rest of the tests the pick flags worked properly, but something else didn't. e.g. which monitor was used changed between tests, and the manual slideshow became automatic at full speed. In all tests the color/tone are off.
    Lr's impromptu slideshow is useless for me - made worse over time, not better.
    Sorry I've not been more help, but that's all I got...
    PS - I use ShowBiz for in-Lr slideshows - has not all the bells/whistles, but at least it works, and it's full-screen (in Lr5) too, which I like.
    Cheers,
    Rob

  • How to make the ThinkVantage blue button work?

    Hello everyone! 
    My X20 tablet (model 74508HP) came with Windows Vista installed! I formatted the hard drive, deleted all partitions and installed Windows 7. But now, the ThinVantage blue button does not work!! I have already installed all the driver (I think!). Any suggestions?
    Thanks!
    Solved!
    Go to Solution.

    Hello dcloko_BR,
    I downloaded and installed Lenovo´s The Lenovo Solution Center and now the solution center starts after pressing the blue button. Perhaps give it a try.
    Edit: Upps sorry, only newer models are supported according to the readme.txt.
    Best regards
    Andreas
    Follow @LenovoForums on Twitter! Try the forum search, before first posting: Forum Search Option
    Please insert your type, model (not S/N) number and used OS in your posts.
    I´m a volunteer here using New X1 Carbon, ThinkPad Yoga, Yoga 11s, Yoga 13, T430s,T510, X220t, IdeaCentre B540.
    TIP: If your computer runs satisfactorily now, it may not be necessary to update the system.
     English Community       Deutsche Community       Comunidad en Español

  • How to make the Page UP and down work on a table control screen?

    Dear all,
    Can some one suggest how to make the table control screen work with Page Up and Page down controls.
    when I press on Page down it works for the first time and after that i need to select the table to make it work the second time. it there a way I can make the index on the screen stay on the table control at all times.
    Regard,
    Vj

    Take this code as a referance:
    Sample code for vertical scrolling in PAI processing will look like this:
    MODULE user_command_XXXX INPUT. (XXXX is screen no.)
      CASE ok_code.
        WHEN 'P--'.
          CLEAR ok_code.
          PERFORM paging USING 'P--'.
        WHEN 'P-'.
          CLEAR ok_code.
          PERFORM paging USING 'P-'.
        WHEN 'P+'.
          CLEAR ok_code.
          PERFORM paging USING 'P+'.
        WHEN 'P++'.
          CLEAR ok_code.
          PERFORM paging USING 'P++'.
    *&      Form  PAGING
    *       Form to do scrolling for screen XXXX
    *      -->CODE   OKCODE value (P--, P-, P+, P++ )
    FORM paging USING code.
      DATA: i TYPE i,
            j TYPE i.
      CASE code.
        WHEN 'P--'. <table control name>-top_line = 1.
        WHEN 'P-'.
          <table control name>-top_line =
                  <table control name>-top_line - line_count.
          IF <table control name>-top_line LE 0.
            <table control name>-top_line = 1.
          ENDIF.
        WHEN 'P+'.
          i = <table control name>-top_line + line_count.
          j = <table control name>-lines - line_count + 1.
          IF j LE 0. j = 1. ENDIF.
          IF i LE j.
            <table control name>-top_line = i.
          ELSE.
            <table control name>-top_line = j.
          ENDIF.
        WHEN 'P++'.
          <table control name>-top_line =
                 <table control name>-lines - line_count + 1.
          IF <table control name>-top_line LE 0.
            <table control name>-top_line = 1.
          ENDIF.
      ENDCASE.
    ENDFORM.                               " PAGING
    Regards,
    Ravi

  • How to make the custom field enable/disable in ME21n/ME22n/ME23n trans

    Hi Experts,
    I need help.
    I have created one custom field in the transaction ME21n/ME22n/ME23n under customer data 2 tab. But my problem is the field is always in enable (means editable only)  even in Display mode. How to make the field is non editable in display mode and editable in change mode.
    I have tried by putting some logic to make that field to change alternatively according to change/display button. And it is working fine but if we click any othe button , this field is becoming editable even in display mode.
    How to make this field to behave as standard fields?
    Please reply me <removed by moderator>
    Thank you in advance.
    Best Regards,
    Divakar.
    Edited by: Thomas Zloch on Mar 2, 2012

    If you have BADI implimented for custom tabs then you can do this in method ME_PROCESS_PO_CUST~FIELDSELECTION_ITEM
    lv_changeable = im_header->is_changeable( ).
      LOOP AT ch_fieldselection ASSIGNING <fs>
        IF lv_changeable IS INITIAL.
          <fs>-fieldstatus = '*'. " Display
        ELSE.
          <fs>-fieldstatus = '+'. " Change
        ENDIF.
    endloop.

  • I cannot figure out how to make the text larger on an incoming email.  The finger method doesn't work and I cannot find any toolbar with which to do it.  I could find nothing in settings also.  Plese help and thank you.

    I cannot figure out how to make the text larger in a received email.  The finger method doesn't work and I can find no tool bar as I can for composing emails.  I can find nothing in settings.  Please help and thank you in advance.

    Hi there,
    Download a piece of software called TinkerTool - that might just solve your problem. I have used it myself to change the system fonts on my iMac. It is software and not an app.
    Good wishes,
    John.

  • How to make the mobile application work with firewall and anti-virus ON

    Hi,
    I keep on receiving internal processing error when i try to login sap mobile solution 1.3.0 on my ipad and i was provided a solution, that is to turn off my firewall and antivirus. I works by turn off both of it but i cant possible turn of the firewall and antivirus on the server.
    Can anyone guide me how to make the mobile application work with firewall and anti-virus ON
    Thank you

    Dear Rajesh,
    Create a policy in your fire wall to allow the port to send and receive data.
    I believe the port for the mobile should be port 8080 and 8443.
    And your license server port 30000 and 30001
    nd.Q

Maybe you are looking for