---
name: "krb5_get_init_creds_opt_set_address_list"
section: "3"
platform: "linux"
package: "heimdal-dev"
version: "7.8.git20221117.28daf24+dfsg-9+deb13u1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/krb5_get_init_creds_opt_set_address_list"
---

# krb5\_get\_init\_creds\_opt\_set\_address\_list(3)

Kerberos 5 initial authentication functions

## NAME

**krb5\_get\_init\_creds**, **krb5\_get\_init\_creds\_keytab**, **krb5\_get\_init\_creds\_opt**, **krb5\_get\_init\_creds\_opt\_alloc**, **krb5\_get\_init\_creds\_opt\_free**, **krb5\_get\_init\_creds\_opt\_init**, **krb5\_get\_init\_creds\_opt\_set\_address\_list**, **krb5\_get\_init\_creds\_opt\_set\_addressless**, **krb5\_get\_init\_creds\_opt\_set\_anonymous**, **krb5\_get\_init\_creds\_opt\_set\_default\_flags**, **krb5\_get\_init\_creds\_opt\_set\_etype\_list**, **krb5\_get\_init\_creds\_opt\_set\_forwardable**, **krb5\_get\_init\_creds\_opt\_set\_pa\_password**, **krb5\_get\_init\_creds\_opt\_set\_paq\_request**, **krb5\_get\_init\_creds\_opt\_set\_preauth\_list**, **krb5\_get\_init\_creds\_opt\_set\_proxiable**, **krb5\_get\_init\_creds\_opt\_set\_renew\_life**, **krb5\_get\_init\_creds\_opt\_set\_salt**, **krb5\_get\_init\_creds\_opt\_set\_tkt\_life**, **krb5\_get\_init\_creds\_opt\_set\_canonicalize**, **krb5\_get\_init\_creds\_opt\_set\_win2k**, **krb5\_get\_init\_creds\_password**, **krb5\_prompt**, **krb5\_prompter\_posix** – Kerberos 5 initial authentication functions

## LIBRARY

Kerberos 5 Library (libkrb5, -lkrb5)

## SYNOPSIS

**#include \<krb5.h\>**

*krb5\_get\_init\_creds\_opt;*\

*krb5\_error\_code*\

**krb5\_get\_init\_creds\_opt\_alloc**(*krb5\_context context*, *krb5\_get\_init\_creds\_opt \*\*opt*);

*void*\

**krb5\_get\_init\_creds\_opt\_free**(*krb5\_context context*, *krb5\_get\_init\_creds\_opt \*opt*);

*void*\

**krb5\_get\_init\_creds\_opt\_init**(*krb5\_get\_init\_creds\_opt \*opt*);

*void*\

**krb5\_get\_init\_creds\_opt\_set\_address\_list**(*krb5\_get\_init\_creds\_opt \*opt*, *krb5\_addresses \*addresses*);

*void*\

**krb5\_get\_init\_creds\_opt\_set\_addressless**(*krb5\_get\_init\_creds\_opt \*opt*, *krb5\_boolean addressless*);

*void*\

**krb5\_get\_init\_creds\_opt\_set\_anonymous**(*krb5\_get\_init\_creds\_opt \*opt*, *int anonymous*);

*void*\

**krb5\_get\_init\_creds\_opt\_set\_change\_password\_prompt**(*krb5\_get\_init\_creds\_opt \*opt*, *int change\_password\_prompt*);

*void*\

**krb5\_get\_init\_creds\_opt\_set\_default\_flags**(*krb5\_context context*, *const char \*appname*, *krb5\_const\_realm realm*, *krb5\_get\_init\_creds\_opt \*opt*);

*void*\

**krb5\_get\_init\_creds\_opt\_set\_etype\_list**(*krb5\_get\_init\_creds\_opt \*opt*, *krb5\_enctype \*etype\_list*, *int etype\_list\_length*);

*void*\

**krb5\_get\_init\_creds\_opt\_set\_forwardable**(*krb5\_get\_init\_creds\_opt \*opt*, *int forwardable*);

*krb5\_error\_code*\

**krb5\_get\_init\_creds\_opt\_set\_pa\_password**(*krb5\_context context*, *krb5\_get\_init\_creds\_opt \*opt*, *const char \*password*, *krb5\_s2k\_proc key\_proc*);

