none
Redirecting to a different page from a Dialog API in the Outlook Client will not load RRS feed

  • Question

  • As part of our <g class="gr_ gr_19 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="19" id="19">oauth</g> process in our Outlook add-in, we are launching a dialog API using the method described in the Dialog API Docs.

    The dialog correctly loads our page within the same domain of our application. The problem occurs when we try to redirect from that page to our login page. When we try to redirect to our login page, the page does not load.

    The only way our redirected page will load is if we wait 3 seconds before performing the redirect. Would anyone know what could be causing this behavior?


    • Edited by AdamHickey Thursday, July 27, 2017 3:34 PM
    Thursday, July 27, 2017 3:33 PM

All replies

  • Hello Adam,

    The forum is for Outlook specific issues/questions. So, I'd suggest posting this to the Developing Apps for Office 2013  forum instead. 


    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    Thursday, July 27, 2017 3:55 PM
  • Will do, thank you.
    Thursday, July 27, 2017 4:27 PM
  • Hi AdamHickey,

    you had mentioned that ,"The problem occurs when we try to redirect from that page to our login page."

    did you get any error when it not get load?

    other thing you had mentioned that,"The only way our redirected page will load is if we wait 3 seconds before performing the redirect"

    did you code perform any operation with in these 3 seconds?

    if possible then try to post your code and detailed steps to reproduce the issue.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, July 28, 2017 3:21 AM
    Moderator
  • Hi Deepak, I do not see any errors on load because this only happens when using the Outlook client. The only debugger I'm aware of is F12Chooser which requires windows 10 and I'm on windows 7.

    My front-end is an Angular 2 application and I am redirecting in the OnInit lifecycle hook. This is the code I am calling on load.  

      private clickLinkWithTimer(seconds: number) {
        let milliseconds = seconds * 1000;
        let timer = Observable.timer(milliseconds, 1000);
        let subscription = timer.subscribe(t => {
          this.window.location.replace(this.url);
          subscription.unsubscribe();
        });
      }

    I know the URL has a valid value as I can see the successful request being made in fiddler. Sometimes the redirected page loads correctly and other times the page does not load.



    • Edited by AdamHickey Friday, July 28, 2017 4:36 PM
    Friday, July 28, 2017 4:35 PM
  • Hi AdamHickey,

    you said that,"Sometimes the redirected page loads correctly and other times the page does not load."

    can you try to run the code from visual studio and try to debug the code?

    so that you can get some message regarding issue.

    you can try to find in which circumstances it loads the page correctly and when error occurs.

    it will helps you to understand the issue and solve the issue.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, July 31, 2017 5:49 AM
    Moderator
  • I'm not changing the code between runs, so when I say "sometimes it loads" it probably has something to do with a timing issue. I can reproduce the problem using the default add-in code so I am still investigating.
    • Edited by AdamHickey Tuesday, August 1, 2017 2:53 PM
    Tuesday, August 1, 2017 2:50 PM
  • Hi AdamHickey,

    so if the timing cause this issue then as I can see in your code.

    you can try to avoid the issue by waiting the 3 seconds.

    there is no any other way mentioned in documentation to solve this issue.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, August 2, 2017 6:51 AM
    Moderator