none
Multiple login prompts after call logout page.

    질문

  • There are some cases that my Sharepoint 2013 farm application must force the user to logout.

    In order to logout the user, the app redirects the user to closeconnection page:

    ~/_layouts/15/closeConnection.aspx?loginasanotheruser=true

    This really log the user out, but also calls several login prompts.
    example of prompt

    Sometimes it prompts 11 times or 12 times the same login prompt.

    multiple prompts

    The application authenticate via AD so I have no idea why is this happening, since I don't have control over the prompt.

    2018년 7월 12일 목요일 오후 8:36

답변

  • I've found the problem!

    Another developer has put a webpart with an iframe in the homepage.
    For some reason this frame was hidden but was leading to another home page.
    This other page was requesting for login and because of a bug, it was showing the prompt multiple times.

    I've removed the webpart and now the login prompt is appearing two times, it's not perfect but will serve.

    2018년 7월 20일 금요일 오후 6:25

모든 응답

  • Hi,

    This is a expected behavior, the url "~/_layouts/15/closeConnection.aspx?loginanotheruser=true" is used to sign out current user and then switch to another user account, so it will promote for a new user credential.

    I understand that you may want to logout user after some time, if that is the case, please do like this, redirect user to the signout page:

    setTimeout(function(){
          window.location.href = _spPageContextInfo.webServerRelativeUrl + "/_layouts/signout.aspx";
    }, 1200000);

    Thanks

    Best Regards


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    2018년 7월 13일 금요일 오전 8:45
  • Hi Jerry,

    Thanks for reply.

    I understand that page return a prompt, but it is return eleven times or more!

    You can see in the image, each "accessdenied" line is a login prompt. The user must fill each prompt one by one until be authorized.

    You see, I cannot force the user to insert their credentials eleven times and I have no idea why this is happening.

    2018년 7월 13일 금요일 오후 1:53
  • Hi,

    I used the html hyperlink below and it only promote the window only once, reenter the credential and user will sign in which won't promote multiple times:

    <a href="javascript: (function(){if (typeof SP !== 'undefined') { var ctx = new SP.ClientContext.get_current(); var site = ctx.get_site(); ctx.load(site, 'Url'); ctx.executeQueryAsync(Function.createDelegate(this, function (sender, args) { var url = site.get_url(); window.location = url + '/_layouts/closeConnection.aspx?loginasanotheruser=true'; }), Function.createDelegate(this, function (sender, args) { alert('Error: ' + args.get_message()); })); } else { alert('Error: This is not a SharePoint 2010 or 2013 website'); }})();">SP Loginout</a>

    You could try this in your side and more information about using closeConnection page:

    How to Sign in as a Different User in SharePoint 2013

    Thanks

    Best Regards


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    2018년 7월 16일 월요일 오전 10:33
  • Hi Jerry.

    Unfortunately I'm stiil getting the same problem.
    I don't think this is a code issue.
    Probably it is related with some server config or with the application.

    I've tested this code in another application and worked fine.

    As aways thank you so much.

    2018년 7월 17일 화요일 오후 2:54
  • Hi,

    You could compare the server configuration between the two application to see if there is some difference between them and then fix it.

    Thanks

    Best Regards


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    2018년 7월 18일 수요일 오전 2:06
  • Yeah, that's what I'm doing right now.

    Thanks a lot.

    2018년 7월 18일 수요일 오후 12:36
  • Hi,

    Never mind and if there is any updates, please post back and share with us.

    Thanks

    Best Regards


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    2018년 7월 19일 목요일 오전 1:57
  • I've found the problem!

    Another developer has put a webpart with an iframe in the homepage.
    For some reason this frame was hidden but was leading to another home page.
    This other page was requesting for login and because of a bug, it was showing the prompt multiple times.

    I've removed the webpart and now the login prompt is appearing two times, it's not perfect but will serve.

    2018년 7월 20일 금요일 오후 6:25