SOLVED

Workbench test of isolated SPFx with Graph permissions

%3CLINGO-SUB%20id%3D%22lingo-sub-1976958%22%20slang%3D%22en-US%22%3EWorkbench%20test%20of%20isolated%20SPFx%20with%20Graph%20permissions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1976958%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20building%20an%20isolated%20SPFx%20Client%20Side%20Web%20Part%20that%20uses%20an%20aadHttpRequest%20to%20write%20events%20to%20a%20user's%20calendar.%20For%20this%20I%20need%20Calendars.ReadWrite%20delegated%20permissions.%3C%2FP%3E%3CP%3EMy%20issue%3A%20when%20I%20test%20in%20the%20online%20workbench%2C%20I%20get%20a%20403%20error.%20I%20suppose%20this%20is%20because%20the%20Web%20Part%20hasn't%20been%20deployed%20yet%2C%20and%20the%20application%20registration%20with%20those%20permissions%20doesn't%20exist%20yet.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHow%20can%20I%20address%20this%20chicken%20%26amp%3B%20egg%20issue%2C%20and%20test%20my%20Web%20Part%20before%20deploying%20it%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1976958%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20Active%20Directory%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMicrosoft%20Graph%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESPFx%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1995843%22%20slang%3D%22en-US%22%3ERe%3A%20Workbench%20test%20of%20isolated%20SPFx%20with%20Graph%20permissions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1995843%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F29417%22%20target%3D%22_blank%22%3E%40Christophe%20Humbert%3C%2FA%3EWell%2C%20you%20have%20to%20have%20global%20admin%2C%20so%20if%20you%20don't%2C%20you%20might%20be%20stuck.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20you%20do%2C%20though%2C%20then%20you%20could%20try%20to%20upload%20this%20incomplete%20version%20of%20the%20program%2C%20which%20will%20create%20the%20request%20for%20permission.%20Then%20grant%20the%20permissions%2C%20and%20delete%20your%20package%20from%20sharepoint.%20The%20permission%20request%20appears%20very%20simplistic%20in%20the%20admin%20console.%20It%20is%20my%20impression%20that%20as%20long%20as%20you%20keep%20the%20same%20ids%20and%20package%20names%20through%20the%20course%20of%20development%2C%20then%20your%20later%20and%20final%20versions%20will%20also%20get%20your%20permissions%20granted.%20I%20think%20it's%20not%20really%20tied%20to%20your%20actual%20SPFX%20package%2C%20except%20by%20the%20ids%20in%20the%20manifest.%20I%20could%20be%20wrong%20about%20that%3B%20my%20own%20attempts%20to%20do%20the%20same%20were%20cut%20short%20for%20unrelated%20reasons.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20your%20problem%20is%20not%20having%20global%20admin%2C%20you%20could%20try%20to%20get%20yourself%20a%20development%20tenant%20where%20you%20have%20admin%20privileges%2C%20that%20may%20be%20all%20you%20need%20to%20do%20your%20development.%20Then%20you%20won't%20have%20to%20ask%20an%20admin%20until%20you%20have%20something%20that's%20complete.%20IMHO%20you%20shouldn't%20have%20to%20have%20a%20complete%20project%20before%20the%20permission%20is%20granted%2C%20though.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20global%20admin%20part%20starts%20at%20step%204%20in%20this%20document%2C%20although%20it's%20written%20as%20if%20one%20person%20would%20be%20doing%20all%20of%20this%3A%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fdev%2Fspfx%2Fuse-aad-tutorial%23configure-the-api-permissions-requests%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fsharepoint%2Fdev%2Fspfx%2Fuse-aad-tutorial%23configure-the-api-permissions-requests%3C%2FA%3E%3C%2FP%3E%3CP%3ENote%20also%20that%20there%20can%20be%20a%20strange%20pause%20before%20the%20menu%20options%20appeared%20in%20the%20admin%20console.%20If%20you%20read%20quickly%2C%20you%20might%20see%20a%20menu%20option%20in%20the%20document%20that%20isn't%20where%20it's%20supposed%20to%20be%20in%20your%20admin%20console.%20Just%20give%20it%20a%20minute%2C%20though.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1999067%22%20slang%3D%22en-US%22%3ERe%3A%20Workbench%20test%20of%20isolated%20SPFx%20with%20Graph%20permissions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1999067%22%20slang%3D%22en-US%22%3EThanks!%20That%20confirms%20another%20source%2C%20I%20need%20to%20upload%20a%20draft%20version%20to%20do%20the%20proper%20initialization%2C%20then%20I%20can%20work%20on%20the%20solution%20itself.%3C%2FLINGO-BODY%3E
Frequent Contributor

I am building an isolated SPFx Client Side Web Part that uses an aadHttpRequest to write events to a user's calendar. For this I need Calendars.ReadWrite delegated permissions.

My issue: when I test in the online workbench, I get a 403 error. I suppose this is because the Web Part hasn't been deployed yet, and the application registration with those permissions doesn't exist yet.

 

How can I address this chicken & egg issue, and test my Web Part before deploying it?

2 Replies
Best Response confirmed by Christophe Humbert (Frequent Contributor)
Solution

@Christophe HumbertWell, you have to have global admin, so if you don't, you might be stuck.

 

If you do, though, then you could try to upload this incomplete version of the program, which will create the request for permission. Then grant the permissions, and delete your package from sharepoint. The permission request appears very simplistic in the admin console. It is my impression that as long as you keep the same ids and package names through the course of development, then your later and final versions will also get your permissions granted. I think it's not really tied to your actual SPFX package, except by the ids in the manifest. I could be wrong about that; my own attempts to do the same were cut short for unrelated reasons.

 

If your problem is not having global admin, you could try to get yourself a development tenant where you have admin privileges, that may be all you need to do your development. Then you won't have to ask an admin until you have something that's complete. IMHO you shouldn't have to have a complete project before the permission is granted, though.

 

The global admin part starts at step 4 in this document, although it's written as if one person would be doing all of this:

https://docs.microsoft.com/en-us/sharepoint/dev/spfx/use-aad-tutorial#configure-the-api-permissions-...

Note also that there can be a strange pause before the menu options appeared in the admin console. If you read quickly, you might see a menu option in the document that isn't where it's supposed to be in your admin console. Just give it a minute, though.

Thanks! That confirms another source, I need to upload a draft version to do the proper initialization, then I can work on the solution itself.