Weblogic security realm mapping to DB

I have one question about Weblogic 7.01 security.
I have created USER, GROUP and ROLES table in my RDBMS.
Can I use the RDBMS realm if my users are in a database
table already? Can I tune Weblogic security realm to my database tables?
Any advice or links will be very appreciate.
Thanks a lot for any help, Volodymyr Shram.

Thanks, criokeeper for your fast answer.
Woould you so kind to explain me one moment.
At http://e-docs.bea.com/wls/docs70/ConsoleHelp/domain_rdbmsrealm_config_general.html I found that "To use the RDBMS security realm, you need to use Compatibility security. The use of the RDBMS security realm is deprecated in WebLogic Server 7.0."
What does that means? Have I use the Compatibility security or it's jaust for ver. 6.x to ver.7.0 migration?
Thanks a lot for your answer.
Regards, Volodymyr.

Similar Messages

  • How to create default groups in Weblogic- Security Realms -- Groups

    Hi Team,
    Unfortunately I have deleted some default groups from Weblogic->Security Realms --> Groups. How to add the groups.
    Regards,
    Ravi.

    Hi Ravi,
    These are the defaults groups present inside Security Realms ,you can manually create them by
    Going inside Security Realms-->Users and Groups-->Groups-->New
    Administrators----Administrators can view and modify all resource attributes and start and stop servers-----------------------DefaultAuthenticator
    Deployers---------Deployers can view all resource attributes and deploy applications.---------------------------------------------DefaultAuthenticator
    Monitors-----------Monitors can view and modify all resource attributes and perform operations not restricted by roles.------DefaultAuthenticator
    Operators---------Operators can view and modify all resource attributes and perform server lifecycle operations.-------------DefaultAuthenticator
    Restart the Admin Server
    Regards
    FAbian

  • OWSM security for a OSB service- authenticate from weblogic security realms

    Hello,
    I have a requirement to add security to a OSB service.
    The user details are configured in weblogic security realms. lets say there are ten different users.
    I need to protect my osb service using OWSM policy & the policy should be configured to authenticate the user from realms.
    I am new to OWSM & wondering if this is possible?
    Can the experts please direct me to any docs or steps?
    Thanks
    Ganesh

    Hi,
    Thanks for the links.
    I followed the blog and configured it using oracle/wss_username_token_service_policy.
    Now my requirement is to send the username,password from proxy to business and to the BPEL. (the bpel needs this username /password & and in header)
    The issue I am facing is the proxy service is not sending the soap header details to business service.
    I dont want to make the proxy as passthrough. (ie set Process WS-Security Header to NO)
    I have to authorize on proxy level and then send the same credential details to business service?
    So the question is, how can I retrieve the header after osb process it?
    Can anyone please help me here?
    Thanks
    Ganesh

  • Authentication via weblogic security realm

              My servlet needs to access a session bean. The action in the session bean requires
              that a user has been authorized, i.e. at some point the session been calls
              String name = d_ctx.getCallerPrincipal().getName()
              This name may not be null at this time.
              What I would like to have is that the user executing the URL gets authenticated
              by my server realm 'myrealm' and that the associated prinicpal gets passed to
              the session bean. Is this possible. If so, how can the user pass along the username
              and password as this query is executed programmatically?
              markus
              

    http://www.weblogic.com/docs51/classdocs/API_acl.html
    Michael Girdley
    BEA Systems Inc
    "gennot" <[email protected]> wrote in message
    news:[email protected]..
    Could you send me the complete URL of these example, please?
    Thanks
    Enrico
    Michael Girdley <[email protected]> wrote in message
    39b87078$[email protected]..
    The passing of the client's certificate should be automatic to WebLogic.We
    have an example of getting the client side certificate from inside of
    WebLogic in our documentation.
    This does not require for SSL to be used from the Web server to
    WebLogic.
    >>
    Thanks,
    Michael
    Michael Girdley
    BEA Systems Inc
    "Bob Simonoff" <[email protected]> wrote in message
    news:[email protected]..
    I have read through the docs and haven't found anything that would
    address
    the following confusion:
    Suppose I want to use Apache or IPlanet as the webserver with WebLogicas
    the back end application server (obviously). I have the need to use 2way
    SSL authentication. As I understand it the following applies:
    Client (browser) has a certificate as does the web server. Theyauthenticate
    each other.
    Now, the web server and weblogic need to communicate. WebLogic, in our
    environment does authentication via the security realm.
    What do I have to do to get the the web server (Apache or IPlanet) to
    communicate the client's certificate to WebLogic so the WebLogic canperform
    the authentication?
    Does the communication between the web server and WebLogic also need
    to
    be
    SSL?
    Thanks
    Bob Simonoff

  • How to list all users present in Default Autheticator  in WebLogic Security Realm

    Hi All,
    I need to get a list of all the users in my Weblogic server--> security realm--> Default Authenticator
    There are more than 1000 users present in my security realm for different different Authentication Providers. So I can not get these details from WebLogic Admin Console.
    Can anyone please help me in getting this list of all users in Default Authenticator? Please let me know how can I get these details.
    My WebLogic version is 10.3.4.0
    Thanks in Advance!

    You can use JMX to list users
    http://weblogic-wonders.com/weblogic/2010/11/10/list-users-and-groups-in-weblogic-using-jmx/

  • Unix Security Realm

    I am trying to configure Weblogic 5.1.0, SP8, to use the Unix security Realm. I have
    followed the installation and configuration directions, but when I try to test by
    bringing up the AdminRealm servlet, it asks me for a userid & password 3 times (which
    isn't mentioned in the directions), then gives me this error: "Supplied credentials
    don't grant adequate privileges". I've tried signing on with several different accounts,
    all the way up to 'root', all with the same results. What is it after and why isn't
    even 'root' good enough? I've looked at the debug tracings from setting weblogic.security.realm.debug=true,
    but everything seems to hit 'POS' except that it doesn't find the weblogic.url file
    (whatever that is).
    TIA for any assistance.
    Don

    More information...
    If I give access to 'everyone' for the admin servlets, all of them works perfectly except AdminRealm that will
    throw an exception:
    "weblogic.security.unixrealm.SubprocessException: request failed:
    at weblogic.security.unixrealm.UnixDelegate$Chat.require(UnixDelegate.java:167)
    at weblogic.security.unixrealm.UnixRealm.getUsers(UnixRealm.java:229)......."
    And if I do as Don (follow the installation guide) I have the same problem.
    But still, I can set permissions on the helloWorld example and it works fine!
    BR,
    Sven
    Sven-Åke Larsson wrote:
    I have the same problem.
    There's no problem running for example the helloworld servlet, but if I set a specific user to have permissions
    on the admin servlets WLS says during startup that "Principal 'blablabla' does not exist in properties file".
    Of course not, I'm using the Unix realm...
    --Sven
    Don Adams wrote:
    I am trying to configure Weblogic 5.1.0, SP8, to use the Unix security Realm. I have
    followed the installation and configuration directions, but when I try to test by
    bringing up the AdminRealm servlet, it asks me for a userid & password 3 times (which
    isn't mentioned in the directions), then gives me this error: "Supplied credentials
    don't grant adequate privileges". I've tried signing on with several different accounts,
    all the way up to 'root', all with the same results. What is it after and why isn't
    even 'root' good enough? I've looked at the debug tracings from setting weblogic.security.realm.debug=true,
    but everything seems to hit 'POS' except that it doesn't find the weblogic.url file
    (whatever that is).
    TIA for any assistance.
    Don

  • Weblogic security authentication; question to interact with the realm

    Hi, I have a quick question about weblogic security authentication....
    We are using weblogic 81sp3. We have user-group info in an Novell eDirectory LDAP server.
    Currently, a Novell Authenticator provider is configured under : Security > Realms > myRealm > Providers > Authentication This tells Weblogic from where to get the user and groups. Weblogic caches this information of the logged on users for certain time ( example : 60 secs ) after which it cleans the cache for all inactive users. We want to interact with the Weblogic cache. Add more user profile information to this cache and use it in our application .
    Does somebody know how to programmatically interact with Weblogic user-group cache - read , write , update and delete user-group info in cache and control time to live for the cache ?

    already checked
    TTLCache class which weblogic provides. But they seem to depracetd it
    help ?

  • Unable to use a custom security realm with Netscape Directory Server in WebLogic 7

    I have all users and groups stored in a Netscape LDAP server (version 4.1.6 on
    Solaris 8), so I want to create a custom security realm in WebLogic 7 (also run
    on Solaris 8) which uses my LDAP server as the Authenticator. I tried this by
    using the Admin Console and followed exactly the steps in Chapter 3 of the "Managing
    WebLogic Security" doc. However, when I rebooted WebLogic and logged into the
    Admin Console again and clicked the Users node under my custom realm, I saw this
    message in the right-hand pane: "There are no Authentication providers available
    that support the creation of Users". Also, I don't see my custom realm in the
    dropdown list under mydomain -> Security tab -> General tab -> Default Realm.
    What did I do wrong? Also, where does WebLogic store the custom security realm
    info? It is definitely not in config.xml.
    Thanks,
    Eric Ma

    Thanks for the info.
    I wonder when they will fix it.
    Jakub
    U¿ytkownik "Eric Ma" <[email protected]> napisa³ w wiadomo¶ci
    news:[email protected]..
    >
    According to BEA Tech Support, a known bug prevents the WLS 7 AdminConsole from
    displying users and groups defined in Netscape Directory Server.
    Eric Ma
    "Jakub Wroniszewski" <[email protected]> wrote:
    I have the same problem.
    Any new ideas?
    Rgds,
    Jakub
    U¿ytkownik "Eric Ma" <[email protected]> napisa³ w wiadomo¶ci
    news:[email protected]..
    Now I doubt my custom security realm is actually using the NetscapeDirectory Server
    as the authenticator. Unlike in WebLogic 6.1 Admin Console, whereclicking on
    the Users node displays all users in the LDAP server, in WebLogic 7I keep
    getting
    the message "There are no Authentication providers available that
    support
    the
    creation of Users." Any suggestions?
    "Eric Ma" <[email protected]> wrote:
    Never mind. I tried again by following the steps outlined at
    http://newsgroups.bea.com/cgi-bin/dnewsweb?cmd=article&group=weblogic.deve
    l
    oper.interest.security&item=8463&utag=
    and it seemed to have worked for me.
    "Eric Ma" <[email protected]> wrote:
    I have all users and groups stored in a Netscape LDAP server (version
    4.1.6 on
    Solaris 8), so I want to create a custom security realm in WebLogic7
    (also run
    on Solaris 8) which uses my LDAP server as the Authenticator. I
    tried
    this by
    using the Admin Console and followed exactly the steps in Chapter3
    of
    the "Managing
    WebLogic Security" doc. However, when I rebooted WebLogic and logged
    into the
    Admin Console again and clicked the Users node under my custom realm,
    I saw this
    message in the right-hand pane: "There are no Authentication
    providers
    available
    that support the creation of Users". Also, I don't see my customrealm
    in the
    dropdown list under mydomain -> Security tab -> General tab ->
    Default
    Realm.
    What did I do wrong? Also, where does WebLogic store the customsecurity
    realm
    info? It is definitely not in config.xml.
    Thanks,
    Eric Ma

  • BEA WebLogic 8.1 server not booting after adding a security realm

    Hi,
    I have added my own security realm for BEA WebLogic Server 8.1.
    However, when I try to boot the server using this realm, it simply hangs. I cannot
    take thread dumps as the server java process does not respond to "kill -3 PID"
    (after the server has hung).
    When I looked at the server log file, I observed that the server had hung after
    initializing the IIOP subsystem.
    I have attached herewith the following 3 files:
    1. config.xml (the server config file after adding entry for my security realm)
    2. default_realm.log (the server log file when booted through the default realm)
    3. netpoint_realm.log (the server log file when booted through my realm).
    Is there any way, I can debug where the server is exactly hanging?
    Thanks and Regards,
    Abhinay
    [BEA_Files.zip]

    is it admin server or Managed server which isnot starting?
    Mir

  • Security realm, WebLogic Portal 7.0 and Windows NT 4.0

    Hello!
    My name is Miriam Serrano i and I write to request aid.
    I am working with WebLogic Portal version 7.0 and I need to make a Security realm
    with
    Windows NT 4.0 server.
    In the console of weblogic if I see the NT users ,
    but when I want to make enter the application of stockportal
    single access with administrators and not with the other users
    of the Portal groups, as I can enter with NT groups?
    as I can make the security realm with Portal(users and groups)
    and windows NT 4.0? exists a document?
    it already makes the procedures of Security Realm with Windows NT?
    but as I bind with Weblogic Portal to it?
    Can I help me?
    thanks

    Hello!
    My name is Miriam Serrano i and I write to request aid.
    I am working with WebLogic Portal version 7.0 and I need to make a Security realm
    with
    Windows NT 4.0 server.
    In the console of weblogic if I see the NT users ,
    but when I want to make enter the application of stockportal
    single access with administrators and not with the other users
    of the Portal groups, as I can enter with NT groups?
    as I can make the security realm with Portal(users and groups)
    and windows NT 4.0? exists a document?
    it already makes the procedures of Security Realm with Windows NT?
    but as I bind with Weblogic Portal to it?
    Can I help me?
    thanks

  • Weblogic.security.acl.realm.authentication... Exception

    Hello All
    the reason I'm moving a post-question from JMS to this section is people there
    suggested this. anyway,
    when I tried to use an applet which implemented MessageListener to send message,
    I got the following exception ( the port 7001 had been granted to connect, resolve
    in java.policy)
    javax.naming.AuthenticationException [root exception is java.lang.SecurityException:Authentication
    for user admin denied in realm webogic start server side trace: java.lang.SecurityException:Authentication
    for user admin denied in realm weblogic at weblogic.security.acl.Realm.authentication(Realm.java
    212) at weblogic.security.acl.Realm.getAuthenticatedName(Realm.java 233) at weblogic.security.acl.internal.Security.authenticate(Security.java
    135) at weblogic.kernel.bootSevicesImp.authenticat(BootServicesImp.java 119) at
    weblogic.kernel.ExecuteThread.run(ExcuteThread.java:120 ..
    My Question is why servlet or swing or other application out of applet don't generate
    such exceptions even most codes are similar ? How to deal with this?
    Thanks
    John
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Hello All
    the reason I'm moving a post-question from JMS to this section is people there
    suggested this. anyway,
    when I tried to use an applet which implemented MessageListener to send message,
    I got the following exception ( the port 7001 had been granted to connect, resolve
    in java.policy)
    javax.naming.AuthenticationException [root exception is java.lang.SecurityException:Authentication
    for user admin denied in realm webogic start server side trace: java.lang.SecurityException:Authentication
    for user admin denied in realm weblogic at weblogic.security.acl.Realm.authentication(Realm.java
    212) at weblogic.security.acl.Realm.getAuthenticatedName(Realm.java 233) at weblogic.security.acl.internal.Security.authenticate(Security.java
    135) at weblogic.kernel.bootSevicesImp.authenticat(BootServicesImp.java 119) at
    weblogic.kernel.ExecuteThread.run(ExcuteThread.java:120 ..
    My Question is why servlet or swing or other application out of applet don't generate
    such exceptions even most codes are similar ? How to deal with this?
    Thanks
    John
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Weblogic ldap security realm source code..

    Hi,
    The LDAPv2 security realm that is provided with weblogic 6.1 is great but I
    need to make several extensions to allow for the way our ldap tree is
    structured. Is there any chance that I can get the source code from weblogic
    so that I can extend it ?
    thx,
    B

    What's the use of following if BEA start sending the code to the end users
    * @author Copyright (c) 1998 by WebLogic, Inc. All Rights Reserved.
    * @author Copyright (c) 1998-2001 by BEA Systems, Inc. All Rights Reserved.
    -utpal
    "Bidisha Das" <[email protected]> wrote in message
    news:[email protected]..
    Hi,
    The LDAPv2 security realm that is provided with weblogic 6.1 is great butI
    need to make several extensions to allow for the way our ldap tree is
    structured. Is there any chance that I can get the source code fromweblogic
    so that I can extend it ?
    thx,
    B

  • Conf. a Win2K Security Realm on WebLogic

         Hi! I'm having some problems configuring a security realm in WebLogic
    server 6.0sp1.
         I'd like that WebLogic use the Windows2000 security realm as the
    default security (it can be used as the secondary security realm
    if it's the only way).     
    We've been trying to make it work for the last two (business) days
    with no hope of being successfull at all.
         We are using the BEA documentation 'Managing Security' as reference,
    and we have some doubts about what's in there.
    First doubt:     The documentation says that we need to create new
    security realm of the type Windows NT. OK, we did it. But we are
    not sure about how to fill the filed Primary Domain. The documentation
    says to put the host and port of the computer where User and Groups
    are defined for the NT domain. I'm using the same computer for
    both (NT domain and Web Logic), so I put the host name (babalu).
    Wich port should I put?
    Second doubt:     The documentation says to create a systerm user on
    the NT domain using NT administrative tools, names it 'system'
    and set some stuff for it. But windows 2000 already has a user
    with that name (SYSTE, but capitalized) and the property that I
    should set on it doesn't exist! By the way, on the system user
    user that windows2000 has I wasn't able to set any property.
    Last doubt (maybe should be the first one) : Does WebLogic 6.0sp1
    support Security Realms from Windows 2000? Or I need to download
    another plugin or somethign like that?
         Thanks for Reading and (hope) Answering my qusetions!
    Roberto Giordano Barra

    Hi! Thanks for the answer. I'll try to run WebLogic as a service.
    In fact, I tried it before but I wasn't able to. I started the
    service by hand, but I wasn't able to access the server. So, I
    click on the 'remove web logic as service'(something like that)
    in the WebLogic program group. Ok, it was removed. But when I tried
    to put it back I didn't find no funny button to help me! Could
    you help me with that?
    Another thing. If I use NT Realm as a Caching Realm I'll be
    able to see the NT user and users groups with the Web Logic management
    GUI ?
    Thanks once again,
    Roberto Giordano Barra
    "arthur" <[email protected]> wrote:
    >
    Hi,
    By saying win2k I am assuming you mean creating an NT
    realm.
    Do not bother specifying a port, just put the server name.
    You have to ensure that you are running the weblogic server
    as
    a NT service if you want to use the NTrealm.
    Make sure under Caching Realm you specify the NTrealm.
    That should be it.
    Hope this helps.
    Regards,
    -Arthur
    "Roberto Giordano Barra" <[email protected]> wrote:
         Hi! I'm having some problems configuring a security
    realm in WebLogic
    server 6.0sp1.
         I'd like that WebLogic use the Windows2000 securityrealm
    as the
    default security (it can be used as the secondary security
    realm
    if it's the only way).     
    We've been trying to make it work for the last two (business)
    days
    with no hope of being successfull at all.
         We are using the BEA documentation 'Managing Security'
    as reference,
    and we have some doubts about what's in there.
    First doubt:     The documentation says that we need to create
    new
    security realm of the type Windows NT. OK, we did it.
    But we are
    not sure about how to fill the filed Primary Domain.The
    documentation
    says to put the host and port of the computer where User
    and Groups
    are defined for the NT domain. I'm using the same computer
    for
    both (NT domain and Web Logic), so I put the host name
    (babalu).
    Wich port should I put?
    Second doubt:     The documentation says to create a systerm
    user on
    the NT domain using NT administrative tools, names it
    'system'
    and set some stuff for it. But windows 2000 already has
    a user
    with that name (SYSTE, but capitalized) and the property
    that I
    should set on it doesn't exist! By the way, on the system
    user
    user that windows2000 has I wasn't able to set any property.
    Last doubt (maybe should be the first one) : Does WebLogic
    6.0sp1
    support Security Realms from Windows 2000? Or I needto
    download
    another plugin or somethign like that?
         Thanks for Reading and (hope) Answering my qusetions!
    Roberto Giordano Barra

  • Security realm - Security:097533 - Developing own authentication provider

    hi everyone,
    i Developing own authentication provider and i installed a security patch, so while i restarting the weblogic server  encountered the below Exeption:
    <10/05/2013 05:54:33 PM COT> <Error> <Security> <BEA-090870> <The realm "myrealm" failed to be loaded: weblogic.security.service.SecurityServiceException: com.bea.common.engine.ServiceInitializationException: com.bea.common.engine.SecurityServiceRuntimeException: [Security:097533]SecurityProvider service class name for AS400Realm is not specified..
    weblogic.security.service.SecurityServiceException: com.bea.common.engine.ServiceInitializationException: com.bea.common.engine.SecurityServiceRuntimeException: [Security:097533]SecurityProvider service class name for AS400Realm is not specified.
    at weblogic.security.service.CSSWLSDelegateImpl.initializeServiceEngine(CSSWLSDelegateImpl.java:341)
    at weblogic.security.service.CSSWLSDelegateImpl.initialize(CSSWLSDelegateImpl.java:220)
    at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.InitializeServiceEngine(CommonSecurityServiceManagerDelegateImpl.java:1789)
    at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initializeRealm(CommonSecurityServiceManagerDelegateImpl.java:443)
    at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.loadRealm(CommonSecurityServiceManagerDelegateImpl.java:841)
    Truncated. see log file for complete stacktrace
    Caused By: com.bea.common.engine.ServiceInitializationException: com.bea.common.engine.SecurityServiceRuntimeException: [Security:097533]SecurityProvider service class name for AS400Realm is not specified.
    at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:365)
    at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:315)
    at com.bea.common.engine.internal.ServiceEngineImpl.lookupService(ServiceEngineImpl.java:257)
    at com.bea.common.engine.internal.ServicesImpl.getService(ServicesImpl.java:72)
    at weblogic.security.service.internal.WLSIdentityServiceImpl.initialize(WLSIdentityServiceImpl.java:46)
    Truncated. see log file for complete stacktrace
    Caused By: com.bea.common.engine.SecurityServiceRuntimeException: [Security:097533]SecurityProvider service class name for AS400Realm is not specified.
    at com.bea.common.security.internal.legacy.service.SecurityProviderImpl.init(SecurityProviderImpl.java:42)
    at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:363)
    at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:315)
    at com.bea.common.engine.internal.ServiceEngineImpl.lookupService(ServiceEngineImpl.java:257)
    at com.bea.common.engine.internal.ServicesImpl.getService(ServicesImpl.java:72)
    Truncated. see log file for complete stacktrace
    this is the config.xml :
    <domain xmlns="http://xmlns.oracle.com/weblogic/domain" xmlns:sec="http://xmlns.oracle.com/weblogic/security" xmlns:wls="http://xmlns.oracle.com/weblogic/security/wls" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/security/xacml http://xmlns.oracle.com/weblogic/security/xacml/1.0/xacml.xsd http://xmlns.oracle.com/weblogic/security/providers/passwordvalidator http://xmlns.oracle.com/weblogic/security/providers/passwordvalidator/1.0/passwordvalidator.xsd http://xmlns.oracle.com/weblogic/domain http://xmlns.oracle.com/weblogic/1.0/domain.xsd http://xmlns.oracle.com/weblogic/security http://xmlns.oracle.com/weblogic/1.0/security.xsd http://xmlns.oracle.com/weblogic/security/wls http://xmlns.oracle.com/weblogic/security/wls/1.0/wls.xsd http://xmlns.oracle.com/weblogic/security/extension http://xmlns.oracle.com/weblogic/1.0/security.xsd">
    <name>base_domain</name>
    <domain-version>12.1.1.0</domain-version>
    <security-configuration>
    <name>base_domain</name>
    <realm>
    <sec:authentication-provider xsi:type="wls:default-authenticatorType"></sec:authentication-provider>
    <sec:authentication-provider xsi:type="wls:default-identity-asserterType">
    <sec:active-type>AuthenticatedUser</sec:active-type>
    </sec:authentication-provider>
    <sec:authentication-provider xmlns:ext="http://xmlns.oracle.com/weblogic/security/extension" xsi:type="ext:as400-realmType">
    <sec:name>AS400Realm</sec:name>
    <sec:control-flag>OPTIONAL</sec:control-flag>
    </sec:authentication-provider>
    <sec:role-mapper xmlns:xac="http://xmlns.oracle.com/weblogic/security/xacml" xsi:type="xac:xacml-role-mapperType"></sec:role-mapper>
    <sec:authorizer xmlns:xac="http://xmlns.oracle.com/weblogic/security/xacml" xsi:type="xac:xacml-authorizerType"></sec:authorizer>
    <sec:adjudicator xsi:type="wls:default-adjudicatorType"></sec:adjudicator>
    <sec:credential-mapper xsi:type="wls:default-credential-mapperType"></sec:credential-mapper>
    <sec:cert-path-provider xsi:type="wls:web-logic-cert-path-providerType"></sec:cert-path-provider>
    <sec:cert-path-builder>WebLogicCertPathProvider</sec:cert-path-builder>
    <sec:user-lockout-manager>
    <sec:lockout-enabled>false</sec:lockout-enabled>
    </sec:user-lockout-manager>
    <sec:deploy-role-ignored>false</sec:deploy-role-ignored>
    <sec:deploy-policy-ignored>false</sec:deploy-policy-ignored>
    <sec:security-dd-model>DDOnly</sec:security-dd-model>
    <sec:name>myrealm</sec:name>
    <sec:password-validator xmlns:pas="http://xmlns.oracle.com/weblogic/security/providers/passwordvalidator" xsi:type="pas:system-password-validatorType">
    <sec:name>SystemPasswordValidator</sec:name>
    <pas:min-password-length>8</pas:min-password-length>
    <pas:min-numeric-or-special-characters>1</pas:min-numeric-or-special-characters>
    </sec:password-validator>
    </realm>
    <default-realm>myrealm</default-realm>
    <credential-encrypted>{AES}kyVB/9J9Fbvp11tAnYgn6grV6wQwNZZGHSh2JLQtesxS46Re+QCfIAttNE5JugllQvUHOhE+pz0AnEfYL2p5q2oeRsjqoQz2/1Lg8x+3WMoKic0xnRzw2RWoFjQo3F9x</credential-encrypted>
    <node-manager-username>weblogic</node-manager-username>
    <node-manager-password-encrypted>{AES}4jkSbv5dMOl6cRpRa4QwB83XVavtq168cV4L+NSFDcI=</node-manager-password-encrypted>
    <cross-domain-security-enabled>true</cross-domain-security-enabled>
    </security-configuration>
    <server>
    <name>AdminServer</name>
    <listen-address>localhost</listen-address>
    <staging-mode>nostage</staging-mode>
    </server>
    <embedded-ldap>
    <name>base_domain</name>
    <credential-encrypted>{AES}9YeG1UFRNQzM0v6/j8cFvT9x9fkJUl1FJOWGInl5dax26FgMNEVwKNxOBHvW2opm</credential-encrypted>
    </embedded-ldap>
    <configuration-version>12.1.1.0</configuration-version>
    this is the mbean xml (A400Realmmbean.xml):
    <?xml version="1.0" ?>
    <!DOCTYPE MBeanType SYSTEM "commo.dtd">
    <MBeanType Name = "AS400Realm" DisplayName = "AS400Realm"
    Package = "co.com.claro.security"
    Extends = "weblogic.management.security.authentication.Authenticator"
    PersistPolicy = "OnUpdate"
    >
    <MbeanAttribute Name = "ProviderClassName" Type = "java.lang.String"
    Writeable = "false"
    Default =
    "&quot;co.com.claro.AS400Realm&quot;"
    />
    <MBeanAttribute Name = "Description" Type = "java.lang.String"
    Writeable = "false" Default = "&quot;My Identity Assertion Provider&quot;"
    />
    <MBeanAttribute Name = "Version" Type = "java.lang.String"
    Writeable = "false" Default = "&quot;1.0&quot;"
    />
    </MBeanType>
    and the runtime class:
    AS400Realm.java:
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package co.com.claro.security;
    import java.util.HashMap;
    import javax.security.auth.login.AppConfigurationEntry;
    import javax.security.auth.login.AppConfigurationEntry.LoginModuleControlFlag;
    import weblogic.management.security.ProviderMBean;
    import weblogic.security.provider.PrincipalValidatorImpl;
    import weblogic.security.spi.AuthenticationProviderV2;
    import weblogic.security.spi.IdentityAsserterV2;
    import weblogic.security.spi.PrincipalValidator;
    import weblogic.security.spi.SecurityServices;
    import weblogic.security.principal.WLSGroupImpl;
    import weblogic.security.principal.WLSUserImpl;
    public final class AS400Realm implements AuthenticationProviderV2
    private String description;
    // private SimpleSampleAuthenticatorDatabase database;
    private LoginModuleControlFlag controlFlag;
    // public String PARAM_JAAS_CONTEXT = "jaas-context";
    // public String PARAM_DATASOURCE_NAME = "jdbc/Oracle";
    // public String DEFAULT_GROUP_NAME = "default";
    public void initialize(ProviderMBean mbean, SecurityServices services)
    System.out.println("AS400Realm.initialize");
    AS400RealmMBean myMBean = (AS400RealmMBean)mbean;
    description = myMBean.getDescription() + "\n" + myMBean.getVersion();
    // database = new SimpleSampleAuthenticatorDatabase(myMBean);
    String flag = myMBean.getControlFlag();
    if (flag.equalsIgnoreCase("REQUIRED")) {
    controlFlag = LoginModuleControlFlag.REQUIRED;
    } else if (flag.equalsIgnoreCase("OPTIONAL")) {
    controlFlag = LoginModuleControlFlag.OPTIONAL;
    } else if (flag.equalsIgnoreCase("REQUISITE")) {
    controlFlag = LoginModuleControlFlag.REQUISITE;
    } else if (flag.equalsIgnoreCase("SUFFICIENT")) {
    controlFlag = LoginModuleControlFlag.SUFFICIENT;
    } else {
    throw new IllegalArgumentException("invalid flag value" + flag);
    public String getDescription()
    return description;
    public void shutdown()
    System.out.println("AS400Realm.shutdown");
    private AppConfigurationEntry getConfiguration(HashMap options)
    options.put("PARAM_DATASOURCE_NAME", "jdbc/Oracle");
    return new
    AppConfigurationEntry(
    "co.com.claro.security.AS400LoginModule",
    controlFlag,
    options
    public AppConfigurationEntry getLoginModuleConfiguration()
    HashMap options = new HashMap();
    return getConfiguration(options);
    public AppConfigurationEntry getAssertionModuleConfiguration()
    HashMap options = new HashMap();
    options.put("IdentityAssertion","true");
    return getConfiguration(options);
    public PrincipalValidator getPrincipalValidator()
    return new PrincipalValidatorImpl();
    public IdentityAsserterV2 getIdentityAsserter()
    return null;
    AS400LoginModule.java :
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package co.com.claro.security;
    import com.ibm.as400.access.AS400;
    import java.io.IOException;
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.util.Enumeration;
    import java.util.Map;
    import java.util.Vector;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import javax.security.auth.Subject;
    import javax.security.auth.callback.Callback;
    import javax.security.auth.callback.CallbackHandler;
    import javax.security.auth.callback.NameCallback;
    import javax.security.auth.callback.PasswordCallback;
    import javax.security.auth.callback.UnsupportedCallbackException;
    import javax.security.auth.login.LoginException;
    import javax.security.auth.login.FailedLoginException;
    import javax.security.auth.spi.LoginModule;
    import javax.sql.DataSource;
    import weblogic.security.spi.WLSGroup;
    import weblogic.security.spi.WLSUser;
    import weblogic.security.principal.WLSGroupImpl;
    import weblogic.security.principal.WLSUserImpl;
    * @author dmunoz
    final public class AS400LoginModule implements LoginModule {
    private Subject subject;
    private CallbackHandler callbackHandler;
    private String PARAM_DATASOURCE_NAME = "jdbc/Oracle";
    private String DEFAULT_GROUP_NAME = "default";
    // Determine whether this is a login or assert identity
    private boolean isIdentityAssertion;
    // Authentication status
    private boolean loginSucceeded;
    private boolean principalsInSubject;
    private Vector principalsForSubject = new Vector();
    public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options) {
    // only called (once!) after the constructor and before login
    System.out.println("SimpleSampleLoginModuleImpl.initialize");
    this.subject = subject;
    this.callbackHandler = callbackHandler;
    // Check for Identity Assertion option
    isIdentityAssertion =
    "true".equalsIgnoreCase((String) options.get("IdentityAssertion"));
    private boolean authenticateAS400(String user, String passwd) throws Exception {
    String host ="172.31.2.80";//Config.getProperty(Config.AS400_AUTHENTICATION_HOST);
    AS400 as400System;
    as400System = new AS400(host, user, passwd);
    return as400System.validateSignon();
    public boolean login() throws LoginException {
    // only called (once!) after initialize
    System.out.println("SimpleSampleLoginModuleImpl.login");
    // loginSucceeded should be false
    // principalsInSubject should be false
    Callback[] callbacks = getCallbacks();
    String userName = getUserName(callbacks);
    if (userName.length() > 0) {       
    if (!isIdentityAssertion) {               
    String passwordHave = getPasswordHave(userName, callbacks);
    try{
    loginSucceeded = authenticateAS400(userName, passwordHave);
    }catch(Exception e){
    Logger.getLogger(AS400LoginModule.class.getName()).log(Level.WARNING, null, e);
    throw new LoginException(e.getMessage());
    } else {
    // anonymous login - let it through?
    System.out.println("\tempty userName");
    if (loginSucceeded) {
    principalsForSubject.add(new WLSUserImpl(userName));
    addGroupsForSubject(userName);
    return loginSucceeded;
    public boolean commit() throws LoginException {
    // only called (once!) after login
    // loginSucceeded should be true or false
    // principalsInSubject should be false
    // user should be null if !loginSucceeded, null or not-null otherwise
    // group should be null if user == null, null or not-null otherwise
    System.out.println("SimpleSampleLoginModule.commit");
    if (loginSucceeded) {
    subject.getPrincipals().addAll(principalsForSubject);
    principalsInSubject = true;
    return true;
    } else {
    return false;
    public boolean abort() throws LoginException {
    // The abort method is called to abort the authentication process. This is
    // phase 2 of authentication when phase 1 fails. It is called if the
    // LoginContext's overall authentication failed.
    // loginSucceeded should be true or false
    // user should be null if !loginSucceeded, otherwise null or not-null
    // group should be null if user == null, otherwise null or not-null
    // principalsInSubject should be false if user is null, otherwise true
    // or false
    System.out.println("SimpleSampleLoginModule.abort");
    if (principalsInSubject) {
    subject.getPrincipals().removeAll(principalsForSubject);
    principalsInSubject = false;
    return true;
    public boolean logout() throws LoginException {
    // should never be called
    System.out.println("SimpleSampleLoginModule.logout");
    return true;
    private void throwLoginException(String msg) throws LoginException {
    System.out.println("Throwing LoginException(" + msg + ")");
    throw new LoginException(msg);
    private void throwFailedLoginException(String msg) throws FailedLoginException {
    System.out.println("Throwing FailedLoginException(" + msg + ")");
    throw new FailedLoginException(msg);
    private Callback[] getCallbacks() throws LoginException {
    if (callbackHandler == null) {
    throwLoginException("No CallbackHandler Specified");
    Callback[] callbacks;
    if (isIdentityAssertion) {
    callbacks = new Callback[1];
    } else {
    callbacks = new Callback[2];
    callbacks[1] = new PasswordCallback("password: ", false);
    callbacks[0] = new NameCallback("username: ");
    try {
    callbackHandler.handle(callbacks);
    } catch (IOException e) {
    throw new LoginException(e.toString());
    } catch (UnsupportedCallbackException e) {
    throwLoginException(e.toString() + " " + e.getCallback().toString());
    return callbacks;
    private String getUserName(Callback[] callbacks) throws LoginException {
    String userName = ((NameCallback) callbacks[0]).getName();
    if (userName == null) {
    throwLoginException("Username not supplied.");
    System.out.println("\tuserName\t= " + userName);
    return userName;
    private void addGroupsForSubject(String userName) {
    try {
    for (Enumeration e = getGroupNamesAS400(userName);
    e.hasMoreElements();) {
    String groupName = (String) e.nextElement();
    System.out.println("\tgroupName\t= " + groupName);
    principalsForSubject.add(new WLSGroupImpl(groupName));
    } catch (Exception ex) {
    Logger.getLogger(AS400LoginModule.class.getName()).log(Level.SEVERE, null, ex);
    public Enumeration getGroupNamesAS400(String usuario)
    throws Exception {
    if(usuario == null) {
    throw new Exception("Usuario no puede ser vacio");
    Vector<String> grupos = new Vector<String>();
    grupos.add(DEFAULT_GROUP_NAME);
    Connection conn = null;
    ResultSet rs = null;
    PreparedStatement statement = null;
    try {
    Context c = new InitialContext();
    DataSource dst = (DataSource) c.lookup(PARAM_DATASOURCE_NAME);
    conn = dst.getConnection();
    String query = "SELECT COD_ROL AS ROL " +
    "FROM gestionnew.us_rol_perfil " +
    "JOIN gestionnew.usuarios " +
    "ON us_rol_perfil.id_perfil = usuarios.id_perfil " +
    "WHERE upper(usuarios.usuariorr) = ?";
    statement = conn.prepareStatement(query);
    statement.setString(1, usuario.toUpperCase());
    rs = statement.executeQuery();
    while (rs.next()) {
    grupos.add(rs.getString("ROL"));
    } catch (SQLException ex) {
    Logger.getLogger(AS400LoginModule.class.getName()).log(Level.SEVERE, null, ex);
    } catch (NamingException ex) {
    Logger.getLogger(AS400LoginModule.class.getName()).log(Level.SEVERE, null, ex);
    } finally {
    if (conn != null) {
    try {
    conn.close();
    } catch (SQLException ex) {
    Logger.getLogger(AS400LoginModule.class.getName()).log(Level.SEVERE, null, ex);
    if (rs != null) {
    try {
    rs.close();
    } catch (SQLException ex) {
    Logger.getLogger(AS400LoginModule.class.getName()).log(Level.SEVERE, null, ex);
    if (statement != null) {
    try {
    statement.close();
    } catch (SQLException ex) {
    Logger.getLogger(AS400LoginModule.class.getName()).log(Level.SEVERE, null, ex);
    return grupos.elements();
    private String getPasswordHave(String userName, Callback[] callbacks) throws
    LoginException {
    PasswordCallback passwordCallback = (PasswordCallback) callbacks[1];
    char[] password = passwordCallback.getPassword();
    passwordCallback.clearPassword();
    if (password == null || password.length < 1) {
    throwLoginException("Authentication Failed: User " + userName +
    ". Password not supplied");
    String passwd = new String(password);
    System.out.println("\tpasswordHave\t= " + passwd);
    return passwd;
    thanks

    hi everyone,
    i Developing own authentication provider and i installed a security patch, so while i restarting the weblogic server  encountered the below Exeption:
    <10/05/2013 05:54:33 PM COT> <Error> <Security> <BEA-090870> <The realm "myrealm" failed to be loaded: weblogic.security.service.SecurityServiceException: com.bea.common.engine.ServiceInitializationException: com.bea.common.engine.SecurityServiceRuntimeException: [Security:097533]SecurityProvider service class name for AS400Realm is not specified..
    weblogic.security.service.SecurityServiceException: com.bea.common.engine.ServiceInitializationException: com.bea.common.engine.SecurityServiceRuntimeException: [Security:097533]SecurityProvider service class name for AS400Realm is not specified.
    at weblogic.security.service.CSSWLSDelegateImpl.initializeServiceEngine(CSSWLSDelegateImpl.java:341)
    at weblogic.security.service.CSSWLSDelegateImpl.initialize(CSSWLSDelegateImpl.java:220)
    at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.InitializeServiceEngine(CommonSecurityServiceManagerDelegateImpl.java:1789)
    at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.initializeRealm(CommonSecurityServiceManagerDelegateImpl.java:443)
    at weblogic.security.service.CommonSecurityServiceManagerDelegateImpl.loadRealm(CommonSecurityServiceManagerDelegateImpl.java:841)
    Truncated. see log file for complete stacktrace
    Caused By: com.bea.common.engine.ServiceInitializationException: com.bea.common.engine.SecurityServiceRuntimeException: [Security:097533]SecurityProvider service class name for AS400Realm is not specified.
    at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:365)
    at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:315)
    at com.bea.common.engine.internal.ServiceEngineImpl.lookupService(ServiceEngineImpl.java:257)
    at com.bea.common.engine.internal.ServicesImpl.getService(ServicesImpl.java:72)
    at weblogic.security.service.internal.WLSIdentityServiceImpl.initialize(WLSIdentityServiceImpl.java:46)
    Truncated. see log file for complete stacktrace
    Caused By: com.bea.common.engine.SecurityServiceRuntimeException: [Security:097533]SecurityProvider service class name for AS400Realm is not specified.
    at com.bea.common.security.internal.legacy.service.SecurityProviderImpl.init(SecurityProviderImpl.java:42)
    at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:363)
    at com.bea.common.engine.internal.ServiceEngineImpl.findOrStartService(ServiceEngineImpl.java:315)
    at com.bea.common.engine.internal.ServiceEngineImpl.lookupService(ServiceEngineImpl.java:257)
    at com.bea.common.engine.internal.ServicesImpl.getService(ServicesImpl.java:72)
    Truncated. see log file for complete stacktrace
    this is the config.xml :
    <domain xmlns="http://xmlns.oracle.com/weblogic/domain" xmlns:sec="http://xmlns.oracle.com/weblogic/security" xmlns:wls="http://xmlns.oracle.com/weblogic/security/wls" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/security/xacml http://xmlns.oracle.com/weblogic/security/xacml/1.0/xacml.xsd http://xmlns.oracle.com/weblogic/security/providers/passwordvalidator http://xmlns.oracle.com/weblogic/security/providers/passwordvalidator/1.0/passwordvalidator.xsd http://xmlns.oracle.com/weblogic/domain http://xmlns.oracle.com/weblogic/1.0/domain.xsd http://xmlns.oracle.com/weblogic/security http://xmlns.oracle.com/weblogic/1.0/security.xsd http://xmlns.oracle.com/weblogic/security/wls http://xmlns.oracle.com/weblogic/security/wls/1.0/wls.xsd http://xmlns.oracle.com/weblogic/security/extension http://xmlns.oracle.com/weblogic/1.0/security.xsd">
    <name>base_domain</name>
    <domain-version>12.1.1.0</domain-version>
    <security-configuration>
    <name>base_domain</name>
    <realm>
    <sec:authentication-provider xsi:type="wls:default-authenticatorType"></sec:authentication-provider>
    <sec:authentication-provider xsi:type="wls:default-identity-asserterType">
    <sec:active-type>AuthenticatedUser</sec:active-type>
    </sec:authentication-provider>
    <sec:authentication-provider xmlns:ext="http://xmlns.oracle.com/weblogic/security/extension" xsi:type="ext:as400-realmType">
    <sec:name>AS400Realm</sec:name>
    <sec:control-flag>OPTIONAL</sec:control-flag>
    </sec:authentication-provider>
    <sec:role-mapper xmlns:xac="http://xmlns.oracle.com/weblogic/security/xacml" xsi:type="xac:xacml-role-mapperType"></sec:role-mapper>
    <sec:authorizer xmlns:xac="http://xmlns.oracle.com/weblogic/security/xacml" xsi:type="xac:xacml-authorizerType"></sec:authorizer>
    <sec:adjudicator xsi:type="wls:default-adjudicatorType"></sec:adjudicator>
    <sec:credential-mapper xsi:type="wls:default-credential-mapperType"></sec:credential-mapper>
    <sec:cert-path-provider xsi:type="wls:web-logic-cert-path-providerType"></sec:cert-path-provider>
    <sec:cert-path-builder>WebLogicCertPathProvider</sec:cert-path-builder>
    <sec:user-lockout-manager>
    <sec:lockout-enabled>false</sec:lockout-enabled>
    </sec:user-lockout-manager>
    <sec:deploy-role-ignored>false</sec:deploy-role-ignored>
    <sec:deploy-policy-ignored>false</sec:deploy-policy-ignored>
    <sec:security-dd-model>DDOnly</sec:security-dd-model>
    <sec:name>myrealm</sec:name>
    <sec:password-validator xmlns:pas="http://xmlns.oracle.com/weblogic/security/providers/passwordvalidator" xsi:type="pas:system-password-validatorType">
    <sec:name>SystemPasswordValidator</sec:name>
    <pas:min-password-length>8</pas:min-password-length>
    <pas:min-numeric-or-special-characters>1</pas:min-numeric-or-special-characters>
    </sec:password-validator>
    </realm>
    <default-realm>myrealm</default-realm>
    <credential-encrypted>{AES}kyVB/9J9Fbvp11tAnYgn6grV6wQwNZZGHSh2JLQtesxS46Re+QCfIAttNE5JugllQvUHOhE+pz0AnEfYL2p5q2oeRsjqoQz2/1Lg8x+3WMoKic0xnRzw2RWoFjQo3F9x</credential-encrypted>
    <node-manager-username>weblogic</node-manager-username>
    <node-manager-password-encrypted>{AES}4jkSbv5dMOl6cRpRa4QwB83XVavtq168cV4L+NSFDcI=</node-manager-password-encrypted>
    <cross-domain-security-enabled>true</cross-domain-security-enabled>
    </security-configuration>
    <server>
    <name>AdminServer</name>
    <listen-address>localhost</listen-address>
    <staging-mode>nostage</staging-mode>
    </server>
    <embedded-ldap>
    <name>base_domain</name>
    <credential-encrypted>{AES}9YeG1UFRNQzM0v6/j8cFvT9x9fkJUl1FJOWGInl5dax26FgMNEVwKNxOBHvW2opm</credential-encrypted>
    </embedded-ldap>
    <configuration-version>12.1.1.0</configuration-version>
    this is the mbean xml (A400Realmmbean.xml):
    <?xml version="1.0" ?>
    <!DOCTYPE MBeanType SYSTEM "commo.dtd">
    <MBeanType Name = "AS400Realm" DisplayName = "AS400Realm"
    Package = "co.com.claro.security"
    Extends = "weblogic.management.security.authentication.Authenticator"
    PersistPolicy = "OnUpdate"
    >
    <MbeanAttribute Name = "ProviderClassName" Type = "java.lang.String"
    Writeable = "false"
    Default =
    "&quot;co.com.claro.AS400Realm&quot;"
    />
    <MBeanAttribute Name = "Description" Type = "java.lang.String"
    Writeable = "false" Default = "&quot;My Identity Assertion Provider&quot;"
    />
    <MBeanAttribute Name = "Version" Type = "java.lang.String"
    Writeable = "false" Default = "&quot;1.0&quot;"
    />
    </MBeanType>
    and the runtime class:
    AS400Realm.java:
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package co.com.claro.security;
    import java.util.HashMap;
    import javax.security.auth.login.AppConfigurationEntry;
    import javax.security.auth.login.AppConfigurationEntry.LoginModuleControlFlag;
    import weblogic.management.security.ProviderMBean;
    import weblogic.security.provider.PrincipalValidatorImpl;
    import weblogic.security.spi.AuthenticationProviderV2;
    import weblogic.security.spi.IdentityAsserterV2;
    import weblogic.security.spi.PrincipalValidator;
    import weblogic.security.spi.SecurityServices;
    import weblogic.security.principal.WLSGroupImpl;
    import weblogic.security.principal.WLSUserImpl;
    public final class AS400Realm implements AuthenticationProviderV2
    private String description;
    // private SimpleSampleAuthenticatorDatabase database;
    private LoginModuleControlFlag controlFlag;
    // public String PARAM_JAAS_CONTEXT = "jaas-context";
    // public String PARAM_DATASOURCE_NAME = "jdbc/Oracle";
    // public String DEFAULT_GROUP_NAME = "default";
    public void initialize(ProviderMBean mbean, SecurityServices services)
    System.out.println("AS400Realm.initialize");
    AS400RealmMBean myMBean = (AS400RealmMBean)mbean;
    description = myMBean.getDescription() + "\n" + myMBean.getVersion();
    // database = new SimpleSampleAuthenticatorDatabase(myMBean);
    String flag = myMBean.getControlFlag();
    if (flag.equalsIgnoreCase("REQUIRED")) {
    controlFlag = LoginModuleControlFlag.REQUIRED;
    } else if (flag.equalsIgnoreCase("OPTIONAL")) {
    controlFlag = LoginModuleControlFlag.OPTIONAL;
    } else if (flag.equalsIgnoreCase("REQUISITE")) {
    controlFlag = LoginModuleControlFlag.REQUISITE;
    } else if (flag.equalsIgnoreCase("SUFFICIENT")) {
    controlFlag = LoginModuleControlFlag.SUFFICIENT;
    } else {
    throw new IllegalArgumentException("invalid flag value" + flag);
    public String getDescription()
    return description;
    public void shutdown()
    System.out.println("AS400Realm.shutdown");
    private AppConfigurationEntry getConfiguration(HashMap options)
    options.put("PARAM_DATASOURCE_NAME", "jdbc/Oracle");
    return new
    AppConfigurationEntry(
    "co.com.claro.security.AS400LoginModule",
    controlFlag,
    options
    public AppConfigurationEntry getLoginModuleConfiguration()
    HashMap options = new HashMap();
    return getConfiguration(options);
    public AppConfigurationEntry getAssertionModuleConfiguration()
    HashMap options = new HashMap();
    options.put("IdentityAssertion","true");
    return getConfiguration(options);
    public PrincipalValidator getPrincipalValidator()
    return new PrincipalValidatorImpl();
    public IdentityAsserterV2 getIdentityAsserter()
    return null;
    AS400LoginModule.java :
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package co.com.claro.security;
    import com.ibm.as400.access.AS400;
    import java.io.IOException;
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.util.Enumeration;
    import java.util.Map;
    import java.util.Vector;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import javax.security.auth.Subject;
    import javax.security.auth.callback.Callback;
    import javax.security.auth.callback.CallbackHandler;
    import javax.security.auth.callback.NameCallback;
    import javax.security.auth.callback.PasswordCallback;
    import javax.security.auth.callback.UnsupportedCallbackException;
    import javax.security.auth.login.LoginException;
    import javax.security.auth.login.FailedLoginException;
    import javax.security.auth.spi.LoginModule;
    import javax.sql.DataSource;
    import weblogic.security.spi.WLSGroup;
    import weblogic.security.spi.WLSUser;
    import weblogic.security.principal.WLSGroupImpl;
    import weblogic.security.principal.WLSUserImpl;
    * @author dmunoz
    final public class AS400LoginModule implements LoginModule {
    private Subject subject;
    private CallbackHandler callbackHandler;
    private String PARAM_DATASOURCE_NAME = "jdbc/Oracle";
    private String DEFAULT_GROUP_NAME = "default";
    // Determine whether this is a login or assert identity
    private boolean isIdentityAssertion;
    // Authentication status
    private boolean loginSucceeded;
    private boolean principalsInSubject;
    private Vector principalsForSubject = new Vector();
    public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options) {
    // only called (once!) after the constructor and before login
    System.out.println("SimpleSampleLoginModuleImpl.initialize");
    this.subject = subject;
    this.callbackHandler = callbackHandler;
    // Check for Identity Assertion option
    isIdentityAssertion =
    "true".equalsIgnoreCase((String) options.get("IdentityAssertion"));
    private boolean authenticateAS400(String user, String passwd) throws Exception {
    String host ="172.31.2.80";//Config.getProperty(Config.AS400_AUTHENTICATION_HOST);
    AS400 as400System;
    as400System = new AS400(host, user, passwd);
    return as400System.validateSignon();
    public boolean login() throws LoginException {
    // only called (once!) after initialize
    System.out.println("SimpleSampleLoginModuleImpl.login");
    // loginSucceeded should be false
    // principalsInSubject should be false
    Callback[] callbacks = getCallbacks();
    String userName = getUserName(callbacks);
    if (userName.length() > 0) {       
    if (!isIdentityAssertion) {               
    String passwordHave = getPasswordHave(userName, callbacks);
    try{
    loginSucceeded = authenticateAS400(userName, passwordHave);
    }catch(Exception e){
    Logger.getLogger(AS400LoginModule.class.getName()).log(Level.WARNING, null, e);
    throw new LoginException(e.getMessage());
    } else {
    // anonymous login - let it through?
    System.out.println("\tempty userName");
    if (loginSucceeded) {
    principalsForSubject.add(new WLSUserImpl(userName));
    addGroupsForSubject(userName);
    return loginSucceeded;
    public boolean commit() throws LoginException {
    // only called (once!) after login
    // loginSucceeded should be true or false
    // principalsInSubject should be false
    // user should be null if !loginSucceeded, null or not-null otherwise
    // group should be null if user == null, null or not-null otherwise
    System.out.println("SimpleSampleLoginModule.commit");
    if (loginSucceeded) {
    subject.getPrincipals().addAll(principalsForSubject);
    principalsInSubject = true;
    return true;
    } else {
    return false;
    public boolean abort() throws LoginException {
    // The abort method is called to abort the authentication process. This is
    // phase 2 of authentication when phase 1 fails. It is called if the
    // LoginContext's overall authentication failed.
    // loginSucceeded should be true or false
    // user should be null if !loginSucceeded, otherwise null or not-null
    // group should be null if user == null, otherwise null or not-null
    // principalsInSubject should be false if user is null, otherwise true
    // or false
    System.out.println("SimpleSampleLoginModule.abort");
    if (principalsInSubject) {
    subject.getPrincipals().removeAll(principalsForSubject);
    principalsInSubject = false;
    return true;
    public boolean logout() throws LoginException {
    // should never be called
    System.out.println("SimpleSampleLoginModule.logout");
    return true;
    private void throwLoginException(String msg) throws LoginException {
    System.out.println("Throwing LoginException(" + msg + ")");
    throw new LoginException(msg);
    private void throwFailedLoginException(String msg) throws FailedLoginException {
    System.out.println("Throwing FailedLoginException(" + msg + ")");
    throw new FailedLoginException(msg);
    private Callback[] getCallbacks() throws LoginException {
    if (callbackHandler == null) {
    throwLoginException("No CallbackHandler Specified");
    Callback[] callbacks;
    if (isIdentityAssertion) {
    callbacks = new Callback[1];
    } else {
    callbacks = new Callback[2];
    callbacks[1] = new PasswordCallback("password: ", false);
    callbacks[0] = new NameCallback("username: ");
    try {
    callbackHandler.handle(callbacks);
    } catch (IOException e) {
    throw new LoginException(e.toString());
    } catch (UnsupportedCallbackException e) {
    throwLoginException(e.toString() + " " + e.getCallback().toString());
    return callbacks;
    private String getUserName(Callback[] callbacks) throws LoginException {
    String userName = ((NameCallback) callbacks[0]).getName();
    if (userName == null) {
    throwLoginException("Username not supplied.");
    System.out.println("\tuserName\t= " + userName);
    return userName;
    private void addGroupsForSubject(String userName) {
    try {
    for (Enumeration e = getGroupNamesAS400(userName);
    e.hasMoreElements();) {
    String groupName = (String) e.nextElement();
    System.out.println("\tgroupName\t= " + groupName);
    principalsForSubject.add(new WLSGroupImpl(groupName));
    } catch (Exception ex) {
    Logger.getLogger(AS400LoginModule.class.getName()).log(Level.SEVERE, null, ex);
    public Enumeration getGroupNamesAS400(String usuario)
    throws Exception {
    if(usuario == null) {
    throw new Exception("Usuario no puede ser vacio");
    Vector<String> grupos = new Vector<String>();
    grupos.add(DEFAULT_GROUP_NAME);
    Connection conn = null;
    ResultSet rs = null;
    PreparedStatement statement = null;
    try {
    Context c = new InitialContext();
    DataSource dst = (DataSource) c.lookup(PARAM_DATASOURCE_NAME);
    conn = dst.getConnection();
    String query = "SELECT COD_ROL AS ROL " +
    "FROM gestionnew.us_rol_perfil " +
    "JOIN gestionnew.usuarios " +
    "ON us_rol_perfil.id_perfil = usuarios.id_perfil " +
    "WHERE upper(usuarios.usuariorr) = ?";
    statement = conn.prepareStatement(query);
    statement.setString(1, usuario.toUpperCase());
    rs = statement.executeQuery();
    while (rs.next()) {
    grupos.add(rs.getString("ROL"));
    } catch (SQLException ex) {
    Logger.getLogger(AS400LoginModule.class.getName()).log(Level.SEVERE, null, ex);
    } catch (NamingException ex) {
    Logger.getLogger(AS400LoginModule.class.getName()).log(Level.SEVERE, null, ex);
    } finally {
    if (conn != null) {
    try {
    conn.close();
    } catch (SQLException ex) {
    Logger.getLogger(AS400LoginModule.class.getName()).log(Level.SEVERE, null, ex);
    if (rs != null) {
    try {
    rs.close();
    } catch (SQLException ex) {
    Logger.getLogger(AS400LoginModule.class.getName()).log(Level.SEVERE, null, ex);
    if (statement != null) {
    try {
    statement.close();
    } catch (SQLException ex) {
    Logger.getLogger(AS400LoginModule.class.getName()).log(Level.SEVERE, null, ex);
    return grupos.elements();
    private String getPasswordHave(String userName, Callback[] callbacks) throws
    LoginException {
    PasswordCallback passwordCallback = (PasswordCallback) callbacks[1];
    char[] password = passwordCallback.getPassword();
    passwordCallback.clearPassword();
    if (password == null || password.length < 1) {
    throwLoginException("Authentication Failed: User " + userName +
    ". Password not supplied");
    String passwd = new String(password);
    System.out.println("\tpasswordHave\t= " + passwd);
    return passwd;
    thanks

  • How to implement a tree like security realm?

    hi all:
    i am working on a project . it's a very complex one and most importantly there's
    so many
    functions( 1000 or more) and every fuction should be protected resources. so i have
    to define many roles and map the roles to the many functions. it's a very tiring
    job and
    i am not sure the role to function mapping is stable one. because the mapping is
    saved in
    a xml file and this file is depolyed with the application, so if there s any changes
    we have to redeploy all the application and restart the server.
    there s still another problem. we want security realm to be a tree instead of
    a flat one( weblogic's group is a flat one ) . if we assign a node to a role all
    its children
    belong to the same role.
    so is there way to do this. any solution?
    regards
    daniel wang

    maybe you could exploit the way ACLs have dotted names to reflect your tree
    structure, so the acl root applies to all functions, root.branch1 only
    applies to functions on branch branch1, and root.branch1.branch2 applies to
    functions on branch2 of branch1. there´s an api that gets the most specific
    acl given a path to a node.
    i'm not it´s acls that you want to correspond to nodes, but maybe you can
    work out some kind of scheme that gives you what you want.
    andrew
    "daniel" <[email protected]> escribió en el mensaje
    news:3d16efc7$[email protected]..
    >
    hi all:
    i am working on a project . it's a very complex one and mostimportantly there's
    so many
    functions( 1000 or more) and every fuction should be protected resources.so i have
    to define many roles and map the roles to the many functions. it's a verytiring
    job and
    i am not sure the role to function mapping is stable one. because themapping is
    saved in
    a xml file and this file is depolyed with the application, so if there sany changes
    we have to redeploy all the application and restart the server.
    there s still another problem. we want security realm to be a treeinstead of
    a flat one( weblogic's group is a flat one ) . if we assign a node to arole all
    its children
    belong to the same role.
    so is there way to do this. any solution?
    regards
    daniel wang

Maybe you are looking for

  • Every time I enable the OnBoard USB, in bios, the memory check takes ages.

    yup. Every time I change the OnBoard USB to enabled in BIOS, the startup memory check takes for ages (approximately 5 minutes or so...)(the check jamms for a few numbers before it's finished, it jamms on numbers 104857 and after a little while it goe

  • Why would wi-fi not turn on, 4s

    My iPhone 4s will not let me turn on Wi-Fi and I have a few apps which will not open either. I have 2 sky sports apps and 1 will open but the other won't. BBC iPlayer won't open either but other things will. No problem with calls or texts, itunes, BB

  • Regarding reporting in diffrent countires

    hi, i have business in three countries and i created 3 co. codes for 3 countries that is in 1. USA, 2. IN and 3. Germany. so in this my question is i want see report in all three contrives in one time. how i can see thanks in advance venkat

  • Slicers Removed from Template: "Removed Records: Slicer Cache from /xl/slicerCaches/slicerCache3.xml part (Slicer Cache)"

    Product: Microsoft Office Professional Plus 2010 I have created a template file with a data table, 2 pivot tables, and each of those 2 pivot tables has a pivotchart and 2 slicers.  I have some code that updates the pivot table ranges.  When that occu

  • How do I manage Video Ram size

    Hello, I would like to ask how do I adjust the size of video ram in OSX and windowsXP. I have read someone's post saying that it is not user changeable in OSX. if it is not changeable, when will it changeable to a larger size? How about in windowsXP?