*krb5\_error\_code*\

**krb5\_get\_init\_creds\_opt\_set\_paq\_request**(*krb5\_context context*, *krb5\_get\_init\_creds\_opt \*opt*, *krb5\_boolean req\_pac*);

*krb5\_error\_code*\

**krb5\_get\_init\_creds\_opt\_set\_pkinit**(*krb5\_context context*, *krb5\_get\_init\_creds\_opt \*opt*, *const char \*cert\_file*, *const char \*key\_file*, *const char \*x509\_anchors*, *int flags*, *char \*password*);

*void*\

**krb5\_get\_init\_creds\_opt\_set\_preauth\_list**(*krb5\_get\_init\_creds\_opt \*opt*, *krb5\_preauthtype \*preauth\_list*, *int preauth\_list\_length*);

*void*\

**krb5\_get\_init\_creds\_opt\_set\_proxiable**(*krb5\_get\_init\_creds\_opt \*opt*, *int proxiable*);

*void*\

**krb5\_get\_init\_creds\_opt\_set\_renew\_life**(*krb5\_get\_init\_creds\_opt \*opt*, *krb5\_deltat renew\_life*);

*void*\

**krb5\_get\_init\_creds\_opt\_set\_salt**(*krb5\_get\_init\_creds\_opt \*opt*, *krb5\_data \*salt*);

*void*\

**krb5\_get\_init\_creds\_opt\_set\_tkt\_life**(*krb5\_get\_init\_creds\_opt \*opt*, *krb5\_deltat tkt\_life*);

*krb5\_error\_code*\

**krb5\_get\_init\_creds\_opt\_set\_canonicalize**(*krb5\_context context*, *krb5\_get\_init\_creds\_opt \*opt*, *krb5\_boolean req*);

*krb5\_error\_code*\

**krb5\_get\_init\_creds\_opt\_set\_win2k**(*krb5\_context context*, *krb5\_get\_init\_creds\_opt \*opt*, *krb5\_boolean req*);

*krb5\_error\_code*\

**krb5\_get\_init\_creds**(*krb5\_context context*, *krb5\_creds \*creds*, *krb5\_principal client*, *krb5\_prompter\_fct prompter*, *void \*prompter\_data*, *krb5\_deltat start\_time*, *const char \*in\_tkt\_service*, *krb5\_get\_init\_creds\_opt \*options*);

*krb5\_error\_code*\

**krb5\_get\_init\_creds\_password**(*krb5\_context context*, *krb5\_creds \*creds*, *krb5\_principal client*, *const char \*password*, *krb5\_prompter\_fct prompter*, *void \*prompter\_data*, *krb5\_deltat start\_time*, *const char \*in\_tkt\_service*, *krb5\_get\_init\_creds\_opt \*in\_options*);

*krb5\_error\_code*\

**krb5\_get\_init\_creds\_keytab**(*krb5\_context context*, *krb5\_creds \*creds*, *krb5\_principal client*, *krb5\_keytab keytab*, *krb5\_deltat start\_time*, *const char \*in\_tkt\_service*, *krb5\_get\_init\_creds\_opt \*options*);

*int*\

**krb5\_prompter\_posix**(*krb5\_context context*, *void \*data*, *const char \*name*, *const char \*banner*, *int num\_prompts*, *krb5\_prompt prompts\[\]*);

## DESCRIPTION

Getting initial credential ticket for a principal. That may include changing an expired password, and doing preauthentication. This interface that replaces the deprecated *krb5\_in\_tkt* and *krb5\_in\_cred* functions.

If you only want to verify a username and password, consider using [krb5\_verify\_user(3)](/krb5_verify_user/3.md) instead, since it also verifies that initial credentials with using a keytab to make sure the response was from the KDC.

First a krb5\_get\_init\_creds\_opt structure is initialized with **krb5\_get\_init\_creds\_opt\_alloc**() or **krb5\_get\_init\_creds\_opt\_init**(). **krb5\_get\_init\_creds\_opt\_alloc**() allocates a extendible structures that needs to be freed with **krb5\_get\_init\_creds\_opt\_free**(). The structure may be modified by any of the **krb5\_get\_init\_creds\_opt\_set**() functions to change request parameters and authentication information.

