Party Pool Sign On

In this Lesson

In this lesson you will enhance the Party Pool to require user authentication.

Concepts

Soiree provides a sample sign on scene along with agents for sign on and sign off processing. In this lesson you will be using those samples to require users to authenticate before they can access the solution.

Install the Security Samples

  1. Right click on the Party project and open the Soiree Project Configuration tool
  2. Add the Signon and Menu Samples to your project



    It will add the navigation and security packages to the com.seronix.soiree package.



Rename the Signon Samples

You will now rename the sign on samples so they become part of your solution.

  1. Right click on the com.seronix.soiree.security package and select Refactor – Rename….



  2. Rename the package as shown here



    Notice
    When you rename/move an Sx Item file Soiree will refactor the item’s id as well as any references to the modified item. For example, the Signon agent’s ID changed when you renamed the package. The SampleSignon scene, which was referencing the agent as com.seronix.soiree.security.agent.Signon now references the agent as com.example.party.security.agent.Signon.


  3. The package has been moved. Notice the agent classes have errors. This is because their superclass was deleted when the agent item files were moved.
    Notice
    When an Sx Item file is deleted or moved Soiree deletes the src-gen files associated with the item.



  4. Rebuild the agents by right-clicking on the com.example.party.security package and using the context context menus as shown here



    The superclass files should now appear in the src-gen folder in the new package location



  5. Change the superclass import in both agents to begin with com.example.party. instead of com.seronix.soiree



    The errors should now be resolved



  6. Rename the SampleSignon.sxScene to Signon.sxScene. Your project should now look like this



Add some personality to the sign on scene

  1. Download an image for the scene.
    • Right Click on the Party Fish
    • Select Save Image As… from the pop-up menu.


    Party fish


  2. Download a font for the scene.
    • Click on the font image to download the font.


    Daniel Font


    Daniel Font License

  3. Open the Signon scene
  4. Add the fish image to the Images catalog



  5. Add the font file to the Fonts catalog



  6. Modify the sign on scene to look something like this



  7. Save the scene

Add the Signon scene to your solution

You will now configure your solution to use the Signon scene.

  1. Open the PartyPool solution
  2. Set the initial and home scenes to the values shown here



Test the Signon scene

  1. Start the Derby database if it is not already running
  2. Start SxServer if it is not already running
  3. Start the PartyPool solution
    The sign on scene should be the first things you see (the solution’s initial scene)



  4. Sign on using the administrator account
    User ID = admin
    password = admin

    You will advance to the solution’s home scene



  5. Notice the ability to delete or edit a user is not available.



    You secured both of these features in the Rights Lesson and the admin user has not been granted those rights. You will be granting those rights to users in the next lesson.

Add sign off capability

Now that your solution is using a sign on scene we should also provide a way to sign off.

  1. Open the PartyDefinition scene
  2. Add the following hyperlink to layer 1



  3. Switch to the Agent Binding perspective and add the Signoff agent to layer 1 and bind its signoff event to the hyperlink element.



  4. Retest the solution
  5. Pressing the log off link will remove the user from the connection and take you back to the sign on scene.

That’s all for this lesson.