Skip to content

Liam-Sutcliffe/powershell-graph-api-auth-onbehalf-of-users

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

powershell-graph-api-auth-onbehalf-of-users

PowerShell example for authenticating on behalf of a user.

Before you begin using this script, you'll need to create an app registration. I will not detail the full breakdown of creating an app registration as it's extensively covered by various sources. I will however confirm the sections of configuration needed to make this work.

Redirect for single page application: Example In the highlighted section add: http://localhost:5000 Apply Delegated API permissions to the application for the required operations you need:

Permissions

Then generate a secret for the app registration.

Finally grant your user account access to the application registration & replace the details at the top of the script & run it!

If not signed in, you will be asked for your credentials. If successful you will be told to close the browser. In your powershell window you will be greeted with a Graph API call displaying the user signed in.

You can now make calls to the Graph API as your signed in user.

About

PowerShell example for authenticating on behalf of a user

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published