Forum Stats

  • 3,851,423 Users
  • 2,263,974 Discussions
  • 7,904,701 Comments

Discussions

Register user from JSP or JSF to weblogic

703928
703928 Member Posts: 21
edited Aug 12, 2009 4:16AM in JDeveloper and ADF
Hi everyone,

I use JDeveloper 11g, ADF BC, Weblogic Server 10.3.

I already have an authentication and it works but I need to enter login and password in weblogic console and enter login in weblogic.xml in JDeveloper.
I would like to know if it's possible to register the user from JSP/JSF page (the user registers himself). I'm new on this technology (JDev and Weblogic) so if it's possible, please say me step by step what I have to do.

Thank you very much

Regards

Best Answer

  • Arunkumar Ramamoorthy-Oracle
    Arunkumar Ramamoorthy-Oracle Member Posts: 5,880 Employee
    Answer ✓
    youlewinner wrote:
    Yes I restarted the WLS after changing it.

    I have 3 authentication providers: DefaultAuthenticator, DefaultIdentityAsserter, db_users. Have I need DefaultIdentityAsserter? Should I set parameter inside?
    No, DefaultIdentityAsserter is created by default. You don't need to modify / delete it for making SQLAuthenticator to work.
    >
    In DefaultAuthenticator, should I tick "Use Retrieved User Name As Principal" ???
    No, not required to change anything in the DefaultAuthenticator other than the control flag.
    >
    You have right, I have problem with SQL, I can see it ini the log. I will resolve it. But I have a question: Should I fill all SQL statement in WLS? Because i don't use group or roles or member, so I didn't fill them, only 6 first ones.
    AFAIK, you need to have SQL Queries for Users, Roles and Groups.
    Thank you

    Edited by: youlewinner on 27 juil. 2009 06:07
    Regards.
    Arun
«13

Answers

  • Frank Nimphius-Oracle
    Frank Nimphius-Oracle Member Posts: 29,689 Bronze Badge
    Hi,

    yes and no. In weblogic the authentication is performed by authentication providers. Depending on which provider you use, you can use the WebLogic JMX API to create new accounts. For example, if you use the Weblogic embedded LDAP server then this is possible to do. If you use OID then better is to directly access OID to create users because the generic LDAPprovider that you can use to hook up OID to WLS does not support account creation

    Frank
    Frank Nimphius-Oracle
  • Arunkumar Ramamoorthy-Oracle
    Arunkumar Ramamoorthy-Oracle Member Posts: 5,880 Employee
    Hi,

    You can achieve this by using a sql authentication provider. It gets the users and their roles & credentials from the db tables which you can configure in WLS. In JSF, you can create a creation form based on the table (which you configured for authentication), which can be used for the users to register.

    Check out this doc for more information.

    Regards,
    Arun
    Arunkumar Ramamoorthy-Oracle
  • 703928
    703928 Member Posts: 21
    Hi,

    thank you for your quickly answer. I spend in the same time to display images with ORDImage.

    So I'm a beginner, so I don't know if I use LDAP server or OID thing. How is it possible to know?

    Thank you
    Regards
  • Arunkumar Ramamoorthy-Oracle
    Arunkumar Ramamoorthy-Oracle Member Posts: 5,880 Employee
    Hi,

    It depends on your requirement. If the application that you would be deploying uses more number of user or, the users stored would be used across multiple applications (Single Sign On kind of), then you can go for LDAP/OID. If it is for simple purpose / used by limited number of users, then you can use the SQL Authentication method (which just needs basic knowledge on SQL - for creating tables and using select statements).

    So, in order to suggest for a better solution, let us know your scenario / usage.

    Regards,
    Arun
    Arunkumar Ramamoorthy-Oracle
  • 703928
    703928 Member Posts: 21
    Hi,

    my application will concern around 100 people and more after. I don't want limit.

    Regards
  • Arunkumar Ramamoorthy-Oracle
    Arunkumar Ramamoorthy-Oracle Member Posts: 5,880 Employee
    Hi,

    Check out this page.

    http://download.oracle.com/docs/cd/E13155_01/wlp/docs103/security/planning.html

    It will surely help out to formulate your strategy and to narrow down to the authentication provider that would suite your scenario.

    Regards,
    Arun
    Arunkumar Ramamoorthy-Oracle
  • 703928
    703928 Member Posts: 21
    Hi,

    To answer your question about my scenario, I need only 'normal' user, I don't want create group or roles like administrator, user, visitors.
    ok i'm not sure if you understood my question because on this documentation it's only configuration on weblogic console, am not I ?


    I will reformulate:
    Now, if I would like to create a new user, I need to create via weblogic console and datasource the user.
    Is it possible to create a new user via a JSP/JSF page ?

    Only authentication works (I show you my login page):

    *****************************************

    <html>
    <body>

    <h3>
    Security WebApp login page
    </h3>
    Please enter your user name and password:
    <p>
    &nbsp;
    </p>
    <form method="POST" action="j_security_check">
    <table border="1">
    <tr>
    <td>Username:</td>
    <td>
    <input type="text" name="j_username" id="currentuser"/>
    </td>
    </tr>
    <tr>
    <td>Password:</td>
    <td>
    <input type="password" name="j_password"/>
    </td>
    </tr>
    <tr>
    <td colspan="2" align="right">
    <input type="submit" value="Submit"/>
    </td>
    </tr>
    </table>
    </form>

    </body>
    </html>

    **********************************************

    Thank you

    Regards
  • Arunkumar Ramamoorthy-Oracle
    Arunkumar Ramamoorthy-Oracle Member Posts: 5,880 Employee
    Ok,

    here you go.

    http://biemond.blogspot.com/2008/12/using-database-tables-as-authentication.html

    This document has step by step procedure to setup the SQL Authentication provider with custom db tables with user details.

    Once after configuring you WLS with provider and other setups, you can create a jspx page with the creation form based on the user table which can be used as Register page.

    Make this Register page unsecured and provide a link for this in your Login page where the user can click and Sign up/register.

    Let us know how it goes.

    HTH.

    Regards,
    Arun
    Arunkumar Ramamoorthy-Oracle
  • 703928
    703928 Member Posts: 21
    edited Jul 27, 2009 8:28AM
    Hi,

    now I configured the SQL authentication. If I change the password in the console, it changes automatically in the database.
    So it worked for it but I think I miss something because the authentication doesn't work.
    Maybe in weblogic...

    My weblogic is this:

    <?xml version="1.0" encoding="UTF-8"?>
    <wls:weblogic-web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:wls="http://www.bea.com/ns/weblogic/90"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
    http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd
    http://www.bea.com/ns/weblogic/90
    http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd">
    <wls:context-root>AuthenticationWeb</wls:context-root>
    <wls:security-role-assignment>
    <wls:role-name>miccroomrole</wls:role-name>
    <wls:principal-name>[email protected]</wls:principal-name>
    <wls:principal-name>[email protected]</wls:principal-name>

    </wls:security-role-assignment>
    <wls:session-descriptor>
    <wls:persistent-store-type>replicated_if_clustered</wls:persistent-store-type>
    </wls:session-descriptor>
    </wls:weblogic-web-app>

    Thank you

    Edited by: youlewinner on 27 juil. 2009 05:27
  • Arunkumar Ramamoorthy-Oracle
    Arunkumar Ramamoorthy-Oracle Member Posts: 5,880 Employee
    Hi,

    What do you mean by it is not working? Does it throw any error when you login?

    Have you set the Control Flag to Sufficient (You need to set the same for the DefaultAuthenticator also).

    Regards,
    Arun
This discussion has been closed.