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

Pinned topic Question about authentication

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

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

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
    570 Posts

    Re: Question about authentication

    Hi Tim.

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

    Re: Question about authentication

    Alternatively you can use Adapter based authentication, it is much easier to customize since everything is done using JavaScript.

    additional information:
    Authentication concepts -
    Adapter based authentication -
    Sample -
  • SystemAdmin
    570 Posts

    Re: Question about authentication

    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

    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.

  • SystemAdmin
    570 Posts

    Re: Question about authentication

    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