cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

This community is for technical, feature, configuration and deployment questions.
For production deployment issues, please contact the TAC! We will not comment or assist with your TAC case in these forums.
Please see How to Ask the Community for Help for other best practices.

2595
Views
10
Helpful
19
Replies
nspasov
Cisco Employee

ISE-2.6-Self Service/Password Change Portal Not Working

I was trying to get a Self-Service/Password Change portal based on the instructions provided in the thread below but I am not able to get it working:

https://community.cisco.com/t5/identity-services-engine-ise/ise-password-change-portal-ucp-with-my-devices-portal/td-p/3475680/page/2

  • I created the portal several times but the page after a successful login never loads. Instead, it just goes to a blank screen so I never get to see the "Change Password Screen" The URL that loads shows:https://192.168.40.106:8443/mydevicesportal/LoginSubmit.action?from=LOGIN
  • Removing the Javascript that hides the unnecessary pages "fixes" and the post-login page loads fine so perhaps the Javascript code does not work with ISE 2.6
  • I tried this with Chrome, Firefox and IE.
19 REPLIES 19

thanks we are looking into it

I am working on a new write-up in next few days on how to address this holistically

Jason have you been able to work on that write up to resolve this issue?

 


@javier437 wrote:

Jason have you been able to work on that write up to resolve this issue?


For now try this. I will working on fixing the updated portal as well

 

change password in sponsor portal

Here is the code for Change password customization in sponsor portal.
 
Can you please try the below script in the Sponsor portal customization --> Create Account for Known Guests --> Instructional Text
 
<script>
    var pwdBtnDisplayed = false;
    $(document).on('pageshow', function() {
        $('.cisco-navbar').remove();       
        $('.create-guest-type-step').remove();       
        $('.create-guest-info-step').hide();
        $('.create-access-info-step').hide();
        if(!pwdBtnDisplayed){
            for(var i=0; i<5 ; i++){
                $('.ui-listview').children()[0].remove();
            }
        }
        if(!pwdBtnDisplayed){
            $('.cisco-nav-content').append('<center><input onclick="changePasswordFn()" target="_self" type="button" value="Password Change"/></center>');
            pwdBtnDisplayed = true;
        }    
        window.addEventListener('resize', function(){
            if(window.innerWidth < 960){
                removeMedisqueryCSS();
            }
        });
    });
    function changePasswordFn (){
        location.href='#changePwd';
    }
 
    function removeMedisqueryCSS() {
        if (typeof window.CSSMediaRule !== "function") return false; //Your browser doesn't support media query feature
        var s = document.styleSheets,r, i, j, k;
 
        if (!s) return; //no style sheets found
        // walk throuth css sheets
        for (i = 0; i < s.length; i++) {
            // get all rules
            r = s[i].cssRules;
            if (!r) continue;
 
            for (j = 0; j < r.length; j++) {
                //If there's a rule for media query
                if (r[j] instanceof CSSMediaRule){
                    if((r[j].media.mediaText).indexOf("60em") < 0){
                        for (k = 0; k < r[j].cssRules.length; k++) {
                            r[j].deleteRule(r[j].cssRules[k]);
                        }
                    }
                }
            }
        }
    }
</script>

for my devices portal ISE 2.4

Enable Change password and disable Post-Login Banner Page and AUP from the settings. Try to add the below code in Optional Content 2 of the respective pages. In the below code, highlighted Portal id should be changed according to your portal.

 

Change Password page
=====================
<script>
    $('#ui_changepwd_submit_button').on('click', function(evt){
        sessionStorage.setItem('passwordChanged', true);
    });
 
    $(document).on('pageshow', function() {
        var logoutAction = '';
        $('a').each(function(){
            if($(this).attr('href').indexOf("Logout") !== -1){
                logoutAction = $(this).attr('href');
            }
        });
        $('a[href="HomePreLoad.action?from=MY_DEVICES_HOME"]').attr('href', logoutAction);
        var passwordChanged = sessionStorage.getItem('passwordChanged') == "true";
        if (passwordChanged) {
            alert('Password has been changed');
            sessionStorage.setItem('passwordChanged', false);
            var logoutUrl = $('[href="Logout.action?portal=582293e0-011a-11ea-88a9-e2ae93fcfd8a"]').attr('href');
            window.location = logoutUrl;
        };
    });
</script>
 
My Devices page
===============
<script>
    setTimeout(function(){
        $('.ui-panel-content-wrap').hide();
        $('.ui-link-inherit').first().click();
    }, 100);
</script>

ISE 2.6 code for my devices

Enable Change password and disable Post-Login Banner Page and AUP from the settings. Try to add the below code in Optional Content 2 of the respective pages. In the below code, highlighted Portal id should be changed according to your portal.

ISE version 2.6
 
Enable Change password and disable Post-Login Banner Page and AUP from the settings.
Try to add the below code in Optional Content 2 of the respective pages.
 
Login Page
============
<script>
    $(document).on('pageshow', function() {
        sessionStorage.setItem('passwordChanged', false);
    });
</script>
 
Change Password page
====================
<script>
    setTimeout(function(){
        sessionStorage.setItem('passwordChanged', false);
        $('#ui_changepwd_cancel_button').attr('href', 'javascript&colon;document.forms["logout"].submit()');
        $('#ui_changepwd_submit_button').on('click', function(evt){
            sessionStorage.setItem('passwordChanged', true);
        });
    }, 1000);
</script>
 
My Devices page
===============
<script>
    $(document).on('pageshow', function() {
        $('.ui-panel-content-wrap').hide();
        var passwordChanged = sessionStorage.getItem('passwordChanged') == "true";
         if (passwordChanged) {
             alert('Password has been changed');
             sessionStorage.setItem('passwordChanged', false);
            document.forms['logout'].submit();
        }
        else if (!passwordChanged){
            document.forms['changePasswordPreLoad'].submit();
        }
    });
</script>
 
 
To remove the dropdown/pulldown in the right side corner of the change password page, please use the below script in the Optional content 2 of Change Password page. This will be applicable for both 2.4 as well as 2.6 versions.
 
<script>
    setTimeout(function(){
                var deskUser = $(".cisco-desktop-header-menu-button").text();
                $(".cisco-desktop-header-menu-button").remove();
                $(".cisco-mobile-header-menu-button").remove();
                var infoiconDesc = $(".cisco-desktop-menu-button")[0].outerHTML
                $(".cisco-desktop-menu-button").replaceWith('<div class="ui-btn-right">'+deskUser+infoiconDesc+'</div>');
                $('.ui-btn-icon-notext .ui-btn-inner .ui-icon').css('margin','16px 1px 2px 3px');
    }, 1000);
</script>
elucatello
Beginner

I've used the API web app available on this thread and it's better then the BYOD workaround and it's also free. 

 

https://community.cisco.com/t5/identity-services-engine-ise/how-to-create-a-password-change-portal-ucp-on-ise-using-api/td-p/3926245

Create
Recognize Your Peers
Polls
Which of these topics should we host an event in the Community?

Top Choice: ISE Demo (100%)

Content for Community-Ad

ISE Webinars



Did you miss a previous ISE webinar?

CiscoISE YouTube Channel