Skip to content

New-TSSSecretPermission unable to determine which SecretAccessRole to use #326

Description

@wlodge-WM

Verified issue does not already exist?

Yes

What error did you receive

C:\Program Files\WindowsPowerShell\Modules\thycotic.secretserver\0.60.9\parts\ProcessResponse.ps1 : {
"errorCode": "API_GenericException",
"message": "The server was unable to determine which SecretAccessRole to use. Please provide a valid
SecretAccessRoleName if using REST. Otherwise, make sure your request has a valid SecretAccessRoleID."
}
At C:\Program Files\WindowsPowerShell\Modules\thycotic.secretserver\0.60.9\functions\secret-permissions\New-TssSecretPe
rmission.ps1:101 char:41

  • ... $restResponse = . $ProcessResponse $apiResponse
  •                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    

Please run the command using -Verbose

VERBOSE: Command invocation: New-TssSecretPermission -TssSession:TssSessionObject -SecretId:System.Int32[]
-AccessRole:System.Int32[] -DomainName:pmmr.com -Username:PGarrison -Force:True -Verbose:True
VERBOSE: Command invocation: Search-TssSecret -TssSession:TssSessionObject
VERBOSE: Performing the operation GET
https://oct.secretservercloud.com/api/v1/secrets?sortBy[0].direction=asc&sortBy[0].name=Name&take=2147483647&filter.inc
ludeRestricted=true
VERBOSE: Performing the operation POST https://oct.secretservercloud.com/api/v1/secret-permissions with:
System.Collections.Specialized.OrderedDictionary
VERBOSE: Performing the operation "POST https://oct.secretservercloud.com/api/v1/secret-permissions with {
"SecretAccessRoleName": "Edit",
"SecretId": 123456,
"domainName": "domain.com",
"Username": "username"
}" on target "Secret ID: 123456".
C:\Program Files\WindowsPowerShell\Modules\thycotic.secretserver\0.60.9\parts\ProcessResponse.ps1 : {
"errorCode": "API_GenericException",
"message": "The server was unable to determine which SecretAccessRole to use. Please provide a valid
SecretAccessRoleName if using REST. Otherwise, make sure your request has a valid SecretAccessRoleID."
}
At C:\Program Files\WindowsPowerShell\Modules\thycotic.secretserver\0.60.9\functions\secret-permissions\New-TssSecretPe
rmission.ps1:101 char:41

  • ... $restResponse = . $ProcessResponse $apiResponse
  •                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    

Provide a test case or steps to reproduce

$tsssession = New-TssSession -SecretServer $ssURL -Credential $cred -OtpCode 123456
$user = Search-TssUser -TssSession $tssSession -Field username -SearchText 'username'
#Note: AccessRole can be any of: List, View, Edit, Owner but the error message is the same
#Note: error message is also the same if adding permission for local user and removing the -DomainName parameter
New-TssSecretPermission -TssSession $tssSession -SecretId $secretID -AccessRole Edit -DomainName $user.DomainName -Username $user.Username -Force -verbose

Expected behavior

Expected behavior is that permissions inheritance is broken, if necessary, and a new permission entry is added to secret for the specified user.

What Edition of Secret Server?

Cloud Subscription

What version of Secret Server

EA release

What PowerShell host was used when producing this error

Windows PowerShell (powershell)

PowerShell Host Version

Name Value


PSVersion 5.1.19041.2673
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.2673
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedbug or feature request acceptedbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions