You will have to have the user redirect back to the Office 365 site again to get a new refresh token. I had worked with MS on a project I was working on for my employer and they had indicated this to me. The unfortunate part is that the only real documentation that even says its 6 months is here: http://msdn.microsoft.com/en-us/library/jj687470.aspx. It ...
It depends heavily on your requirements and on the app type you are going to build (web application or just console daemon, azure function, etc.). Does it require user context or not?
Here are the options available:
Create Azure AD application, give required permissions to SharePoint and use node-adal library for OAuth (authorization code flow, client ...
Well as for me you can always register the app for the first time on one of the tenants, use the registration data in Azure and in .app file and then, when installing the app on other tenants instead of clicking on generate button in appregnew.aspx, simply paste the client id and client secret you have generated when installing the app for the first time. ...
Just regenerate the token.
Add the App For SharePoint nuget package to your console app.
Then write the code to generate the token and context object.
Uri siteUri = new Uri(siteUrl);
string realm = TokenHelper.GetRealmFromTargetUrl(siteUri); string accessToken = TokenHelper.GetAppOnlyAccessToken(TokenHelper....
I was finally able to figure out what I was doing wrong:
1) The Authorization Code returned when creating the OAuth connection is only good for that browser session. Thus why I couldn't reuse that authorization code later in back end services or in new browser sessions.
2) On the redirect page, I used the Authorization Code returned to create a new Access ...
Make Sure that you installed Office developer Tools and SharePoint Server 2013 Client Components SDK
We don't need any external Reference for the SharePointContext.cs and TokenHelper.cs files. Once we create the provider hosted app, they will come in the VS Web Project automatically.
If they are not present in the Provider hosted app Web ...
From a home/personal Office 365 stand point, yes it would be similar to any other internet service that if your password is compromised, then someone can get into your tenant.
However, any business that is using Office 365 is highly likely to be synchronizing objects from local Active Directory to SharePoint, and therefore you are using auth credentials ...
Having learned a fair bit about OAuth in Office 365 since I posted the question, I can now answer myself:
No, you cannot use OAuth without an app.
However, in on-premise solutions you can set up a High Trust server to communicate without having to use OAuth at all.
To solve this issue I had to edit the AppManifest.xml file under <AppPrincipal>
<!--<RemoteWebApplication ClientId="*" />-->
had the result that Visual Studio did not update the ClientID anymore when debugging. I changed it to
First of all now SharePoint Apps are changing to SharePoint Add-ins. See here.
And the answer to your question is to broad in context. We can just help you by providing the links.
SharePoint Add-ins are self-contained extensions of SharePoint websites that you create, and that run without custom code on the SharePoint server.
If you need to know about ...
As of this moment, access to SharePoint endpoint via Graph API is possible only through the beta endpoint.
Your URL should be as below:
Make a normal GET call to the above endpoint, the output would be as below:
Reference - Working with SharePoint sites in Microsoft Graph
To access ...
However, as often, there's a little maintenance problem: you ...
I have found answer on official MSDN documentation
How to: Replace an expiring client secret in an app for SharePoint
Client secrets for apps for SharePoint that are registered using the
AppRegNew.aspx page expire after one year. This article explains how
to add a new secret for the app.
A user must have the Manage Web site and Create Subsites permissions
to add an app for SharePoint. By default, these permissions are
available only to users who have the Full Control permission level or
who are in the site Owners group.
This (I believe) is because the installation ...
As per my understanding, you are asking about Single sign on (SSO)
and one way to achieve that is ADFS. Configure your Office 365 as ADFS authenticated, and configure web API authenticated mode to ADFS.
i have tested this in our MVC Application hosted in Azure and it is working as SSO.
To configure ADFS You can check below link
I got the issue resolved by using view state for the Context Token property
public string ContextToken
return ViewState["ContextToken"] != null ? Convert.ToString(ViewState["ContextToken"]) : String.Empty;
if (value != null)
I had this same issue. The import error is towards the bottom "EncodeProviderUserKey couldn't encode provider user key for input [originalIssuerType:'Unknown'] [originalIssuerIdentifier:'office:idp:forms:customizedmembershipprovider'] [providerUserKeyValue:'i:0#.f|customizedmembershipprovider|testusername']
First upgrade to August 2014 CU or higher
we can have the user login with their Office 365 credentials
No, until user hand them to you himself.
then get their original office 365 domain (xxxx.sharepoint.com)
returned or something similar?
Create a remote event receiver, so when an app is installed, it will return with host web URL, which can be done using an hidden app part (maybe) or somehow....
For those who are still looking for the answer - consider sp-request nodejs module.
It allows you to perform OAuth client credentials grant (in different terminilogy it's also called addin-only permissions or application only permissions).
For low-trust apps it uses AzureACS in order to obtain an access token, for high-trust apps (server 2 server ...
This was the exact problem I was facing. This is an old question but my answer might be helpful to someone else coming here.
It is possible to do OAuth from Node.js or any other web-app. Here are the step by step instructions in my blog -