Service Accounts: failed to DecodeSACCredentials: failed to DeserializeServiceAccountAuthToken
Hello, I'm trying to connect Bitrise with 1Password via a service account. I have set my OP_SERVICE_ACCOUNT_TOKEN environment variable to my service account token. But I get the following error:
Configuring env... [ERROR] 2023/08/09 16:23:23 failed to DecodeSACCredentials: failed to DeserializeServiceAccountAuthToken, unrecognized auth type [ERROR] 2023/08/09 16:23:23 error initializing client: Validation: (failed to session.DecodeSACredentials), Server: (failed to DecodeSACCredentials), failed to DeserializeServiceAccountAuthToken, unrecognized auth type
What would be the auth type and do I need to set it somewhere? Thanks
1Password Version: Not Provided
Extension Version: Not Provided
OS Version: Not Provided
Browser: Not Provided
Comments
-
I had this same problem because I accidently used the Connect server access token instead of the service account token. Go to the Integration settings, click the Directory tab, and then click the Other button to get to where you actually create a service account.
0 -
I am also having this issue, but neither
OP_CONNECT_TOKEN
norOP_CONNECT_HOST
are set and I've also tried rotating the token several times (using the new one each time), still getting the same error...What's the best way to debug this? I tried the
--debug
flag but didn't get much other information:$ if [ -z "${OP_CONNECT_TOKEN}" ]; then echo "OP_CONNECT_TOKEN is unset."; else echo "OP_CONNECT_TOKEN is set."; fi OP_CONNECT_TOKEN is unset. $ if [ -z "${OP_CONNECT_HOST}" ]; then echo "OP_CONNECT_HOST is unset."; else echo "OP_CONNECT_HOST is set."; fi OP_CONNECT_HOST is unset. $ echo $OP_SERVICE_ACCOUNT_TOKEN|wc -c 861 $ op user get --me [ERROR] 2023/12/30 17:21:52 failed to DecodeSACredentials: failed to DeserializeServiceAccountAuthToken, unrecognized auth type $ op --debug user get --me 5:21PM | DEBUG | Skipped loading desktop app settings file. The desktop app might not be installed: read file: lstat /root/.config/1Password/settings/settings.json: no such file or directory [ERROR] 2023/12/30 17:21:58 failed to DecodeSACredentials: failed to DeserializeServiceAccountAuthToken, unrecognized auth type
(As you can see from the debug message I'm trying this as root, but I also tried it as non-root just to make sure this wasn't the issue and I saw the same behavior...)
0 -
Ok apparently my bash-fu wasn't so strong.. Here's what I was doing wrong:
In order to populate the
OP_SERVICE_ACCOUNT_TOKEN
variable, I had stored the service token in a file (marked rw only for the user to keep it secret) and then I was runningexport OP_SERVICE_ACCOUNT_TOKEN=$(cat .service-account-token)
.The problem with this is that
cat
seems to have been spitting out^[[0m
escape sequences at the beginning and the end of its output...and those are bytes that throw offop
!To fix this, I just changed my
export
statement toexport OP_SERVICE_ACCOUNT_TOKEN=$(<.service-account-token)
and everything seems to be golden now.0