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

Add Support for Token with generated with Delegation Permission #13

Open
weyCC81 opened this issue Oct 30, 2024 · 0 comments
Open

Add Support for Token with generated with Delegation Permission #13

weyCC81 opened this issue Oct 30, 2024 · 0 comments

Comments

@weyCC81
Copy link

weyCC81 commented Oct 30, 2024

If you are passing tokens generated with delegation permission, the "roles" attribute from "Get-MdeAuthorizationInfo" is empty
This does block you from using cmdlets like Get-MdeMachine with an error message saying not having enough permission.

Please change the following lines inside Get-MdeAuthorizationInfo.ps in Line 23-35 to allow this:

    if($parsedToken.roles) {
      $roles = $parsedToken.roles # Existing for Application Token (App only)
    }else {
      $roles = $parsedToken.scp # Fix for Delegation Token (User)
    }
    
    $resultObject = @{
      tokenExpired = $expired
      #roles       = (Get-ParsedToken -token $tc).roles
      #roles       = $parsedToken.role
      roles        = $roles
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant