Skip to content

accesstoken get

Gets access token for the specified resource


accesstoken get [options]


Option Description
--help output usage information
-r, --resource <resource> The resource for which to retrieve an access token
--new Retrieve a new access token to ensure that it's valid for as long as possible
-o, --output [output] Output type. json|text. Default text
--verbose Runs command with verbose logging
--debug Runs command with debug logging


The accesstoken get command returns an access token for the specified resource. If an access token has been previously retrieved and is still valid, the command will return the cached token. If you want to ensure that the returned access token is valid for as long as possible, you can force the command to retrieve a new access token by using the --new option.


Get access token for the Microsoft Graph

accesstoken get --resource

Get a new access token for SharePoint Online

accesstoken get --resource --new