Widget need credential login

What product/components do you use and which version/fix level?

1011

Are you using a free trial or a product with a customer license?

license

What are trying to achieve? Please describe in detail.

I have some custom widget uploaded as in SDK in application builder, While I develop the widget in local or deployed in server it requires another login when you go to the edit widget and if you skip the login widget fails to call the API and throw some cors error.

My question is there a way to remove the credential requirement which is coming while user go to the edit widget functionalities or make it required . Because my customer may skip that login and come to me for issue that the widget is not working and I also check if the user ignore at first it may not ask them again.

Do you get any error messages? Please provide a full error message screenshot and log file.

Have you installed latest fixes for the products

Any help is appreciated!

Hi Saif,

Can you share some more detail such as which API is asking for credential(you can check this in browser console β†’ Network tab) and how are you invoking API ?

Regards,
Darpan

Hi Darpan,

My code does not invoke this login popup ( All my code is inside the custom widget folder), It’s come from the application builder itself. And there is no trace of any API in the browser network tab.
It usually ask every first time after new code deployment to the server for every user. My problem is if the user ignores this login or press cancel it block the APIs to run.

Thanks,
Saif

Hi Saif,

Generally you will get this kind of popup when you are not using cumulocity context while invoking API or you may not have necessary permissions to invoke that API.
This is common behavior irrespective of you are using application builder or not.
When you click on cancel on popup, you should find API in network tab with 401 error code. Please verify which API you are calling. I believe that API you are calling from your custom widget.

Once you identity API details and its corresponding code(about invoking) please share that.

Regards,
Darpan

Hi Darpan,

When I click cancel below screenshot from my network tab.

Hi Saif,

Please verify that user has necessary write/Admin permissions for inventory service.
And also verify that you are invoking inventory api using standard cumulocity client api.

If problem persist, please share sample code about how are you invoking api from your custom widget.
You can also refer demo widget where there is an example for inventory api.

Regards,
Darpan

FYI the problem is that the standard Angular HTTP client was used which is not configured to provide an Authorization header. Using the FetchClient from c8y/client should solve this issue.

1 Like