You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
try to get SharePoint lists in Teams Blazor App
var listex = await graphClient.Sites["root"]
.Lists
.Request()
.GetAsync();
shows empty result.
my guess missing scopes. So gave in azure portal read.write and changed
xport async function getToken() {
var credential = new TeamsUserCredential();
var scope = ["User.Read", "Sites.Read.All", "Sites.ReadWrite.All"];
console.log("xxxxx");
var token = credential.getToken(scope);
return token;
}
export async function popupLoginPage() {
var credential = new TeamsUserCredential();
var scope = ["User.Read","Sites.Read.All","Sites.ReadWrite.All"];
await credential.login(scope);
return;
}
doenst solve my problem
The text was updated successfully, but these errors were encountered:
Hi @hannespreishuber, here is the suggestion from mine and it may help you find the reason, since we only got JavaScript version of microsoft/teamsfx sdk, so we including webpack to wrapper it and using JSRuntime to trigger it in Blazor.
These code you paste it is in JS/src/index.js, this is the webpack src code, have you using webpack to refresh the webpack file (wwwroot/teamsfx.js)? JSRuntime using wwwroot/teamsfx.js to trigger sdk.
Thanks @hannespreishuber for the feedback, you can follow Kai's instruction to try it again. Since this thread has no more new information for over 7 days, I will close it. If you still meet with this issue, feel free to reactive it.
try to get SharePoint lists in Teams Blazor App
var listex = await graphClient.Sites["root"]
.Lists
.Request()
.GetAsync();
shows empty result.
my guess missing scopes. So gave in azure portal read.write and changed
xport async function getToken() {
var credential = new TeamsUserCredential();
var scope = ["User.Read", "Sites.Read.All", "Sites.ReadWrite.All"];
console.log("xxxxx");
var token = credential.getToken(scope);
return token;
}
export async function popupLoginPage() {
var credential = new TeamsUserCredential();
var scope = ["User.Read","Sites.Read.All","Sites.ReadWrite.All"];
await credential.login(scope);
return;
}
doenst solve my problem
The text was updated successfully, but these errors were encountered: