question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

New-PartnerAccessToken does not return a refresh token under Linux

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
marioroycommented, Mar 24, 2020

Thank you, @slavizh and @isaiahwilliams. We hit a wall today with testing on Linux. The in-memory feature works.

0reactions
ghostcommented, Mar 2, 2020

@slavizh with the upcoming release the underlying issue for this issue will be resolved. Also, I am planning to update the documentation to state that both Gnome Keyring and libsecret are requirements for a preseistent token cache when using Linux. If those are not option, then using the in-memory feature is your best option.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Oauth/token not returning refresh token
If you do not get back a new refresh token , then it means your existing refresh token will continue to work when...
Read more >
Why is my request for a new access token not returning ...
You get a new refresh token only when you are including the offline_access scope. ref.
Read more >
Refresh Token request returning Unauthorized
I see the problem here and can reproduce this. If I use the legacy=1 parameter in your request for a refresh token, I...
Read more >
Solved: Refreshing access token does not reuturn new refre...
Solved: The documentations states that the following request should return a new refresh token: Sample cURL request curl -H 'Content-Type:
Read more >
Refresh Token POST Request to the Token Endpoint
When the refresh token expires, the token endpoint returns an invalid_grant error. The application must go back to Step One of the OAuth...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found