# Embed SDK Authentication

Some methods are calling directly Toucan's API, such as:

* [sendPDFReport](https://docs-v3.toucantoco.com/visualizations-and-layouts/embedding/embed-sdk/..#sendpdfreport)
* [insertEmbedById](https://docs-v3.toucantoco.com/visualizations-and-layouts/embedding/embed-sdk/..#insertembedbyid)

If you want to use those methods, you need to pass an authentication token when initializing the SDK. It requires an opaque token, follow the steps to [authenticate embeds](https://docs-v3.toucantoco.com/visualizations-and-layouts/embedding/authentication).

As JWT token's payload embed\_context, we recommend to use:

{% code lineNumbers="true" %}

```javascript
{
  // to get from admin inteface
  "iss": "ISS"
  // to get from admin interface
  "aud": "OAUTH_URL/TENAN_ID/oauth/oauth-token",
  // when you want the token to expire, in seconds since 1970-01-01
  "exp": 0,
  "sub": "toucan-embed-client",
  "embed_context": {
    "username": "SDK_TOKEN",
    // to get from admin interface
    "workspace_id": "WORKSPACE_ID"
    "roles": ["ADMIN"],
    // ADMIN role grant access to all apps
    "privileges": {},
    "groups": [],
    "attributes": {}
  }
}
```

{% endcode %}
