on 04-11-2018 01:25 PM
The following is used to setup a self-registration form with a checkbox so that a user can signup for a newsletter.
ISE is not able to process this information or send it off to another service as part of the Guest process. An administrator may have ISE send syslog to another system with the guest registration information and run some script to utilize this information. This information is also available in the Guest Reports. This is outside the scope of ISE support and won't be covered.
In this setup we show you how you would setup the guest portal for the collection of the newsletter subsciption.
Please reference the following document on the basics working with javascript
How To: ISE Web Portal Customization Options
The following was configured on ISE 2.4 system but should work on other releases as well.
Navigate to Work Centers > Guest Access > Settings > Custom Fields
Navigate to Portals & Components > Guest Portals > pick your self-registration portal:
Navigate to Portal Page Customization
Note: This has to been done on all languages you are using for your guests
<script>
$('[id="guestUser.fieldValues.ui_newsletter_text"]').parent().removeAttr('class');var checkboxVar = $('[id="guestUser.fieldValues.ui_newsletter_text"]');
checkboxVar.removeAttr('class');
checkboxVar.attr('type', 'checkbox');
checkboxVar.prop('checked', true);
checkboxVar.val('yes');
checkboxVar.on('change', function(){
if (checkboxVar.prop('checked') == true) {
checkboxVar.val('yes');
}
else {
checkboxVar.val('no');
}
})
</script>
Guest portals only run on the PSN persona. In order to know which PSN you're using you will need to validate using the portal test URL. Note if you are using a standalone setup where admin, monitoring and policy are all on one box then you can skip this step.
In order for you to see the guest account info in the logs (this would be similiar to looking at the syslog output from the system) you need either send it to an external syslog, download the debug logs, look at the reports or query via the API
Note: this needs to be done on every PSN where guests will self-register
This would be utilized if you have the syslog sent to external logging server listening for specific events. When a new guest is received on that system you could take the values and enter them into your own tracking system. This way you would only see new guests coming in. If you're using the API info later on you would need to do some more work on how to process the information.
Navigate to Administration > System > Logging > Logging Categories
Note: This only needs to be done on one PSN because you're validating that its working in the logs.
Also make sure to turn this off after testing, its not recommended to leave running if not needed.
Navigate to Administration > System > Logging > Debug Log Configuration
Return to your Guest Portal
Navigate to Operation > Troubleshoot > Download Logs
The output you're looking for contains the newsletter variable
[SelfRegTranConfig] valueMap={ui_company=, ui_email_address=, ui_first_name=, ui_last_name=, ui_location=San Jose, ui_newsletter_text=yes, ui_person_visited=, ui_phone_number=, ui_reason_visit=, ui_sms_provider=Global Default, ui_user_name=}
This same information would be seen when sent to an external logging system. On this system you could have a
Don't forget to return log level to INFO as its not needed!
As another option you can run a script that will query the API all your guest accounts every night or every week. This script could find all the guests and then populate your external database that tracks your membership and newsletter.
This would run on a system you have running like a tools server.
ISE Guest Sponsor API Tips & Tricks
Using poster for Firefox or Chrome
Get all guest SDK information
https://YOURPSNIP:9060/ers/sdk#Get-All
Setup the following fields Using configuration from the SDK
Click GET!
This outputs a list of guest accounts. You can then grab the href of one of the guests and you will utilize that to do another query.
Query a specific guest account for the custom field
Keeping everything the same as before except for the URL, paste in the href from before
Example: https://YOURPSNIP:9060/ers/config/guestuser/8de63350-3e80-11e8-96d2-268c6df71567
The output is a list of the specific guest information, notice the custom field highlighted.
AS of April 2018 there is no way to do a filter on guest accounts with custom fields.
Please contact our ISE product management team through sales channel for this enhancement CSCvi97592 - ISE guest getuser API call unable to filter on custom fields
Using this information you can get a list of users that want the newsletter. How often you run this would depend on how often your guest expires and how often they are purged from your database. This method is more difficult then sending information off to a syslog server as you will likely need to track, build and compare the data.
curl --insecure --user apiuser:userpassword --header 'Content-Type: application/json' --header 'Accept: application/json' https://npf-sjca-pap01.cisco.com:9060/ers/config/guestuser
The output contains the following:
{
"SearchResult" : {
"total" : 20,
"resources" : [ {
"id" : "8de63350-3e80-11e8-96d2-268c6df71567",
"name" : "0icf",
"link" : {
"rel" : "self",
"href" : "https://npf-sjca-pap01.cisco.com:9060/ers/config/guestuser/8de63350-3e80-11e8-96d2-268c6df71567",
"type" : "application/xml"
}
curl --user apiuser:userpassword --header 'Accept: application/json' https://npf-sjca-pap01.cisco.com:9060/ers/config/guestuser | grep href | awk '{FS="\""}{print $4}'
https://npf-sjca-pap01.cisco.com:9060/ers/config/guestuser/7be6a1b0-3e78-11e8-96d2-268c6df71567
....
Here we call just 1 request to get information about that specific guest
curl --insecure --user apiuser:userpassword --header 'Content-Type: application/json' --header 'Accept: application/json' https://npf-sjca-pap01.cisco.com:9060/ers/config/guestuser/7be6a1b0-3e78-11e8-96d2-268c6df71567
Here is the output reduced with only the newsletter label
},
"customFields" : {
"ui_newsletter_text_label" : "TRUE"
}
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: