Forum Discussion
dhaneksc
Oct 20, 2024Copper Contributor
ProjectWebApp REST API: OAuth Authentication - ClientCredentials Grant type only
Hi All,
We are trying to read the Project Information (Flow: SAP<--->SharePointOnline) using the ProjectWebApp(PWA) REST APIs : https://domainName/sites/pwa/_api/ProjectData/Projects
for which we have registered the App in Azure Portal and then given the required permissions.
we are able to read the project information using the OAuth Grant Type: Authorization Code, where user interacts with authorization server to get the access token. But with the GrantType : Client Credentials we are NOT able to read?
Since its Server-to-Server interaction, we do not want User Auhorization code to interact.
Let us know how can we access the PWA APIs with OAuth: Client Credentials GrantType?
When we try to access with GrantType : ClientCredentials after getting the access token, we get the below error.
Kindly provide documents that can guide us how to achieve the above requirement.
API : https://domainName/sites/pwa/_api/ProjectData/Projects
We have the below details after registering the app:
Toke URL to fetch the access token : https://login.microsoftonline.com/TenantID/tokens/OAuth/2
grant_type = client_credentials
client_id = ClientID@TenantID
client_secret = xxx
resource = resource/<domain-name>@TenantID
scope = https://localhost
Token Fetch: SuccessFull
API call: Error
Thanks
Sai
- fabionicidaCopper Contributor
We have the same requirements. I have been searching for a solution, but until now, I was not able to find it.
Does anyone have a solution?
Thank you!