My adapter-based authenticator works fine in onDemand authentication, but when I change it to onStartup, it don't call procedure for login purpose of my adapter, i.e. at first time, authRequired = true, client side show login page, after login button clicked, it try to call login procedure of my adapter, but it seems that worklight server don't call expected procedure (named login) of my adapter, the adapter is configured to give login procedure authenticationRequired = false, target procedure don't execute and client-side received OK status but response.authRequired is still true.
After I changed authentication mode to onDemand, then OK, but my app required to use onStartup authentication, I read worklight 4.2.1 tutorial - adapter-based authentication section again, the sample use onDemand only. Does anybody know what's wrong?
thanks for your hits.
This topic has been locked.
Pinned topic Adapter-based authenticator failed with onStartup
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
AntonAleksandrov 270005D80F22 Posts
Re: Adapter-based authenticator failed with onStartup2012-06-20T07:23:01ZThis is the accepted answer. This is the accepted answer.Hello Daniel,
Adapter based authentication will not function with onStartup setting.
onStartup means that your application has to authenticate to be able to gain access to adapters in the first place. So, your in a loop here - 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 only option to use adapter based authentication is with onDemand setting.
SystemAdmin 110000D4XK570 Posts
Re: Adapter-based authenticator failed with onStartup2012-06-20T08:20:16ZThis is the accepted answer. This is the accepted answer.
- AntonAleksandrov 270005D80F
Thanks Anton a lot,
Now I see the error, I changed to use onDemand authentication, and call WL.Client.login('MyRealm') in wlCommonInit() to trigger login process, it open a browser window with error, I checked the URL, it seems that /apps/services in the URL is concatenated twice, in my pages, only one <base /> tag which is generated by worklight builder.
In my application-descriptor.xml, the <worklightRootURL /> is http://localhost:8080, I changed it to http://localhost:8080/ (add a slash), still get wrong URL.
Does anybody know which setting is wrong?
WL.Client.login('MyRealm') open the problematic URL:
thanks for any advances