I am currently having an issue where if I am using custom authentication, such as that in Module 22 – Custom Login Module, the user id sent when registering for push notifications is not that of the username I logged in with.
I am able to see the user id that is registered through logging, which seems to be a randomly generated sequence of letters and numbers.
The Push Notification module uses simple form based authentication, and does work for sending the user id properly, but the code copied directly from the Custom Login module does not. So I am thinking there is something missing in that code to set the current user, even though it does verify that I am authenticated.
Also when I try to run WL.Client.getLoginName or getUserName it always returns “undefined”, in both the Push and Custom Login modules, so I am not able to check what it thinks my user name is.
I have put the push module code into the customer authentication module and get the same results, randomly generated userId instead of the one I logged in with.
This topic has been locked.
2 replies Latest Post - 2013-01-24T19:37:20Z by SystemAdmin
Pinned topic Issue with Push UserId and Custom Login Module
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
IdanAdar 2700059KWB741 PostsACCEPTED ANSWER
Re: Issue with Push UserId and Custom Login Module2013-01-23T11:21:29Z in response to SystemAdminHi,
Can you show me the following files from your project?
application-descriptor.xml, authenticationConfig.xml, adaptr's implementation file (where the event source function is)
When using push notifications, you need to add your securityTest also to the WL.Server.createEventSource function (I believe this can be seen in the Push Notifications samepl).
IBM Worklight Mobile Platform
SystemAdmin 110000D4XK2327 PostsACCEPTED ANSWER
Re: Issue with Push UserId and Custom Login Module2013-01-24T19:37:20Z in response to IdanAdarAfter adding a "mobileSecurityTest" and the "securityTest" parameter it gets the correct user id. My guess would be that without the securityTest it is able to register itself when doing createEventSource and that doesn't change after authenticating.