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.
NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
This topic has been locked.
2 replies Latest Post - 2012-06-20T08:20:16Z by SystemAdmin
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 PostsACCEPTED ANSWER
Re: Adapter-based authenticator failed with onStartup2012-06-20T07:23:01Z in response to SystemAdminHello 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 PostsACCEPTED ANSWER
Re: Adapter-based authenticator failed with onStartup2012-06-20T08:20:16Z in response to AntonAleksandrovHi,
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