Topic
4 replies Latest Post - ‏2012-04-19T02:09:39Z by SystemAdmin
SystemAdmin
SystemAdmin
570 Posts
ACCEPTED ANSWER

Pinned topic Question about authentication

‏2012-04-18T09:00:10Z |
Hi There

I'm running WL Studio 4.2.2.1294 and WL server Build Version: 4.2.2.1283

I am developing a login page for an app in IBM CDL. I used form based authenticator and customized login module. I need to authenticate the group name, username and password. But in authenticator and login module's java file, I can only submit username and password and get them in login module's java file. So is there any possible solution to submit more than two fields and get all of them in login module's java file?

I find out that I have asked many questions recently. Pls don't feel bothered... ;) :)
Thanks, Tim
  • SystemAdmin
    SystemAdmin
    570 Posts
    ACCEPTED ANSWER

    Re: Question about authentication

    ‏2012-04-18T12:53:09Z  in response to SystemAdmin
    Hi Tim.

    Yes you can.
    Please check Worklight Training Module 20.2 – Authentication: Custom Login Module.
  • AntonAleksandrov
    AntonAleksandrov
    22 Posts
    ACCEPTED ANSWER

    Re: Question about authentication

    ‏2012-04-18T13:11:51Z  in response to SystemAdmin
    Alternatively you can use Adapter based authentication, it is much easier to customize since everything is done using JavaScript.

    additional information:
    Authentication concepts - http://www.worklight.com/download/get-started/4.2.1/module-20
    Adapter based authentication - http://www.worklight.com/download/get-started/4.2.1/module-20.1
    Sample - http://www.worklight.com/assets/files/Training%20Modules/Samples/module_20_1_DoubleandSingleStepAdapterBasedAuthentication.zip
  • SystemAdmin
    SystemAdmin
    570 Posts
    ACCEPTED ANSWER

    Re: Question about authentication

    ‏2012-04-18T19:05:08Z  in response to SystemAdmin
    I have a similar situation in that I need to pass one additional field to my custom login module.

    I don't see any material in 20.2 tutorial to show how this can be done.
    I see 20.1 mention using Adapter to carry additional data and you have said as much as well.

    But I don't see how UserNamePasswordLoginModule class let you do that.

    public boolean login(Map<String, Object> authenticationData)

    authenticationData only has two items
    user.password
    user.name

    Can you show code both in the JS and subclass of UserNamePasswordLoginModule how to handle additional field?

    I am interested in how to use custom login module to do this and not how to use Adapter.

    Roger.
  • SystemAdmin
    SystemAdmin
    570 Posts
    ACCEPTED ANSWER

    Re: Question about authentication

    ‏2012-04-19T02:09:39Z  in response to SystemAdmin
    Hi, There

    Thank you for your reply!

    My problem is just like what rogerwong faced. Besides, I need startup authentication. So I can only use form-based authenticator, then I can't find any solution to submit three fields to login module. In login module, as rogerwong said, I can only get username and password.
    thanks! Tim