Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

New-PartnerAccessToken does not return a refresh token under Linux #266

@slavizh

Description

@slavizh

Steps to reproduce

What steps can reproduce the defect?
Please share the setup, commandline for vstest.console, sample project, target
framework etc.

We are using New-PartnerAccessToken in a docker container of Ubuntu 18.04. The PowerShell script is run via Azure DevOps agent on PowerShell 6.2.3-1.ubuntu.18.04.
When using the following command:

$cspCredentials = New-Object System.Management.Automation.PSCredential ($applicationIdSecret.SecretValueText, $applicationSecret.SecretValue )
    $cspNewTokenParameters = @{
        ApplicationId = $applicationIdSecret.SecretValueText
        Credential = $cspCredentials
        RefreshToken = $refreshTokenSecret.SecretValueText
        Scopes = 'https://api.partnercenter.microsoft.com/user_impersonation'
        ServicePrincipal = $true
        Tenant = $tenantIdSecret.SecretValueText
        ErrorAction = 'Stop'
        ErrorVariable = 'lastError'
    }
    $cspToken = New-PartnerAccessToken @cspNewTokenParameters

The refresh token is not returned in variable $cspToken.RefreshToken. It is empty. $cspToken.AccessToken and other properties in the object are populated. For example CorrelationId : 47e26b5b-1b9a-4a1b-baa4-feb90ecd718c

Expected behavior

Share the expected output

Actual behavior

What is the behavior observed?

Diagnostic logs

Please share test platform diagnostics logs.
The logs may contain test assembly paths, kindly review and mask those before sharing.

Environment

Please share additional details about your environment.
Version

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions