none
Redirecting user to login page in task pane app RRS feed

  • Question

  • We are trying to use OAuth to allow users to login into salesforce. To do this we have to redirect the user to a login page where he can enter his credentials. Currently I tried doing this by setting window.location.href to the required url. however this opens the page in a new browser window NOT the existing task pane app in excel. Is there anyway to get around this? Or should I create a new html page in the app and load the required login page using an iframe?

    thanks

    Monday, July 7, 2014 5:40 AM

Answers

  • Hi,

    By default, if your app attempts to navigate to a URL in a domain other than the domain that hosts the start page of your app (as specified in the SourceLocation element of the app's manifest file), that URL will open in a new browser window outside of the Office host application's app pane. This default behavior protects the user against unexpected page navigation within the app pane from embedded iframe elements.

    To override this behavior, you need to specify each domain you want to open in the app window in the list of domains specified within the AppDomains element of your app's manifest file. If the app attempts to navigate to a URL in a domain that isn't in the list, that URL will open in a new browser window (outside of the app pane).( refer to How to: Navigate to more than one domain within the same app pane)

    You may also be interest in article below:
    Addressing same-origin policy limitations in apps for Office

    Best regards

    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by apttusdevteam Wednesday, July 9, 2014 7:09 AM
    Tuesday, July 8, 2014 9:11 AM
    Moderator

All replies

  • even loading the login page in an iframe doesn't work because the login page does not allow itself to be loaded in an iframe for security reasons.
    Monday, July 7, 2014 5:57 AM
  • Hi,

    By default, if your app attempts to navigate to a URL in a domain other than the domain that hosts the start page of your app (as specified in the SourceLocation element of the app's manifest file), that URL will open in a new browser window outside of the Office host application's app pane. This default behavior protects the user against unexpected page navigation within the app pane from embedded iframe elements.

    To override this behavior, you need to specify each domain you want to open in the app window in the list of domains specified within the AppDomains element of your app's manifest file. If the app attempts to navigate to a URL in a domain that isn't in the list, that URL will open in a new browser window (outside of the app pane).( refer to How to: Navigate to more than one domain within the same app pane)

    You may also be interest in article below:
    Addressing same-origin policy limitations in apps for Office

    Best regards

    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by apttusdevteam Wednesday, July 9, 2014 7:09 AM
    Tuesday, July 8, 2014 9:11 AM
    Moderator
  • Hi,

    Did you ever get this to work within Excel Online?
    We are facing similar issues and I was wondering if this is possible. According to the article Fei posted - it should be.

    Thanks

    Friday, October 31, 2014 7:11 AM