Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building local DevEnv, downloading dependencies: Authentication fails when using "gh auth status" in AL-Go-Helper.ps1 #434

Closed
SCS-CBO opened this issue Mar 9, 2023 · 3 comments
Labels
bug Something isn't working Fix Ready Fix Ready Shipped Feature is included in the latest version

Comments

@SCS-CBO
Copy link

SCS-CBO commented Mar 9, 2023

During building a local development environment, downloading dependencies fails with:

ConvertFrom-Json : Cannot bind argument to parameter 'InputObject' because it is null.
At C:\Users***\AppData\Local\Temp\tmp71BD.tmp.psm1:10 char:53
+         $errorDetails = $errorRecord.ErrorDetails | ConvertFrom-Json
+                                                     ~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [ConvertFrom-Json], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.ConvertFrom
   JsonCommand

The reason is that since 2.24 gh auth status returns an additional line which is unexpected by AL-Go and so included in the token and consequently lets authentication fail.

We have implemented a workaround: $_.authTokenSecret = $authstatus.SubString($authstatus.IndexOf('Token: ')+7).Split(" ")[0].Trim() Maybe that or something better can be added?

@freddydk freddydk added the bug Something isn't working label Mar 13, 2023
freddydk pushed a commit to freddydk/AL-Go that referenced this issue Mar 13, 2023
@freddydk freddydk mentioned this issue Mar 13, 2023
mazhelez pushed a commit that referenced this issue Mar 15, 2023
Co-authored-by: freddydk <freddyk@microsoft.com>
@freddydk freddydk added Fix Ready Fix Ready Shipped Feature is included in the latest version labels Apr 26, 2023
@cegekaJG
Copy link
Contributor

Why not use git auth token instead? There'd be no formatting necessary.

@freddydk
Copy link
Collaborator

Why not use git auth token instead? There'd be no formatting necessary.

Didn't know about this one, but will definitely investigate.

@freddydk
Copy link
Collaborator

3.1 uses gh auth token

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Fix Ready Fix Ready Shipped Feature is included in the latest version
Projects
None yet
Development

No branches or pull requests

3 participants