How to create user in program? I cannot do this. - Weblogic

This is a discussion on How to create user in program? I cannot do this. - Weblogic ; I am now developing user management application and platform is WebLogic 8.1(SP2). When I code like this, exception is raised... String userid = "aaa"; String password = "bbb"; weblogic.security.acl.CachingRealm realm = (weblogic.security.acl.CachingRealm) weblogic.security.acl.Security.getRealm(); weblogic.security.acl.User user; java.security.acl.Group group; user = realm.newUser(userid, ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: How to create user in program? I cannot do this.

  1. How to create user in program? I cannot do this.


    I am now developing user management application and platform is WebLogic 8.1(SP2).
    When I code like this, exception is raised...

    String userid = "aaa";
    String password = "bbb";
    weblogic.security.acl.CachingRealm realm = (weblogic.security.acl.CachingRealm)

    weblogic.security.acl.Security.getRealm();
    weblogic.security.acl.User user;
    java.security.acl.Group group;
    user = realm.newUser(userid, password, null);
    realm.getGroup(groupName).addMember(user);

    The reason may be that classes to use is depreciated.

    How to solve this problem?

    Thanks.....



  2. Re: How to create user in program? I cannot do this.

    AHN J.D wrote:

    > I am now developing user management application and platform is WebLogic 8.1(SP2).
    > When I code like this, exception is raised...
    >
    > String userid = "aaa";
    > String password = "bbb";
    > weblogic.security.acl.CachingRealm realm = (weblogic.security.acl.CachingRealm)
    >
    > weblogic.security.acl.Security.getRealm();
    > weblogic.security.acl.User user;
    > java.security.acl.Group group;
    > user = realm.newUser(userid, password, null);
    > realm.getGroup(groupName).addMember(user);
    >
    > The reason may be that classes to use is depreciated.
    >
    > How to solve this problem?


    The way to do this is to use JMX. You get hold of the appropriate MBean
    which exposes a createUser method.

    The docs have the details but to get the hang of this I recommend you
    download the excellent free utility WLShell: http://www.wlshell.com/

    With that you can "explore" the available mbeans and call methods on them.

    Robert

  3. Re: How to create user in program? I cannot do this.

    Go look at the api's for com.bea.p13n.usermgmt EJB much easier to use.

    Robert Greig wrote:
    > AHN J.D wrote:
    >
    >> I am now developing user management application and platform is
    >> WebLogic 8.1(SP2).
    >> When I code like this, exception is raised...
    >>
    >> String userid = "aaa";
    >> String password = "bbb";
    >> weblogic.security.acl.CachingRealm realm =
    >> (weblogic.security.acl.CachingRealm)
    >>
    >>
    >> weblogic.security.acl.Security.getRealm();
    >> weblogic.security.acl.User user;
    >> java.security.acl.Group group;
    >> user = realm.newUser(userid, password, null);
    >> realm.getGroup(groupName).addMember(user);
    >>
    >> The reason may be that classes to use is depreciated.
    >>
    >> How to solve this problem?

    >
    >
    > The way to do this is to use JMX. You get hold of the appropriate MBean
    > which exposes a createUser method.
    >
    > The docs have the details but to get the hang of this I recommend you
    > download the excellent free utility WLShell: http://www.wlshell.com/
    >
    > With that you can "explore" the available mbeans and call methods on them.
    >
    > Robert


  4. Re: How to create user in program? I cannot do this.


    Jay Zimmett wrote:
    >Go look at the api's for com.bea.p13n.usermgmt EJB much easier to use.


    But not in WLS 8.1 - they are in the portal server.

    Robert

+ Reply to Thread