< Back
Request-GDriveAuthorizationCode
Post
NAME Request-GDriveAuthorizationCode
SYNOPSIS
Request Authorization code to work with GoogleDrive
SYNTAX
Request-GDriveAuthorizationCode [-ClientID] <String> [-ClientSecret] <String> [-RedirectUri <String>]
[<CommonParameters>]
Request-GDriveAuthorizationCode [-ClientID] <String> [-ClientSecret] <String> -Automatic [-Credential
<PSCredential>] [-RedirectUri <String>] [<CommonParameters>]
DESCRIPTION
Request Authorization code to work with GoogleDrive
If user logged into google account or username/password supplied that can be automatic
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
-Automatic [<SwitchParameter>]
DANGEROUS! Try to automatically approve access
Required? true
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-Credential <PSCredential>
DANGEROUS! Google account username/password to automatic code request
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-RedirectUri <String>
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
None
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
-------------------------- EXAMPLE 2 --------------------------
PS C:\\>$oauth_json = $oauth | ConvertFrom-Json
$code = Request-GDriveAuthorizationCode -ClientID $oauth_json.web.client_id -ClientSecret
$oauth_json.web.client_secret -Automatic
Request-GDriveRefreshToken -ClientID $oauth_json.web.client_id -ClientSecret $oauth_json.web.client_secret
-AuthorizationCode $code
RELATED LINKS
Get-GDriveAccessToken
Request-GDriveRefreshToken
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
SYNOPSIS
Request Authorization code to work with GoogleDrive
SYNTAX
Request-GDriveAuthorizationCode [-ClientID] <String> [-ClientSecret] <String> [-RedirectUri <String>]
[<CommonParameters>]
Request-GDriveAuthorizationCode [-ClientID] <String> [-ClientSecret] <String> -Automatic [-Credential
<PSCredential>] [-RedirectUri <String>] [<CommonParameters>]
DESCRIPTION
Request Authorization code to work with GoogleDrive
If user logged into google account or username/password supplied that can be automatic
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
-Automatic [<SwitchParameter>]
DANGEROUS! Try to automatically approve access
Required? true
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false
-Credential <PSCredential>
DANGEROUS! Google account username/password to automatic code request
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-RedirectUri <String>
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
None
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
-------------------------- EXAMPLE 2 --------------------------
PS C:\\>$oauth_json = $oauth | ConvertFrom-Json
$code = Request-GDriveAuthorizationCode -ClientID $oauth_json.web.client_id -ClientSecret
$oauth_json.web.client_secret -Automatic
Request-GDriveRefreshToken -ClientID $oauth_json.web.client_id -ClientSecret $oauth_json.web.client_secret
-AuthorizationCode $code
RELATED LINKS
Get-GDriveAccessToken
Request-GDriveRefreshToken
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