New-PartnerAccessToken does not returns refresh token
See original GitHub issueSteps to reproduce
What steps can reproduce the defect? Please share the setup, commandline for vstest.console, sample project, target framework etc.
Refresh Token was issued with commands in v 1.5 of the module. It follows the standard way of creating SP, creation impersonation with the SP of a user that has global administrator and admin agent rights. Nothing out of the ordinary.
$p=New-PartnerAccessToken -ApplicationId "<app id>" -Credential (Get-Credential) -RefreshToken $token -Scopes 'https://api.partnercenter.microsoft.com/user_impersonation' -ServicePrincipal -Tenant <tenant id>
$p.RefreshToken
$p.RefreshToken is empty. Only access token is filled.
Expected behavior
Share the expected output Expected output should contain Refresh token
Actual behavior
What is the behavior observed?
No refresh token is returned, only access one.
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
Both 5.1 and 6.2.3
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:39 (10 by maintainers)
@slavizh thank you for sharing that. There should be a file named
msal.cache
in that directory. I am not sure what is happening just yet, but that is the reason the refresh token value is missing. The token cache is not persisting to storage. I was able to reproduce the issue and then I got it corrected in my environment. Let me keep digging to see what is causing this inconsistent behavior.@bilalAchahbar the root cause for this issue was related to how the module was being published. Since you have updated to a version where this has been corrected and your are still having issues please open a new issue. If you do open a new issue please include details about what exactly is missing.