Home Help Center

PermissionDeniedException

When does PermissionDeniedException is thrown in Glacier2 ?

Regards,
Naren.K

Comments

  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi,

    It's thrown by the router createSession method if the user isn't allowed to create a session with the router.

    If you use the default password file permission verifier, this can be because there's no entry for the user in the password file, the password from the file is invalid, or the given password doesn't match the one from the file.

    If you use a custom permission verifier (see section 39.5.1 of the Ice manual), it's raised if the permission verifier checkPermissions method returned false or raised an unexpected exception.

    Benoit.
  • PermissionDeniedException

    I am using Ice version - 2.1.2 ,java mapping , Windows platform.

    I have created a config file for Glacier as

    Glacier2.Client.Endpoints=default -p 11111
    Glacier2.SessionTimeout=300
    Ice.Default.Router=Glacier2/router:default -p 11111
    Glacier2.Server.Endpoints=default


    I have created a password file in the same directory as that of config file as

    test QaMad.k2p5LHw (created using openssl)


    My client program goes like this ,

    I gave --Ice.Default.Router=Glacier2/router:default -p 11111 as args for creating the communicator.

    Ice.RouterPrx defaultRouter = communicator.getDefaultRouter();
    if(defaultRouter == null)
    {
    System.err.println("no default router set");
    return ;
    }

    Glacier2.RouterPrx router = Glacier2.RouterPrxHelper.checkedCastdefaultRouter);
    if(router == null)
    {
    System.err.println("configured router is not a Glacier2 router");
    return ;
    }
    try {
    router.createSession("test","QaMad.k2p5LHw");
    } catch (CannotCreateSessionException e) {
    e.printStackTrace();
    } catch (PermissionDeniedException e) {
    e.printStackTrace();
    }

    The program throws Glacier2.PermissionDeniedException.
    am i wrong in Config.

    Regards,
    Naren.K
  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    You need to pass the uncrypted password to the createSession call, not the crypted one. Glacier2 will crypt the password and compare it with the one from the file. I would also recommend to use a secure protocol (ssl) between the client and the router.

    Benoit.
  • PermissionDeniedException

    Hi Benoit ,
    Thanks for the quick reply.It works.
    Regards,
    Naren.K
Sign In or Register to comment.