Topic
  • 2 replies
  • Latest Post - ‏2012-12-06T10:28:02Z by SystemAdmin
SystemAdmin
SystemAdmin
2327 Posts

Pinned topic WL 503- Configuring Adapter based security for Application On Startup

‏2012-11-30T11:48:32Z |
Hi,
I am trying to configure application onStartup Security for application on Worklight 5.0.3.
Have configured webSecurityTest for adapter based realm and configured ChallengeHandler.js with the 5.0.3 requirements.
When I try with onDemand kind of security, it works fine.

When I try with defining webSecurityTest in authconfig, the application gives below error when posting the user id/password from login screen.
"Uncaught TypeError: Cannot call method 'show' of undefined"

Do I need to any other changes other then adding "common securityTest" in application descriptor file to configure security on startup?

Regards
Harish
  • IdanAdar
    IdanAdar
    741 Posts

    Re: WL 503- Configuring Adapter based security for Application On Startup

    ‏2012-11-30T13:12:09Z  
    Have you taken a look at the Development FAQ thread?
    http://www.ibm.com/developerworks/forums/thread.jspa?threadID=440423&tstart=0

    Question:
    I am trying to develop adapter-based authentication using requireAuthentication=onStartup, but this does not work!

    Answer:
    Adapter-based authentication will not function with the onStartup setting.
    onStartup authentication means that your application has to first authenticate to be able to gain access to adapters in the first place. So, you're in a loop - you need to authenticate to be able to invoke adapters, but you need to be able to invoke adapters in order to authenticate.

    Therefore currently the only option to use adapter-based authentication is by using the onDemand setting.
    You can use WL.Client.login("your-realm-name") in your JavaScript to invoke authentication sequence on application start-up.

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
  • SystemAdmin
    SystemAdmin
    2327 Posts

    Re: WL 503- Configuring Adapter based security for Application On Startup

    ‏2012-12-06T10:28:02Z  
    • IdanAdar
    • ‏2012-11-30T13:12:09Z
    Have you taken a look at the Development FAQ thread?
    http://www.ibm.com/developerworks/forums/thread.jspa?threadID=440423&tstart=0

    Question:
    I am trying to develop adapter-based authentication using requireAuthentication=onStartup, but this does not work!

    Answer:
    Adapter-based authentication will not function with the onStartup setting.
    onStartup authentication means that your application has to first authenticate to be able to gain access to adapters in the first place. So, you're in a loop - you need to authenticate to be able to invoke adapters, but you need to be able to invoke adapters in order to authenticate.

    Therefore currently the only option to use adapter-based authentication is by using the onDemand setting.
    You can use WL.Client.login("your-realm-name") in your JavaScript to invoke authentication sequence on application start-up.

    Idan Adar
    QA Engineer
    IBM Worklight Mobile Platform
    Thanks Idan