1

Can I protect application with adapter authentication? Base on single step adapter authentication example, i added mobileSecurityTest to authenticationConfig.xml under securityTests tag like below:

<mobileSecurityTest name="usermobileTest">
            <testAppAuthenticity/>
            <testUser realm="SingleStepAuthRealm" />
            <testDeviceId provisioningType="none"/>
</mobileSecurityTest>

and in application-descriptor.xml:

 <android  version="1.0"  securityTest="usermobileTest">
        <worklightSettings include="true"/>
        <security>
            <encryptWebResources enabled="false"/>
            <testWebResourcesChecksum enabled="false" ignoreFileExtensions="png, jpg, jpeg, gif, mp4, mp3"/>
            <publicSigningKey>MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAohbTq82oTymVDkXQsXBuffE82Jipympa9QPWNsqSYkEQL1y8cHRM6+9gZQtvmX8xssnIwdiV/4WKwIOadCdIcaatNPSTYN4h3TLPUdt1SvtZ8QUC1zzwAeTzTRNa7GFTjwUGT7ZsfUtQBnXfSH8F+jDi+x1m9QtiOxG1+s2M5+3BgBjAa0GIYyn0xLI4zaWUamaIsvG8lU4Oh9FJh7cTkx1nCKIz8zoROIOfzo0rQj35Q7Gmkui58JnrL3YTqxORMD/J2UTe9wmHqJ3QgL5wEYJzIicXtUwBzqOhS60FjFg5c85RJcAZBnlyFPzTKc/gZI9AJNZGR6LQOERR1EpmmQIDAQAB</publicSigningKey>
        </security>
    </android>

And in initOptions.js file, set connectOnStartup : true.

When app starts, it shows login page, then i enter username, password and click submit button, the app shows an alert: An error was encoutered while proccessing the request from the application.

And in Logcat Debugging, it shows error: StatHub::Init - App com.SingleStepAdapterAuthentication isn't supported.

Can anyone tell me why? Thanks for your help!

Idan Adar
  • 44,156
  • 13
  • 50
  • 89
HoangNguyen
  • 183
  • 2
  • 9

1 Answers1

0

This should work in Worklight v5.0.6.1, please make sure you are using that version.

Otherwise, a way around it is to NOT place the security test on the android environment, and intsead call WL.Client.login(..) in your wlEnvInit or wlCommonInit function.

Idan Adar
  • 44,156
  • 13
  • 50
  • 89
  • i have updated to Worklight 5.0.6.1, it works well on mobile browser simulator, but when i test on real device, it gets error. Anyway, I try WL.Client.login(realms, options) and it works well, thanks very much! – HoangNguyen May 30 '13 at 18:30
  • But can you tell me what are the properties of response object in onSuccess and onFailure options? – HoangNguyen May 30 '13 at 18:38