Topic
2 replies Latest Post - ‏2013-01-24T19:37:20Z by SystemAdmin
SystemAdmin
SystemAdmin
2327 Posts
ACCEPTED ANSWER

Pinned topic Issue with Push UserId and Custom Login Module

‏2013-01-22T17:00:29Z |
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.
  • IdanAdar
    IdanAdar
    741 Posts
    ACCEPTED ANSWER

    Re: Issue with Push UserId and Custom Login Module

    ‏2013-01-23T11:21:29Z  in response to SystemAdmin
    Hi,

    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).

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

      Re: Issue with Push UserId and Custom Login Module

      ‏2013-01-24T19:37:20Z  in response to IdanAdar
      After 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.