---
name: "sasl_canon_user_t"
section: "3"
platform: "linux"
package: "libsasl2-dev"
version: "2.1.28+dfsg1-9"
release: "Debian 13 (Trixie)"
platforms: ["linux", "macos"]
url: "https://new.carta.tech/sasl_canon_user_t"
---

# sasl\_canon\_user\_t(3)

Cyrus SASL documentation

## NAME

sasl\_canon\_user\_t - Cyrus SASL documentation

## SYNOPSIS

```
#include <sasl/sasl.h>
int sasl_canon_user_t(sasl_conn_t *conn, void *context, const char *user, unsigned ulen,
                      unsigned flags, const char *user_realm, char *out_user,
                      unsigned out_umax, unsigned *out_ulen)
```

## DESCRIPTION

- **int sasl\_canon\_user\_t(sasl\_conn\_t \*conn,**

  - **void \*context,**

  - **const char \*user,**

  - **unsigned ulen,**

  - **unsigned flags,**

  - **const char \*user\_realm,**

  - **char \*out\_user,**

  - **unsigned out\_umax,**

  - **unsigned \*out\_ulen)**

  **sasl\_canon\_user\_t** is the callback for an  application-supplied  user  canonicalization  function.  This function is subject to the requirements that all user canonicalization functions  are:  It  must  copy the result into the output buffers, but the output buffers and the input buffers  may be the same.

  - **Parameters**

    - •

      **context** – context from the callback record

    - •

      **user** – un-canonicalized username

    - •

      **ulen** – length of user

    - •

      **flags** – Either SASL\_CU\_AUTHID (indicating the authentication ID is being canonicalized) or SASL\_CU\_AUTHZID  (indicating the  authorization ID is to be canonicalized) or a bitwise OR of the the two.

    - •

      **user\_realm** – Realm of authentication.

    - •

      **out\_user** – The output buffer for the canonicalized username

    - •

      **out\_umax** – Maximum length for out\_user

    - •

      **out\_ulen** – Actual length of out\_user

  - **Returns**

    *SASL\_OK* indicates success. See *[sasl\_errors(3)](/sasl_errors/3.md)* for a full list of SASL error codes.

## CONFORMING TO

*RFC 4422*

## SEE ALSO

*[sasl(3)](/sasl/3.md)*, *[sasl\_errors(3)](/sasl_errors/3.md)*, *[sasl\_callbacks(3)](/sasl_callbacks/3.md)*

## AUTHOR

The Cyrus Team

## COPYRIGHT

1993-2016, The Cyrus Team
