I'm trying to connect to Azure Devops from within a Sharepoint web part.
I have added a couple of permission requests in package-solution.json:
"webApiPermissionRequests": [
{
"resource": "Windows Azure Active Directory",
"scope": "User.Read"
},
{
"resource": "Azure DevOps",
"scope": "user_impersonation"
},
{
"resource": "SharePoint Online Client Extensibility Web Application Principal",
"scope": "user_impersonation"
}
...
and use the AAD factory to call an Azure DevOps api, like so:
this.context.aadHttpClientFactory.getClient('499b84ac-1321-427f-aa17-267ca6975798').then((client: AadHttpClient) => {
client.get(`https://dev.azure.com/reinder0498/_apis/projects?api-version=6.0`, AadHttpClient.configurations.v1)
.then((response: HttpClientResponse) => {
console.log(response);
return response.json();
})
.then((projects: any): void => {
console.log(projects);
});
});
But then I get this error: "The user or administrator has not consented to use the application with ID '177c71fc-1022-4e3c-82cd-faa17d9864bf' named 'SharePoint Online Client Extensibility Web Application Principal'. Send an interactive authorization request for this user and resource."
I've looked at pending and approved requests in Sharepoint Admin center but could not see any requests coming in... What else do I have to do to use the aadHttpClientFactory to connect to Azure DevOps API's?
update
If I browse to that Sharepoint Online Client app in AAD, the button to grant admin consent is disabled: