-
Notifications
You must be signed in to change notification settings - Fork 81
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
parse error: asn1: syntax error: sequence truncated #140
Comments
Hi there, it sounds like you have a malformed credentials.json and possibly mixing and matching client id credentials with service account credentials. Also, you should never have to hand-edit fields in the credentials. Can you tell me what the original credentials.json looked like (i.e. all the fields it had). Don't share the values. Thanks! |
Hello andy , thanks for your reply! here you are my downloaded untouched json credential file; $ cat client_secret_588412352642-jv7lchcip7oq13b58udqvXXXXXXXXXXXXX.apps.googleusercontent.com.json | json_pp $ ./oauth2l fetch --credentials client_secret_588412352642-jv7lchcip7oq13b58udqvXXXXXXXXXXXXX.apps.googleusercontent.com.json --scope postmaster.readonly |
Hi there, so it looks like you are trying to work with a client id credentials file - what is strange is that oauth2l doesn't recognize it, possibly because your credentials file does not have "redirect_uris" field which is needed for the 3LO flow. Can you try creating a new credentials file and selecting "Desktop" instead of "web" for generating the credentials file? We will try to repro your issue on our end in the meantime. |
Thanks again for you reply andy. I created a new credentials pair using desktop as app type, and seems it advanced properly, i received; $./oauth2l fetch --credentials credentials.json --scope=postmaster.readonly Now i have to figure out whats its the browser message related, and get my auth token. :-) |
Hi gu1113, going back to the "redirect_uris" missing in the credentials file, did you provide values for "Authorized Javascript origins" and "Authorized redirect URIs" when creating the web client in GCP? Thanks! |
Hi @ulisesL , thanks for you reply!, i did not complete those files because im trying to get the auth token to use the google postmaster api not sure which fields i should use. |
No problem! When creating "web" client credentials, please provide the "Authorized Javascript origins" and "Authorized redirect URIs" fields in the GCP UI. "Authorized redirect URIs" is needed for the 3LO flow as @andyrzhao pointed out. Missing this field will result in the error described in your 1st post. |
Hi @gu1113, Re: |
Hello im trying to fetch a google api token for the postmaster tools but i have some errors using the script;
using it directly with the credentials.json download from the google console i have received;
$ ./oauth2l fetch --credentials credentials.json --scope postmaster.readonly
missing 'type' field in credentials
$
Adding "type":"service_account","web" to the json file the error have changed for the following;
$ ./oauth2l fetch --credentials credentials.json --scope postmaster.readonly
private key should be a PEM or plain PKCS1 or PKCS8; parse error: asn1: syntax error: sequence truncated
$
Whats about is the last one related ?,
Thanks
The text was updated successfully, but these errors were encountered: