Closed CameronDwyer closed 2 months ago
Thanks for the sample request @CameronDwyer. Let me tag @samantharamon to help answer.
Hi @CameronDwyer,
Thanks for bringing this to our attention. We'll be working on updating any documentation that mentions REST. I've added your sample request to our list and will let you know once the sample is available.
Thank you for your patience, @CameronDwyer. We're still looking into providing an alternative approach to using a REST token, but I wanted to provide an update on the decommission as a whole. Please be advised that active add-ins that use the REST service will be granted an exemption to keep using the service until extended support ends for Outlook 2019 on October 14, 2025. This includes new add-ins that are developed after the decommission date in November. This update was announced in this month's Office Add-ins community call (we're currently updating Use the Outlook REST APIs from an Outlook add-in with this update). Additional questions raised by the community during the call will be answered in a blog post and a link will be posted to Microsoft Office Add-ins community call, so watch out for that, too.
According to this recent announcement legacy Exchange tokens will stop working in October 2024, the article explicitly states that getCallbackTokenAsync will not work and the article also states that this will affect all add-ins with no method for exemption. https://learn.microsoft.com/en-us/office/dev/add-ins/outlook/faq-nested-app-auth-outlook-legacy-tokens#october-2024
If these articles are correct, then we will have no way of calling Office.context.mailbox.item.getSharedPropertiesAsync which effectively deprecates this method with no replacement. Please delay the deprecation of the legacy Exchange tokens until you provide an alternate way of calling getSharedPropertiesAsync.
Hi @CameronDwyer, thanks for letting us know about this gap in functionality with Microsoft Graph. We definitely need to track this, and any other gaps folks find, so please let us know so we can explore workarounds or updates. We understand that this is definitely an aggressive timeline, but due to the security concerns around Exchange tokens we need to move forward with the October 2024 date. We are tracking conversations about moving off Exchange tokens to NAA in the office-js repo so I'm moving this issue over, and will put in the title "NAA" which helps us prioritize and track these issues. Please check in on the monthly community call and watch the Microsoft 365 blog for updates and guidance. Thank you, David and Office platform team.
Is there any update on this? As we move to NAA and attempt to prepare for this deprecation in October, these things need to be made available now so we can implement and be testing.
Same here, we are using getCallbackTokenAsync
along with getSharedPropertiesAsync
to make our add-in work with shared mailboxes. Could you please provide us with an update on this?
@CameronDwyer @cody-lettau just to clarify this question. you DONT need to call getCallbackTokenAsync to get getSharedPropertiesAsync .. i hope that's clear. you need to call it only if you plan to do an action on behalf of the owner of such folder (provided the user has permissions). For this there is a graph alternative that we might need to fwd to.
so @samantharamon i think thats what we need to do with this article, split to learn if an item belongs to a shared folder/mailbox and another one on how do it with NAA + Graph API.
@cody-lettau i think your scenario in this case is only know if an item is in a shared folder, right?
@Yhuley can you share more on your scenario? why do you need the token?
thanks all! good convo!
Thanks for the clarity @JuaneloJuanelo, that makes sense and removes the concern I had with getSharedPropertiesAsync being dependent on the Exchange Token.
@JuaneloJuanelo thank you for your explanation! I'm using token to pass it to getSharedPropertiesAsync
asyncContext
param so I can get shared properties like targetMailbox
. Here's my code snippet:
const [originalUserEmail, setOriginalUserEmail] = useState<string | null>(null);
const [sharedProperties, setSharedProperties] = useState<Office.SharedProperties | null>(null);
const getSharedMailboxInfo = () => {
Office.context.mailbox.getCallbackTokenAsync(
{
isRest: true,
},
({ value, status }) => {
if (status === Office.AsyncResultStatus.Succeeded && value !== '') {
Office.context.mailbox.item.getSharedPropertiesAsync(
{
asyncContext: value,
},
(sharedPropertiesResponse) => {
if (sharedPropertiesResponse.status === Office.AsyncResultStatus.Succeeded) {
setSharedProperties(sharedPropertiesResponse.value);
// We need to save original user email since it's not accessible
// via Office.context.mailbox.userProfile.emailAddress === the shared mailbox email address
const { smtp } = jwtDecode<{ smtp: string }>(sharedPropertiesResponse.asyncContext);
setOriginalUserEmail(smtp);
}
},
);
}
},
);
};
This function is based on this example. Are you saying that I can call getSharedPropertiesAsync
without getCallbackTokenAsync
?
@Yhuley yes absolutely, that's exactly right you DONT need to call getCallBackTokenAsync to use getSharedPropertiesAsync. please try it ;)
btw there is a code sample :)
function get() {
if (!Office.context.mailbox.item.getSharedPropertiesAsync) {
console.error("Try this sample on an item from a shared folder.");
return;
}
Office.context.mailbox.item.getSharedPropertiesAsync(function(result) {
console.log(result.value);
});
}
@JuaneloJuanelo Thank you for your answer! I have the following question. Will the NAA allow the use of broker authentication? I mean specifically the Microsoft Authenticator
app? The documentation mentions “adding trusted brokers”, but I'm not sure if that means authenticating through the Microsoft Authenticator app.
Hi @Yhuley, Microsoft Authenticator isn't a part of "trusted brokers" in the NAA sense. But yes, it will work with NAA. Please let us know if you are seeing any issues there. Thanks!
Hi @davidchesnut, thanks for the clarification! I haven't had a chance to test my Outlook add-in on mobile yet. So I don't have any comments. I'd like to clarify one thing. Is the code in this sample enough for the add-in to use the Microsoft Authenticator app or do I need to make some changes?
Is there any update on this? We use getSharedPropertiesAsync to get permission to check the add-in have the right permission also with target mailbox and perform some action on... So we still need a way to call it..
@ttuyen1529 this specific discussion is about the getSharedPropertiesAsync aspect of the shared folders/mailboxes and how it DOES NOT require to get a token to get the folder metadata that means you can get the permissions and the target mailbox as well. The second aspect if performing an action, thats a separate discussion and i recommend you open a separate ticket for that to avoid confusion.
The example code on shared mailbox scenarios uses the deprecated getCallbackTokenAsync approach to obtain a REST token to be able then call getSharedPropertiesAsync. https://devblogs.microsoft.com/microsoft365dev/outlook-rest-api-v2-0-deprecation-notice/
Please show supported example of how to call getSharedPropertiesAsync without using a REST token obtained via getCallbackTokenAsync.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.