> ## Documentation Index
> Fetch the complete documentation index at: https://developers.stellar.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Sign authorization entries

> Use Varial's API to sign an authorization entry

In order to take advantage of [contract authorization](https://developers.stellar.org/docs/learn/fundamentals/contract-development/authorization.md), you can use Varial's API to sign an authorization entry. A good example of how signing an authorization entry works can be found in the [`authorizeEntry` helper of `stellar-sdk`](https://github.com/stellar/js-stellar-base/blob/e3d6fc3351e7d242b374c7c6057668366364a279/src/auth.js#L97).

Like in the helper, you can construct a [`HashIdPreimageSorobanAuthorization`](https://github.com/stellar/js-stellar-base/blob/a9567e5843760bfb6a8b786592046aee4c9d38b2/types/next.d.ts#L6895) and use the xdr representation of that structure to call `await varialSdk.signAuthEntry(preimageXdr)` (from `@stellar/varial-sdk`). This call will return an object whose `signedAuthEntry` field holds the signed hash of the `HashIdPreimageSorobanAuthorization` passed in, as a base64 string, which can then be used to submit to the network during a contract authorization workflow.
