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

> function add_ auth_ handler(scope: text, flags: list<text>, message: (gtv) -> text?, resolver: (gtv, byte_ array, list<byte_ array>) -> byte_ array??): map

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

FUNCTION

# add\_auth\_handler

```signature
function add_auth_handler(scope: text, flags: list<text>, message: (gtv) -> text?, resolver: (gtv, byte_array, list<byte_array>) -> byte_array??): map<text, _auth_handler>
```

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

Utility function that allows easily adding an auth handler.
It should be used by dapps, while library developers should generally prefer using
`add_overridable_auth_handler` instead, allowing dapps to override the default handler.

Throws if `scope` is not valid

Example:

Plain text

```
operation my_op() { ... }
@extend(auth.auth_handler)
function () = auth.add_auth_handler(
    rell.meta(my_op).mount_name,
    flags,
    message_function,
    resolver_function
);
```

**Parameters**

* **scope** — The scope of the auth handler - either an operation name or a mount point
* **flags** — The `flags` parameter of the auth handler
* **message** — The `message` parameter of the auth handler
* **resolver** — The `resolver` parameter of the auth handler

**See Also**

* [\_auth\_handler](https://docs.chromia.com/pages/ft4-rell/-f-t4-library/lib.ft4.core.auth/_auth_handler/) — for more information on `flags`, `message` and `resolver`
* [get\_auth\_handler](https://docs.chromia.com/pages/ft4-rell/-f-t4-library/lib.ft4.core.auth/get_auth_handler/) — for a definition of auth handler scope

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