# Update Security Token in Report Service

Discover how to specify a security token at runtime to improve your application's security measures efficiently.

## Content



The Js Viewer allows to specify a security token during creation. However, sometimes you may need to change a security token at run time. To do so, you should use the [onRequest](/activereportsnet/docs/v19.2/developers/create-applications/js-viewer-application/jsviewer-api#onrequest) handler as demonstrated in the example below:

```html
const viewer = GrapeCity.ActiveReports.JSViewer.create({
  element: '#root',
  reportService: {
    onRequest: (init) => alert(init.credentials),
  },
});
```
