Auteur de questions
How to get current logged in user in Provider hosted app with AppOnly permissions

Question
Toutes les réponses
-
Hi,
You could get current user by.
clientContext.Web.EnsureUser(HttpContext.Current.User.Identity.Name)
Best Regards,
Lee
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. -
-
Hi,
For AppOnly add-in, the app use app@sharepoint account, it works as service account per my knowledge.
- AllowAppOnlyPolicy executes code based on the permissions granted to the SharePoint Add-in, not on behalf of another user who has the appropriate permissions to perform an operation.
Best Regards,
Lee
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.- Proposé comme réponse Dennis GuoModerator lundi 16 juillet 2018 07:40
-
-
Hi,
This is by design action, you could try to specify the authentication directly.
ClientContext ctx = new ClientContext(siteUrl); NetworkCredential credentials = new NetworkCredential("user", "password", "domain"); ctx.Credentials = credentials;
Best Regards,
Lee
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. -
-
Hi,
It’s just workaround,if you need high permission other than current user, just use add-in only policy.
Best Regards,
Lee
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.