Yoshimori Otsuka
08/02/2023, 12:49 AMimport tigerFactory, {
ContextDeferredAuthProvider,
redirectToTigerAuthentication,
} from '@gooddata/sdk-backend-tiger'
const backend = tigerFactory()
.onHostname(process.env.NEXT_PUBLIC_GOODDATA_CLOUD_HOSTING_URL)
.withAuthentication(
new ContextDeferredAuthProvider(redirectToTigerAuthentication)
)
// @see <https://sdk.gooddata.com/gooddata-ui-apidocs/v8.12.0/docs/sdk-ui.useinsightdataview.html#__docusaurus>
const {
result,
} = useInsightDataView(
{
insight: idRef(insightIdentifier),
executeByReference: true,
filters,
sorts,
},
[insightId]
)
want
import { newAxios, tigerClientFactory } from '@gooddata/api-client-tiger'
cosnt sdk = tigerClientFactory(newAxios(clientEnv.NEXT_PUBLIC_GOODDATA_CLOUD_HOSTING_URL))
const oidc_token = 'How can I get SPRING_SEC_SECURITY_CONTEXT or other OIDC token from Auth0' // I'm using @auth0/nextjs-auth0
// Get a single execution result
const response = await sdk.executionResult.retrieveResult(
{
workspaceId,
resultId,
},
{
headers: {
// Authorization: `Bearer ${token}`, // instead of Personal Access Tokens
Cookie: `SPRING_SEC_SECURITY_CONTEXT=${oidc_token};`,
},
withCredentials: true,
},
)
Jan Kos
08/03/2023, 2:53 PMJan Kos
08/03/2023, 3:54 PMYoshimori Otsuka
08/04/2023, 1:34 AMMay you share more details about your use case?[summary] • I provide a web app to show BI dashboard for several clients. • Each client can only access his workspace data(insights and workspace). ◦ => require OIDC? • Each client has each API access count limitation to not stop all clients access. ◦ => can't use common GOODDATA_API_KEY ? • I want to resolve network waterfall and format GoodData API data to ViewModel ◦ => use Next.js Server Components or Node.js API server [now use case] • [front] Next.js with react-sdk(backend) ◦ following backend document ◦ using @auth0/nextjs-auth0 ◦ using @gooddata/sdk-backend-tiger ◦ using OIDC ? (by redirectToTigerAuthentication) ex.
const backend = tigerFactory()
.onHostname(env.NEXT_PUBLIC_GOODDATA_CLOUD_HOSTING_URL)
.withAuthentication(
new ContextDeferredAuthProvider(redirectToTigerAuthentication)
)
[require]
• Each client can only access his workspace data(insights and workspace).
◦ => require OIDC ?
• Each client has each API access count limitation to not stop all clients access.
◦ => can't use common GOODDATA_API_KEY ?
• resolve network waterfall and format GoodData API data to ViewModel by using Next.js Server Components
[want use case]
• [Front] Next.js with Server Components
◦ Server Components to resolve waterfall and format api data to ViewModel (only show Data fetching from below api)
• [API] Next.js app/api server (Node.js base) or express(Node.js)
◦ promise base api server for
• [3rd API] GoodData REST
◦ idea1 (api-client-tiger)
◦ idea2 (tried to use OpenAPI base API)
▪︎ execution result with openapi2aspida and @aspida/fetch
• mismatch type