MarkEdmondson1234 / googleCloudRunner

Easy R scripts on Google Cloud Platform via Cloud Run, Cloud Build and Cloud Scheduler
https://code.markedmondson.me/googleCloudRunner/
Other
82 stars 26 forks source link

`cr_jwt_create` returns `Error : parse error: premature EOF` #171

Closed brancengregory closed 2 years ago

brancengregory commented 2 years ago

I'm working with the following setup:

I have a successfully authenticated project and build script which deploys two cloud run services. One is a private docker API and the other is a public shinydashboard.

I'm attempting to secure a JWT and token within the deployed dashboard so I can use cr_jwt_with_httr to make authenticated calls to the plumber API. The dashboard is auto-authenticating with credential_service_account.

Any ideas? Have I misunderstood the process?

MarkEdmondson1234 commented 2 years ago

Perhaps I need to see some code, but the function needs a json client to pick up the clientId to create the JWT token, is that in place?

MarkEdmondson1234 commented 2 years ago

I think it may be as you can auth automatically with credentials so it's not picking up the json client id that it assumes is in GAR_CLIENT_JSON env arg? It may be you can find the auto auth one via code but it's not supported as is, quickest would be to also upload with the app the client json (it's not sensitive data)

brancengregory commented 2 years ago

Yep, including the client json with the dashboard did the trick. Thanks!

MarkEdmondson1234 commented 2 years ago

Great, sounds like a cool setup would like to see some details if appropriate :)