Creating a Single Sign On Resource Manually

When creating Single Sign On Resources, it may be easiest to first see if there is already a template available for the web site you want to log on to.

If there isn't, the next easiest thing to try is by using the form detection feature of the SSO Browser Extension.

However, the extension is not always able to detect the form correctly. In these cases you would then have to look at creating your resource manually.

This article guides you through an example of setting up access to such a website, www.cloudynights.com.

 

Step 1: Creating the Single Sign On resource 

Whilst on the home page of the site, make a note of the URL, which here is http://www.cloudynights.com/page/index.html

 

Click Sign In at the top right, a popup appears. Right click and select View Source.

Search the source code for the field names, Login ID and Password.

 

We find that the name and id of the input fields are ips_username and ips_password respectively.

On your Hypersocket SSO server GUI, navigate to Single Sign On and Create a new resource.

Give the new resource a name.
The Logon URL will be the address noted above, so enter: http://www.cloudynights.com/page/index.html

For Match Selectors, it can be a good practice to tell the SSO Extension to look for some other unique item on the page so that we know for sure this is the correct site. An example of when not doing this could cause problems is when a site uses a third party logon, such as facebook for example.

 

On the home page, we have the Sign In link at top right, so looking at the source, we see that this link has an id of sign_in. Let's use that.
Click the plus icon next to Match Selectors and type in #sign_in.

 

 

In the left hand field, enter #ips_username. On the right put in an attribute that we will create soon, call it ${cloudynightsUsername}

Add another field and enter #ips_password and ${cloudynightsPassword}.

Note: If a field does not have an id, you can also refer to a field by name. In our example here when looking at the source, the field name attributes were set to the same as the id, so we could have used input[name="ips_username"] in the left hand selector fields too.

 

 

Now click the Workflow tab, here we define what actions we have to do to get to the login page, then perform the logon.
When signing in manually for this site, we have to click the Sign In link, then enter our username and password, followed by clicking the Sign In button.

Click the plus icon to create the first action. Select the Click action, and type in #sign_in which was the id for the Sign In link.

Click the plus again. It's generally a good idea to put in a small delay. As this login appears over the top of the homepage, we want to ensure it has fully loaded before we attempt to interact with it.
Set the Action to Wait with a value of 500 (which is in milliseconds).

Add another Action, this is the point where we are ready to tell the SSO extension that it can fill out the form using the fields we defined on the Form page.
Set the Action to Set Form and leave the text area blank as this requires no arguments.


Some forms change the status of their logon button after you have typed in fields. This site does not, but anyway let's set another 500ms Wait for the next Action as it's good practice.

 

 

Add a final action. Look again at the source of the login page and find the login form element. We see here that it has an id of login.
set the action to Submit with a value of #login.

 

Finally navigate to the Roles tab and add which Roles you want to be able to access this resource.

Click Create at the bottom to create the resource.

 

Step 2: Creating Profile Attributes

We need to set up attributes for the username and password.

Navigate to Access Control -> Profile Attributes. If there is no Custom Category existing for this type of site, create one. Navigate to Custom Categories and create a category name, in this example we'll create one called Astronomy.

 

 

Navigate to Custom Attributes and click Create.
Give it a name of Cloudy Nights Username and set the Category to Astronomy.

Set the Type to Text, set the Variable Name to the one we set above in the resource, so type in cloudynightsUsername.

Leave the Default Value blank, but a description is required. Type in Your Cloudy Nights Username.

We will leave everything in Options as default, so click on Roles and assign this attribute to the same roles set in the previously created resource.

 

Click Create to finish.

To finish, create another attribute. This time it will have a variable name of cloudynightsPassword, but the Type should be set to Password.

 

 

Step 3: Testing the resource

First, ensure the user that you are testing with has set their username and password attributes. This can be done from the Web GUI by navigating to My Profile, then clicking on the Astronomy tab.

Another way of getting to this page is by clicking on the SSO Extension icon in the browser and choosing Go To My Account.

 

 

Once the attributes have been set, the user can launch the resource. Click on the SSO Extension, then select My Sites and launch the Resource.

 

 

You will see that the web site's homepage will appear, the logon window will automatically come up which will then have the user and password filled out and submitted automatically.

 

Have more questions? Submit a request

Comments