https://company.com/sites/test
then it will redirect me to a login page where I can input the username
and password
provided. And also, when I'm successfully logged in, when I hit https://company.com/sites/test/_api/lists
I will return some data in xml. BTW, this is On-Prem
also.
for troubleshooting can suggest this https://github.com/koltyakov/node-sp-auth-troubleshoot
you could try different options quickly and see if any works
for on-prem could be:
The page there you were redirected, what does it contain in the URL? E.g. is there /adfs/ls in the url?
var fileOptions = {
folder: 'Test',
fileName: 'file.txt',
fileContent: 'hello world'
};
spsave(coreOptions, creds, fileOptions)
.then(function(){
console.log('saved');
})
.catch(function(err){
console.log(err);
});
Hi @Babelfish112_twitter,
No permissions usually means "no permissions".
In SPO and when you know you have permissions, e.g. is admin, it's also can be a result of disabled custom scripts.
This is a good article on the topic how to enable custom scripts: https://www.koskila.net/how-to-enable-custom-scripts-for-a-sharepoint-online-site-collection/
Or using M365Cli: spo site classic set --url https://<company>.sharepoint.com/sites/<site> --noScriptSite false
Another thing which might be is than you're providing siteUrl with a wrong path not to the SPWeb but folder.
As for the URL, I am a bit confused what I am meant to use.
In SP, I am browsing the folder and the URL in the browser is https://<company>.sharepoint.com/sites/<team folder>/Shared%20Documents/Forms/AllItems.aspx?newTargetListUrl=<LONG HTML-formatted STRING!>
https://contoso.sharepoint.com/sites/a-site
<- valid, https://contoso.sharepoint.com/sites/a-site/folder-path
<- invalid${siteUrl}/_api/...
and won't be correct with a folder placed in there. The folder path should be in "folder" prop in fileOptions.
spr.requestDigest
or spr.post
have problem connecting to SP? await spr.requestDigest(baseUrl)
.then(async (digest) => {
const header = {
'X-RequestDigest': digest,
'Accept': 'application/json;odata=verbose',
'Content-Type': 'application/json;odata=verbose',
};
return spr.post(`${baseUrl}${itemsPath}`, {
json: true,
body: item,
headers: header
});
})
.then(res => {
console.log('Successfully inserted in Sharepoint!');
spItems.push(element);
}, err => {
if (err.statusCode === 404) {
console.log('Not found!');
} else {
console.log('error');
}
});
@cardinalpipkin this "create an item which calls a workflow/flow" is actually an example =)
Well ok, let me elaborate:
Is it possible to get user photos
from the graph without having my SPFX web part needing to be authorised by admin? I guess I need clarification on this:
By default, the service principal has no explicit permissions granted to access the Microsoft Graph. However, if you request an access token for the Microsoft Graph, you get a token with the user_impersonation permission scope that can be used for reading information about the users (that is, User.Read.All).
Source: https://docs.microsoft.com/en-us/sharepoint/dev/spfx/use-msgraph#available-permission-scopes
The problem I have is that I'm working with an NHS (Health Service) client in the UK - they use the government's Hybrid 365 offering, which melds NHS Mail with Office 365. The central administration / azure stuff is all handled by Accenture, so I don't have easy access to any of that. Its possible to apply via their desk to have something approved but its such a pain and if there's a way to avoid it I'm all ears...
All I want are profile photos. I am finding /_layouts/15/userphoto.aspx?size=L&username=workemailhere
a bit unreliable. https://outlook.office365.com/owa/service.svc/s/GetPersonaPhoto?email=workemailhere
works - but I'm finding that if users haven't opened Outlook OWA in addition to SharePoint - the images don't necessarily load. Same thing with Delve.
Any help most appreciated!
Hi Team. I'm having a problem when trying to retrieve information from a list on sharepoint. The following code was working correctly before, and works on my colleague's machine.
async function getUserIDs (sprequest,spInfo) {
const credentialOptions = {
username: spInfo.sp_user,
password: spInfo.sp_password
}
const spr = sprequest.create(credentialOptions)
const tableInfo = 'GetByTitle(\'delimitados_qas\')//items?'
const selectParams = `U_ID,Title,Subinfotipo`
return await spr.get(spInfo.sp_url + tableInfo + selectParams)
}
I'm using the correct credentials, but i'm receiving this error:
Error: <s:Fault>
<s:Code>
<s:Value>s:Sender</s:Value>
<s:Subcode>
<s:Value xmlns:a="http://docs.oasis-open.org/ws-sx/ws-trust/200512">a:FailedAuthentication</s:Value>
</s:Subcode>
</s:Code>
<s:Reason>
<s:Text xml:lang="en-US">MSIS7068: Access denied.</s:Text>
</s:Reason>
<s:Detail>
<IssuanceAuthorizationFault xmlns="http://schemas.microsoft.com/ws/2009/12/identityserver/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"/>
</s:Detail>
</s:Fault>
at c:\Users\flor_active_msg\node_modules\node-sp-auth\lib\src\utils\AdfsHelper.js:32:23