Do we have AUTH & session management in V2 similar to V1.0?

My client is asking for a demo of V2 and we would want to pitch them app on V2 for new channel onboarding which would have functionality similar to our existing app in Vahana1.0.
Would need confirmation on below:

  1. Does AUTH API work same as Vahana 1.0?
  2. Is their user level session for APIs in V2?

Yes it is inside in Designer 2.0. User needs to call AUTH service to create user level session.

1 Like

@harman_singh Can you please explain the implementation of AUTH in vDesigner2.0?

Hi @VivekBhardwaj as @Vinay_Pratap_Singh rightly mentioned, AUTH service can be used to create user-level session. Let me share the steps required to do the same.

The AUTH service is a default service present in vConnect’s Service Management section. Make sure that you change the AUTH service’s scope from “User Level” to “Device Level.”

Why this above step is needed:

A user-level session works only if a user is logged in. However, a device-level session starts automatically when the device is turned on. Similarly, when a user launches the build of the application, a device-level session gets created, thus to hit this particular service or make it functional, one should change this service’s session to “Device Level.”

Steps to follow:

  1. Once the service’s session is changed to Device Level, ‘Sync’ the changes from the “Release Manager” module of the middleware.

  2. Now, let me explain the implementation of the AUTH service using a use case wherein I will take user input for login ID and password on the Login screen and re-direct the user to the dashboard (home screen) if the user session has been successfully created.

  3. Open vDesigner-2.0’s canvas and drop 2 Inputfield elements and a button element.

  4. Select the button element and go to Events > onClick > Create New Task Group. Drop a “Configure Service” task and open the “Set Parameters” option. Search for “AUTH” > Consume.

  5. Add the following request in the JSON object section of “Request Parameters”:

     {"loginId":"",
     "password":""}
    
  6. Map the 2 Inputfield elements to the “loginId” and “password” Key Name.

  7. Now, go to the “Response Parameters” section and select any random field in the “Output Location.” Please note that storing the response for the AUTH service is not mandatory. Thus, the response mapping part can be skipped.

  8. Click “Review & Save” then save the task group and go back to the Login screen on the Canvas. Click the 3 dots icon next to the page name and select the “Set as Login” option. This completes the Login screen.

  9. Now, create another page for the dashboard (home screen) and on the “Page Level Properties” select the “Security” tab left to the ‘Events’ tab. Select the “Private Page” option and set the “Security Level” to “User Session” and apply the changes.

  10. Now you can edit the task group linked to the button element of the Login Screen and add another ‘Navigation’ task in it. Set the “Destination Screen” as the dashboard (home screen).

  11. Apply, Save and Commit the changes and test the AUTH functionality on your build. Make a note that if the user session doesn’t get created, you will not be able to navigate to the dashboard (home screen).

Thanks for the details @harman_singh
But our current application (LMS) is used by the business users and they have to login before doing any activity in the app.
My query is along this point, if we want to migrate our existing app from vahana 1.0 to 2.0, would it even be feasible to maintain user-level session?

Hi @harman_singh, Nice Explanation!
But I have one doubt, why are we setting the home screen as private page and changing the security level?

@Achint_Kaur, great question. The answer lies in Session Management.

When you set the home screen as a ‘Private Page’ with ‘User Level’ security, the user cannot access the home screen until a user-level session is created.

By selecting ‘Set as login’ for the ‘Login Screen,’ you ensure that if the user-level session fails, the user is automatically redirected to the ‘Login Screen’ since the ‘Home Page’ is set as ‘Private (User Session).’

1 Like