New-PartnerAccessToken does not return Refresh token on macOS for ExOL
Steps to reproduce
What steps can reproduce the defect? Please share the setup, commandline for vstest.console, sample project, target framework etc. Run
$token = New-PartnerAccessToken -ApplicationId 'a0c73c16-a7e3-4564-9a95-2bdf47383716' -Scopes 'https://outlook.office365.com/.default' -Tenant "<mytenantId>" -UseDeviceAuthentication
on macOS described in the environment data below
Expected behavior
$token.RefreshToken has a value
Actual behavior
$token.RefreshToken has an empty value.
Environment
PS /Users/jkirsop/Development/> $PSVersionTable
Name Value
---- -----
PSVersion 7.1.3
PSEdition Core
GitCommitId 7.1.3
OS Darwin 19.6.0 Darwin Kernel Version 19.6.0: Tue Jun 22 19:49:55 PDT 2021; root:xnu-6153.141.35~1/RELEASE_X86_64
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
PS /Users/jkirsop/Development/> Get-Module PartnerCenter
ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Script 3.0.10 PartnerCenter {Add-PartnerCustomerCartLineItem, Add-PartnerCustomerUserRoleMember, Connect-PartnerCenter, Disconnect-PartnerCenter…}
Other Info
- Running the same command, with the same tenant ID in a Windows 10 VM returns a value for
$token.RefreshToken. -
AccessToken,IdTokenetc are returned on the macOS machine, onlyRefreshTokenis missing
I came across this today when trying to run the module (3.0.10) pwsh from a container. I've tried various version of linux and powershell and the previous version of the module they all return a null RefreshToken. I need to track down a windows laptop as I don't have that as an OS in my CI. I don't suppose anyone knows how to achieve the same thing in postman or curl instead?
if anyone happens to come across this issue stuck with the same problem, here is the curl request I'm now using to generate the token...
/usr/bin/curl --location "https://login.microsoftonline.com/$($JSON.tenantId)/oauth2/v2.0/token" --request POST `
--header 'return-client-request-id: true' `
--header 'Accept: application/json' `
--header 'Content-Type: application/x-www-form-urlencoded' `
--data-urlencode "client_id=$($JSON.clientId)" `
--data-urlencode 'client_info=1' `
--data-urlencode "client_secret=$($JSON.clientSecret)" `
--data-urlencode 'scope=https://api.partnercenter.microsoft.com/user_impersonation offline_access openid profile' `
--data-urlencode 'grant_type=refresh_token' `
--data-urlencode "refresh_token=$($JSON.refreshToken)"```