looker-open-source / embed-sdk

The Looker browser embedding SDK
MIT License
72 stars 47 forks source link

Cookieless acquire call produces 404 #192

Closed tomsseisums closed 2 months ago

tomsseisums commented 2 months ago

Having set the clientId and clientSecret in the .env and enabled the Use cookieless, I get the following error:

embed session acquire failed {
  error: LookerSDKError: POST https://<redacted>.cloud.looker.com/api/4.0/embed/cookieless_session/acquire: 404 - {"message":"The resource you're looking for could not be found"}
      at new LookerSDKError (/Users/tomsseisums/Projects/<redacted>/looker-embed-sdk/node_modules/@looker/sdk-rtl/src/lookerSDKError.ts:112:11)
      at sdkError (/Users/tomsseisums/Projects/<redacted>/looker-embed-sdk/node_modules/@looker/sdk-rtl/src/transport.ts:491:14)
      at /Users/tomsseisums/Projects/<redacted>/looker-embed-sdk/node_modules/@looker/sdk-rtl/src/transport.ts:539:11
      at Generator.next (<anonymous>)
      at asyncGeneratorStep (/Users/tomsseisums/Projects/<redacted>/looker-embed-sdk/node_modules/@looker/sdk-rtl/src/transport.ts:32:50)
      at _next (/Users/tomsseisums/Projects/<redacted>/looker-embed-sdk/node_modules/@looker/sdk-rtl/src/transport.ts:32:50)
      at processTicksAndRejections (node:internal/process/task_queues:95:5) {
    errors: [],
    documentation_url: ''
  }
}

Tried the requests in Embedded API Explorer and everything worked as expected, but I noticed that is calling /api/internal/4.0.

This is for the first attempt to load, not a subsequent request, where session_reference_token is null.

I'm using Looker (original), 24.14.20.

This is the demo_user.json content:

{
  "external_user_id": "user1111",
  "first_name": "Pat",
  "last_name": "Embed",
  "session_length": 10,
  "force_logout_login": true,
  "external_group_id": "group1",
  "group_ids": [],
  "permissions": [
    "access_data",
    "see_looks",
    "see_user_dashboards",
    "save_content",
    "download_without_limit",
    "create_alerts"
  ],
  "models": [
    "orders"
  ]
}

I'm out of clues why it's producing 404.

tomsseisums commented 2 months ago

Found my issue:

"To use either API, the embedding application must be able to authenticate into the Looker API with admin privileges."

via https://cloud.google.com/looker/docs/cookieless-embed

Setting the role for the user - that has the API credentials set up - to Admin, fixed my 404 issue.