Comments (4)
Thank you very much - I will get on all that!
from office-js-helpers.
So the issue here is that your Azure AD application has been set to redirect the user to a registered redirect_url
with the user's token. This is done for security reasons.
However in OfficeHelpers, for convenience, we auto set the redirect url to your current application's domain, in this case, https://mywebapp.azurewebsites.net. In order to solve this please copy the redirect_url
as is and use the advanced config as:
// set the redirect url by providing the config object.
authenticator.endpoints.registerMicrosoftAuth('client id here', {
redirectUrl: 'redirect url here'
});
As for your issues with the browser execution, I have already started work on a new variant of this where it should resolve the cross-origin frame issues. I have received some feedback and I am trying to rectify the code while remaining backwards compatible.
In the meantime you can try the beta version here: https://unpkg.com/@microsoft/[email protected]/dist/office.helpers.js
Please try it out and let me know..
from office-js-helpers.
Note that I have been using registerAzureADAuth, not registerMicrosoftAuth, as Exchange Online permissions cannot be set using the latter type of application AFAIK. I had tried using the redirectUrl parameter with registerAzureADAuth but it didn't work (perhaps because I also included the responseType: 'id_token' parameter and value, which I'm not sure is incorrect or not). Should I try again using registerAzureADAuth and just the redirectUrl parameter? Also, it's not clear to me what I should use as the url - the domain only or the add-in's page url? If it's not the add-in URL will it still try to redirect to the default page at the root?
from office-js-helpers.
Let me break this down into multiple replies.
what I should use as the url
Please use a url that you'd want your users to be redirected to after login. This can be the default page at the root or a custom page saying authenticated. The only significance of this is that on AzureAD you're telling to send the user with the token back to this page and on the Add-in, we are waiting for this page to appear in the popup so that we can know when to close it automatically.
No matter what you decide, both the redirectUrl property and the redirectUrl set on Azure must match for a successful authentication.
Note that I have been using registerAzureADAuth, not registerMicrosoftAuth
Doesn't make a difference as all helpers registerXAuth
use the same underlying code. So the overrides work consistently.
(perhaps because I also included the responseType: 'id_token' parameter and value, which I'm not sure is incorrect or not)
There's an active bug that I need to investigate (#54). Probably related to that.
Should I try again using registerAzureADAuth and just the redirectUrl parameter?
Yes please try that.
from office-js-helpers.
Related Issues (20)
- Google auth dialog showing "403 diallowed_useragent" HOT 1
- `plus.me` scope does not return email of user HOT 2
- OfficeHelpers.UI.notify has no background color in a React-based Office Add-in HOT 1
- office-js-helper with IdentityServer? HOT 1
- Double clicking the 'Allow' button on the dialog consent form in Word Online launches two dialogs HOT 1
- Office helpers gives undefined exception on Word 2016 HOT 3
- Storage.has(key) returns true even when the key actually doesn't exist.
- Missing any login dialog
- redirectUrl problem HOT 1
- Edge authentication popup doesn't close HOT 1
- IsAddin check fails in Browser, still returns true and uses Dialog framework HOT 3
- Authentication dialog not closing in Office Online on IE11(11.706.17134.0)
- Unable to delete 'AzureAD' from storage HOT 1
- redirect and automatically closing authentication dialog and token issue (MAC safari)
- Office Addin for Powerpoint : Dialog & authentication issue.
- Office Version 1907 / Windows 1903 - Authentication Redirect HOT 4
- feature request: Store token in OfficeRuntime.Storage HOT 1
- Authenticator: Make width and height of dialog window configurable
- State couldn't be verified
- displayDialogAsync does work in vanilla js but doesn't with react HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from office-js-helpers.