Boopesh
Boopesh

Reputation: 1

Not able to retrieve the AppOnly Access token in the new SharePoint Development Framework((SPFx)) App

We are creating a hybrid (SharePoint Add-In + Provider Hosted based API) App to display the data from the SharePoint List using custom API. To retrieve the data from the list, we need the Access Token so that query can be made in the user context, without Azure AD.

We are not able to retrieve the AppOnly Access token in the new SharePoint Development Framework((SPFx)) App.

We did the following:

1) We created a Custom API using provided hosted app to retrieve the data from SharePoint List using custom business logic.

2) We hosted the API in Azure and also registered the App in SharePoint.

3) We are trying to call the API through the Add-In created using the new SharePoint Development framework(SPFx).

We are able to retrieve the request digest Token. But we were not able to create the ClientContext in our API using this Request Digest Token. But we are not able to retrieve the Access Token through SharePoint Framework(SPFx).

Is there any way to generate the AppOnly Access Token without the use of Azure AD. It would be better if the AppOnly Access Token is generated using the Client ID and Client Secret.

Thanks In Advance.

Upvotes: 0

Views: 397

Answers (1)

Velin Georgiev
Velin Georgiev

Reputation: 2489

You can have a look at this examples for running with elevated privileges: https://github.com/SharePoint/sp-dev-fx-webparts/tree/master/samples/react-sp-elevatedprivileges

Probably this is related to what you are trying to achieve.

Upvotes: 0

Related Questions