If the caller want to use the default options, NULL can be passed instead.

The the actual request to the KDC is done by any of the **krb5\_get\_init\_creds**(), **krb5\_get\_init\_creds\_password**(), or **krb5\_get\_init\_creds\_keytab**() functions. **krb5\_get\_init\_creds**() is the least specialized function and can, with the right in data, behave like the latter two. The latter two are there for compatibility with older releases and they are slightly easier to use.

krb5\_prompt is a structure containing the following elements:

```
typedef struct {
    const char *prompt;
    int hidden;
    krb5_data *reply;
    krb5_prompt_type type
} krb5_prompt;
```

*prompt* is the prompt that should shown to the user If *hidden* is set, the prompter function shouldn't echo the output to the display device. *reply* must be preallocated; it will not be allocated by the prompter function. Possible values for the *type* element are:

- KRB5\_PROMPT\_TYPE\_PASSWORD

  - KRB5\_PROMPT\_TYPE\_NEW\_PASSWORD

  - KRB5\_PROMPT\_TYPE\_NEW\_PASSWORD\_AGAIN

  - KRB5\_PROMPT\_TYPE\_PREAUTH

  - KRB5\_PROMPT\_TYPE\_INFO

  **krb5\_prompter\_posix**() is the default prompter function in a POSIX environment. It matches the *krb5\_prompter\_fct* and can be used in the *krb5\_get\_init\_creds* functions. **krb5\_prompter\_posix**() doesn't require *prompter\_data.*

If the *start\_time* is zero, then the requested ticket will be valid beginning immediately. Otherwise, the *start\_time* indicates how far in the future the ticket should be postdated.

If the *in\_tkt\_service* name is non-NULL, that principal name will be used as the server name for the initial ticket request. The realm of the name specified will be ignored and will be set to the realm of the client name. If no in\_tkt\_service name is specified, krbtgt/CLIENT-REALM@CLIENT-REALM will be used.

For the rest of arguments, a configuration or library default will be used if no value is specified in the options structure.

**krb5\_get\_init\_creds\_opt\_set\_address\_list**() sets the list of *addresses* that is should be stored in the ticket.

**krb5\_get\_init\_creds\_opt\_set\_addressless**() controls if the ticket is requested with addresses or not, **krb5\_get\_init\_creds\_opt\_set\_address\_list**() overrides this option.

**krb5\_get\_init\_creds\_opt\_set\_anonymous**() make the request anonymous if the *anonymous* parameter is non-zero.

**krb5\_get\_init\_creds\_opt\_set\_default\_flags**() sets the default flags using the configuration file.

**krb5\_get\_init\_creds\_opt\_set\_etype\_list**() set a list of enctypes that the client is willing to support in the request.

**krb5\_get\_init\_creds\_opt\_set\_forwardable**() request a forwardable ticket.

**krb5\_get\_init\_creds\_opt\_set\_pa\_password**() set the *password* and *key\_proc* that is going to be used to get a new ticket. *password* or *key\_proc* can be NULL if the caller wants to use the default values. If the *password* is unset and needed, the user will be prompted for it.

**krb5\_get\_init\_creds\_opt\_set\_paq\_request**() sets the password that is going to be used to get a new ticket.

**krb5\_get\_init\_creds\_opt\_set\_preauth\_list**() sets the list of client-supported preauth types.

**krb5\_get\_init\_creds\_opt\_set\_proxiable**() makes the request proxiable.

**krb5\_get\_init\_creds\_opt\_set\_renew\_life**() sets the requested renewable lifetime.

**krb5\_get\_init\_creds\_opt\_set\_salt**() sets the salt that is going to be used in the request.

**krb5\_get\_init\_creds\_opt\_set\_tkt\_life**() sets requested ticket lifetime.

**krb5\_get\_init\_creds\_opt\_set\_canonicalize**() requests that the KDC canonicalize the client principal if possible.

**krb5\_get\_init\_creds\_opt\_set\_win2k**() turns on compatibility with Windows 2000.

## SEE ALSO

[krb5(3)](/krb5/3.md), [krb5\_creds(3)](/krb5_creds/3.md), [krb5\_verify\_user(3)](/krb5_verify_user/3.md), [krb5.conf(5)](/krb5.conf/5.md), [kerberos(8)](/kerberos/8.md)
