How to handle oAuth from PowerShell

PowerShell for Admins, Tips and Tricks

One of the coolest features of PowerShell is the many tools we have available to work with services on the web, be they SOAP, REST, RPC or even WSDL services.  It's no question, PowerShell makes it very easy to pull down data from any of these places.

Unfortunately, getting data from a service isn't always as easy as embedding your credentials in a URL. In fact, some services require us to authenticate and ask the user for permission before giving up the goods.  For these, oAuth is the de-facto standard for delegated access.  

In this blog post today on, we cover an easy method to present a user with an oAuth window to ask for permission, and offer a guide of how to handle the somewhat complicated flow of credentials and URLs needed to delegate permissions, using WordPress as an example.  

Using PowerShell and oAuth

Special Thanks

This post couldn't have happened without contributions by Lee Holmes, Adam Bertram, Keith Hill, Chris Wu, and Ryan Yates for helping me to understand how to safely store credentials, and for other questions.  Extra thanks go to Adam and Ryan for helping me fact-check the post, and to Chris Wu for his excellent write-up on the 'Hey, Scripting Guy' blog.  



2 Responses to " How to handle oAuth from PowerShell "

  1. […] How to handle oAuth from PowerShell (Stephen Owen) […]

  2. Conrad Braam says:

    Thanks for the share Stephen
    Due to slight breakage, the correct linky seems to be moved to