Forum Discussion
Passing username to an external rest-service from SPFx WebPart
"It's not easy stuff" ... eactly
Looked into what you wrote, and think I understand it (more or less)
I think my problem remains that the user is already logged in into SharePoint (on-premise) and don't want him to have an account somewhere else (google, facebook) and/or ask him (the user) to re-submit his username/password (so that my API could verify it) .....
Still some research to do .....
Please, keep us posted if you find a solution, as is a very interesting scenario.
Good luck!
- valentinbApr 16, 2019Copper Contributor
May be someone could help me there : https://social.msdn.microsoft.com/Forums/en-US/a5bb4435-ff29-447a-b5dc-86d3d75c7ca4/best-way-to-connect-external-api-with-a-webpart-for-sharepoint-online?forum=architecturegeneral#a5bb4435-ff29-447a-b5dc-86d3d75c7ca4
- Butch MarshallMar 31, 2019Copper Contributor
Danny Foncke Yep!
I use a https://docs.microsoft.com/en-us/graph/auth-overview.
I https://jwt.io/ is genuine using the https://login.microsoftonline.com/common/discovery/keys and thus can trust that is the logged in user.
- Danny FonckeMar 31, 2019Copper Contributor
Hi butch, have you ever found an answer to the question (user already logged in to SharePoint.....) ?
- Luis MañezApr 17, 2018MVPRecently the SharePoint spfx team has released a new Azure AD Http Client that helps to call Azure AD Secured APIs from spfx. Have a look here:
https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/guidance/connect-to-api-secured-with-aad
https://www.youtube.com/watch?v=_9fGXZ4ocp4&index=3&t=0s&list=PLR9nK3mnD-OUnJytlXlO84fQnYt50iTmS
Luis. - Butch MarshallApr 10, 2018Copper Contributor
Any update on this? I am also looking to implement using Sharepoint authentication against an external API without having any input from the user.
The closes I've found is using HttpClient to pass credentials as described https://dev.office.com/blogs/calling-external-apis-securely-from-sharepoint-framework. I've hit a blocker unfortunately. The Authorisation header is there - but its empty!