05-27-2021 07:11 AM
Hey everyone. I am developing a CVP 11.6 application that needs to authenticate a REST API. The token is only valid for a short time before needing to be regenerated. While I am able to check for a 401 and POST credentials to generate a new token I am wondering if there is a way to have the app store that new token for subsequent calls. If not, would it be possible to store the new value back in ICM and have new calls use the value from there (unlikely, I assume) or would it need to be stored elsewhere (database?) and then pulled in? Any guidance would be appreciated.
Solved! Go to Solution.
05-28-2021 08:17 AM
You could certainly pass the information back to ICM, write it in a global variable for all future calls to use that gets passed into your CVP application. Then, when your information needs to get refreshed again, have that global variable be overwritten in ICM with the new value. Basically, have a check in ICM when the cal comes out of your application on whether that global variable needs to be updated.
05-28-2021 03:46 AM
If you want to persist data across sessions you can store it in Application or Global data depending on the scope you need. It's just a Java object that is stored so very flexible although you will have to use the API and a custom element to store and retrieve. For convenience, there's some custom elements here for handling common data -- you can use as is or as an example for building your own.
05-28-2021 08:17 AM
You could certainly pass the information back to ICM, write it in a global variable for all future calls to use that gets passed into your CVP application. Then, when your information needs to get refreshed again, have that global variable be overwritten in ICM with the new value. Basically, have a check in ICM when the cal comes out of your application on whether that global variable needs to be updated.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide