내 커뮤니티 업적 표시줄을 확대합니다.

Mark Solution

활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.

해결됨

use aio-lib-state and aio-lib-file in web-src?

Avatar

Community Advisor

Having an app scren, is it possible to use the libraries aio-lib-state or aio-lib-files and access the data? eg. I want to have some "basic logs" save somewhere and display it on an app screen (component). or do I need to write an action fetching the desired data and then display the response?

주제

토픽은 커뮤니티 콘텐츠를 분류하여 관련성 있는 콘텐츠를 찾는 데 도움이 됩니다.

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Employee

Hi @Urs_Boller , it is possible to use aio-lib-state and aio-lib-files in the UI components in `web-src/`, same as any nodejs code. However it does not have the built-in authentication like in the backend action which leverages the namespace credentials to obtain access tokens to State and Files. You would have to manage the authentication in your code. IMO this is not a secure way of using State and Files libs because there are too many vulnerability risks in the frontend code. The best way would still going through the action with `require-adobe-auth` enabled.

원본 게시물의 솔루션 보기

2 답변 개

Avatar

정확한 답변 작성자:
Employee

Hi @Urs_Boller , it is possible to use aio-lib-state and aio-lib-files in the UI components in `web-src/`, same as any nodejs code. However it does not have the built-in authentication like in the backend action which leverages the namespace credentials to obtain access tokens to State and Files. You would have to manage the authentication in your code. IMO this is not a secure way of using State and Files libs because there are too many vulnerability risks in the frontend code. The best way would still going through the action with `require-adobe-auth` enabled.

Avatar

Community Advisor
Hi @duypnguyen security is an important case, was just looking for a "quick way". I now implemented a generic action that both handles "getData" and "updateData" for a single screen (based on parameters) and enabled the 'require-adobe-auth'. Works good and just a few lines more than having within the main component itself.