Kyle Schutt
05/22/2024, 2:02 AMtiger
setup (see below). Is there another way to pass in the Auth0 access tokens to tigerFactory
where we don't have to re-authenticate the user again.
const backend = tigerFactory()
.onHostname("<https://dashboard.ourgooddatadomain.com>")
.withAuthentication(new ContextDeferredAuthProvider(redirectToTigerAuthentication));
Kyle Schutt
05/22/2024, 2:23 AMMoises Morales
05/22/2024, 7:22 AMKyle Schutt
05/22/2024, 3:05 PM{
"name": "mini-outburst",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev -H 0.0.0.0",
"build": "next build",
"start": "next start",
"lint": "next lint",
"pages:build": "npx @cloudflare/next-on-pages",
"preview": "npm run pages:build && wrangler pages dev .vercel/output/static",
"deploy": "npm run pages:build && wrangler pages deploy .vercel/output/static",
"db:list": "npx wrangler d1 migrations list mini-outburst --local",
"db:generate": "drizzle-kit generate:sqlite --schema=src/app/schema.ts",
"db:migrate": "npx wrangler d1 migrations apply mini-outburst --local",
"db:list:prod": "npx wrangler d1 migrations list mini-outburst",
"db:migrate:prod": "npx wrangler d1 migrations apply mini-outburst",
"debug": "NODE_OPTIONS='--inspect' next dev"
},
"dependencies": {
"@auth0/auth0-react": "^2.2.4",
"@fortawesome/fontawesome-svg-core": "^6.5.1",
"@fortawesome/free-solid-svg-icons": "^6.5.1",
"@fortawesome/react-fontawesome": "^0.2.0",
"@gooddata/api-client-tiger": "^10.0.0",
"@gooddata/sdk-backend-tiger": "^10.0.0",
"@gooddata/sdk-ui-all": "^10.0.0",
"drizzle-orm": "^0.29.4",
"jose": "^5.2.4",
"next": "^14.2.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"styled-components": "^6.1.11",
"swr": "^2.2.5"
},
"devDependencies": {
"@cloudflare/next-on-pages": "^1.9.0",
"@cloudflare/workers-types": "^4.20240208.0",
"@gooddata/catalog-export": "^10.0.0",
"@types/node": "^18.17.0",
"@types/react": "^18.2.0",
"@types/react-dom": "^18.2.1",
"autoprefixer": "^10.0.1",
"drizzle-kit": "^0.20.14",
"eslint": "^8",
"eslint-config-next": "14.1.0",
"eslint-plugin-next-on-pages": "^1.9.0",
"postcss": "^8",
"tailwindcss": "^3.3.0",
"typescript": "^5",
"vercel": "^33.5.1",
"wrangler": "^3.28.4"
}
}
Kyle Schutt
05/22/2024, 3:05 PMimport tigerFactory, { ContextDeferredAuthProvider, redirectToTigerAuthentication } from "@gooddata/sdk-backend-tiger";
// or if your application will be hosted on a different host than the GoodData Cloud or <http://GoodData.CN|GoodData.CN> backend
const backend = tigerFactory()
.onHostname("<https://dashboard.outburstdata.com>")
.withAuthentication(new ContextDeferredAuthProvider(redirectToTigerAuthentication));
export default backend;
Kyle Schutt
05/22/2024, 3:06 PMKyle Schutt
05/22/2024, 3:06 PMKyle Schutt
05/22/2024, 3:07 PMBackendProvider
under Auth0 and then modifying the tigerFactory
to silently fetch an access token and use TigerTokenAuthProvider
but that doesn't seem to work eitherKyle Schutt
05/22/2024, 3:07 PMRadek Novacek
05/29/2024, 12:24 PMRadek Novacek
05/29/2024, 12:33 PMContextDeferredAuthProvider
, you're telling the app to solve auth via redirecting to the auth page essentially; instead, you need to be able to provide the auth context already established when the user previously logged in through NextJS.
I'll try and give you somewhat more specific directions, but that about covers the theory at least!Kyle Schutt
05/29/2024, 12:42 PMAuth0Provider
into the tiger factoryKyle Schutt
06/03/2024, 2:36 PMRadek Novacek
06/06/2024, 1:59 PMKyle Schutt
06/06/2024, 3:47 PMRadek Novacek
06/07/2024, 1:06 PMContextDeferredAuthProvider
itself? the source code of the GD.UI SDK is available on GitHub, and the flow is described in this link here 🙂Kyle Schutt
06/07/2024, 1:09 PMRadek Novacek
06/07/2024, 1:16 PMKyle Schutt
06/07/2024, 2:01 PMimport tigerFactory, { ContextDeferredAuthProvider, redirectToTigerAuthentication } from "@gooddata/sdk-backend-tiger";
// or if your application will be hosted on a different host than the GoodData Cloud or <http://GoodData.CN|GoodData.CN> backend
const backend = tigerFactory()
.onHostname("<https://dashboard.outburstdata.com>")
.withAuthentication(new ContextDeferredAuthProvider(redirectToTigerAuthentication));
export default backend;
Kyle Schutt
06/07/2024, 2:02 PMredirectToTigerAuthentication
?Radek Novacek
06/10/2024, 12:07 PM