< Back

Get-BitbucketAccessToken

Sat Jan 11, 2020 2:23 pm

NAME Get-BitbucketAccessToken



SYNOPSIS

Gets an OAuth2 access token for use with the Bitbucket API.





SYNTAX

Get-BitbucketAccessToken [-ConsumerKey] <String> [-ConsumerSecret] <SecureString> [[-AccessTokenEndpointUrl]

<String>] [<CommonParameters>]





DESCRIPTION

This script uses the 'Resource Owner Password Credentials Grant' OAuth2 flow to acquire an access token for the

specified consumer.





PARAMETERS

-ConsumerKey <String>



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ConsumerSecret <SecureString>



Required? true

Position? 2

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-AccessTokenEndpointUrl <String>



Required? false

Position? 3

Default value https://bitbucket.org/site/oauth2/access_token

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



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



PS C:\\>Get-BitbucketAccessToken -ConsumerKey abcd1234 -ConsumerSecret $consumerSecret













-------------------------- EXAMPLE 2 --------------------------



PS C:\\>ConvertTo-SecureString "abcd1234abcd1234" -AsPlainText -Force | Get-BitbucketAccessToken -ConsumerKey

abcd1234















RELATED LINKS