Single Sign-on
Two examples of using Single Sign-on in your application
Single Sign-on
This article gives two examples on how to use the authentication node to realize single sign-on functionality. For these examples we have made the assumption that an authentication provider (based on Microsoft Office 365) had been created.
Example 1 – a simple way of using single sign-on
We’ll start with a simple way of using the authentication node to authenticate and authorize users to access your WEM application. In a very basic way. You only need a few steps:
- Open the - Homeflowchart that is always available
- Now add an - authentication nodeto the flowchart. You are presented with a popup to select the authentication provider you want to use. If you don’t already have a provider, you can read here how to do that. Select the provider and click on- Ok.

- You can now change the properties of the authentication node you just added. Check whether the property - Actionis set to- SignOn. Because this is the action we want the node to execute.

- Finally define in your flowchart what should happen when the user is authenticated. E.g. start a flowchart that takes the user to the actual application. When you draw an arrow between the authentication node and the nedt node (e.g. a subflowchart), the exit that should be used is the - authenticatedexit: the user is authenticated and can now access the rest of the application.
You now have something like this:

Example 2 – Using attributes from your authentication provider
The previous example was the most basic way to use the authenticated node. You can do a lot more with it and we’ll explore that in this example. We will expand the previous flowchart and add an overlay that displays some information, like your email address, whenever you log in.
Step 1: add fields to store information
We will start with creating a coupld of data fields we need:
- Create a new folder in the Data model, and call it ‘Single sign-on’ 
- Add three text fields: - Email – this will store the email address of the person logging in 
- Display name- this will store the Display name of the person loggin in 
- Response message – the store the message the authentication node returns when logging in 
 
So now we have:

Step 2: create the flowchart
The next step is to create the flowchart that is used to log in the user. Create a new flowchart called sso that we will use for this example.
- Open the - ssoflowchart. There is only the- Startnode.
- Add three - Assignment nodes and use the to clear the values of the fields we just added.
- Add an - Authentication nodein the same way as in the previous example. So select your authentication provider and make sure the- Actionis set to- SignOn
- Connect the nodes. You now have a flowchar that looks like: 

Step 3: add an overlay to display information
The idea of this example is to show that there is more information that you can get out of the authentication process. To show this, we will add an interaction node to our flowchart and add a few labels to display that information:
- Add the - interaction node. Name it ‘Authenticated’ and make it an overlay
- Add three labels to the overlayand give the the following values: - “Welcome “+ select the - Display namefield you created earlier
- “Your email address: “+ select the - Emailfield you create earlier
- “Response message from Azure AD: “+ - newline+ select the- Response messagefield tou created earlier:
 



And the interaction node looks like this:

Step 4: complete the flowchart
Now that we have created the overlay to display the information, we need to complete the flowchart:
- Connect the - Authenticationnode with the- Interaction node, and select the- Authenticatedexit.
- Create to exits for the interaction node - ‘Sign out’, and add this button to the button bar. When the user clicks this butten, the user will log out 
- ‘Continue’, and add this button to the button bar as well. When the user clicks this button, we will continue with the application. 
 
- Add a second - Authentication node- Select the same authentication provider as the first - Athentication node
- Set the - Actionvalue to- Logout. When this node is reached, the user will now be logged out
- Connect the - interaction nodewith the second- Authentication nodeand use the ‘Sign out’ exit to connect the two
- Add an - Endnode and connect the- Authentication node, using the- Not authenticatedexit.
 
- Add a - Enter subflowchartnode and select the flowchart that needs to be started after the user has logged on (you can create a very simple flowchart for this purpose). Connect the- interaction nodewith this- Enter subflowchartnode and use the ‘Continue’ exit to make the connection
Your flowchart should now look something like this:

Step 5: create navigation points
Since you created a new flowchart for this example, we need to make the flowchart is executed by the application. This can be done by calling this flowchart from e.g. the default Home flowchart, but in this case we’ll add a menu option to sign in:
- Open - Navigationin the project tree and click on on- Main menu. You now see the various main menu navigation points that exist
- Click on - New navigation pointto create a new menu option (a navigation point)- Name it ‘Sign in’ 
- The - Actionis a- Deeplink
- Select the - ssoflowchart
 
You now have a menu option available to sign in, using your companies authentication provider.
Step 6: configure the authentication provider settings
To mke it all work, we need to configure the settings for the authentication provider. This is needed to make sure all the additional information is actually provider by the authentication service. There are two ways of make the information available:
- Using response handlers 
- Adding/managing attributes 
First, we will use the response headers:
- In the Project navigation tree, open - Authentication providersand click on your authentication provider. You will no see the settings page of this provider. On the right there is the column- Response handlers:

- In the Response Handlers column, change the - Map response message tovalue to point to the- Response messagefield you creater earlier
Next, we add attributes for the Display name and the Email address that we want to show in the overlay window when a user signs in:
- In the toolbar, click on - Manage attributes. This shows the form to manage attributes that are used by this authentication provider
- Click on - Addto add a new attribute. Fill in the form with the following values:- Friendly name: ‘Display name’
- Name: ‘http://schemas.microsoft.com/identity/claims/displayname’
- Name format: ‘TXT’
- Data field: select the- Display namefield you created earlier. This attribute is now connected to the data field.
 

- Savethis attribute, and- Addanother:- Friendly name: ‘Email’
- Name: ‘http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name’
- Name format: ‘TXT’
- Data field: select the- Emailfield you created earlier. This attribute is now connected to the data field.
 

- Savethis attribute as well
You now have two attributes defined that you actually use in the interaction:

Step 7: preview
You have everything in place and can now preview your example. When you log in, or when you were already logged into your company network, you would get a form with your name, email address and the actual Azure AD response message.
Last updated
Was this helpful?
