< Back

Get-GDriveAccessToken

Mon Jan 13, 2020 10:22 pm

NAME Get-GDriveAccessToken



SYNOPSIS

Renew Access Token to work with GoogleDrive





SYNTAX

Get-GDriveAccessToken [-ClientID] <String> [-ClientSecret] <String> [-RefreshToken] <String> [<CommonParameters>]





DESCRIPTION

Renew Access Token to work with GoogleDrive





PARAMETERS

-ClientID <String>

OAuth2 Client ID



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ClientSecret <String>

OAuth2 Client Secret



Required? true

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-RefreshToken <String>

OAuth2 RefreshToken



Required? true

Position? 3

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

Json with Access Codes and its lifetime and type as PSObject





NOTES





Author: Max Kozlov



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>$refresh = Request-GDriveRefreshToken -ClientID $oauth_json.web.client_id -ClientSecret

$oauth_json.web.client_secret -AuthorizationCode $code



Request-GDriveAccessToken -ClientID $oauth_json.web.client_id -ClientSecret $oauth_json.web.client_secret

-RefreshToken $refresh.refresh_token











RELATED LINKS

Request-GDriveRefreshToken

Request-GDriveAuthorizationCode

Revoke-GDriveToken

https://developers.google.com/drive/api/v3/about-auth

https://developers.google.com/identity/protocols/OAuth2

https://developers.google.com/identity/ ... stalledApp

https://developers.google.com/identity/ ... 2WebServer