# get_first_allowed_auth_descriptor · FT4 Rell API · Chromia Docs (concept)

> function get_ first_ allowed_ auth_ descriptor(op_ name: text, args: gtv, account_ id: byte_ array, ad_ ids: list<byte_ array>): byte_ array? Calculates th

Source: https://docs.chromia.com/pages/ft4-rell/-f-t4-library/lib.ft4.core.auth/get_first_allowed_auth_descriptor/

FUNCTION

# get\_first\_allowed\_auth\_descriptor

```signature
function get_first_allowed_auth_descriptor(op_name: text, args: gtv, account_id: byte_array, ad_ids: list<byte_array>): byte_array?
```

[Source](https://gitlab.com/chromaway/ft4-lib/-/blob/development/rell/src/lib/ft4/core/auth/authentication.rell#lines-221)

Calculates the best auth descriptor to use for the given account when calling the given
operation with the given arguments. It assumes that the auth descriptors have all the
required auth flags.

If the operation has an auth handler with a resolver function, it will be used to decide
which auth descriptor to return. Otherwise, the first auth descriptor on the list will be
returned.

If no auth descriptor is returned but `ad_ids` is not empty, the auth handler resolver
function is to blame.

Throws if the auth handler for this operation is not found or its resolver is a function
that throws.

**Parameters**

* **op\_name** — the name of the operation to call
* **args** — the arguments for the operation
* **account\_id** — the account that will call the operation
* **ad\_ids** — the list of auth descriptors that can be used for authenticating

**See Also**

* [\_auth\_handler](https://docs.chromia.com/pages/ft4-rell/-f-t4-library/lib.ft4.core.auth/_auth_handler/) — for more information on auth handlers

[View this page on docs.chromia.com](https://docs.chromia.com/pages/ft4-rell/-f-t4%20-library/lib.ft4.core.auth/get_first_allowed_auth_descriptor.html)Generated API reference, mirrored from the live docs
