< Back

Request-GDriveRefreshToken

Mon Jan 13, 2020 10:28 pm

NAME Request-GDriveRefreshToken



SYNOPSIS

Exchange Authorization Code to Access and Refresh Tokens





SYNTAX

Request-GDriveRefreshToken [-ClientID] <String> [-ClientSecret] <String> [-AuthorizationCode] <String>

[-RedirectUri <String>] [<CommonParameters>]





DESCRIPTION

Exchange Authorization Code to Access and Refresh Tokens



NOT intended for use in scripts! Only cmdline with UI and real user behind the keyboard





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



-AuthorizationCode <String>

OAuth2 Authorization Code



Required? true

Position? 3

Default value

Accept pipeline input? false

Accept wildcard characters? false



-RedirectUri <String>

OAuth2 RedirectUri



Required? false

Position? named

Default value https://developers.google.com/oauthplayground

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 Refresh and Access Codes and its lifetime and type as PSObject





NOTES





Author: Max Kozlov



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



PS C:\\>$oauth_json = $oauth | ConvertFrom-Json



$code = Request-GDriveAuthorizationCode -ClientID $oauth_json.web.client_id -ClientSecret

$oauth_json.web.client_secret

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

-AuthorizationCode $code











RELATED LINKS

Get-GDriveAccessToken

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