Camel.Session.get_password

### Method

# Camel Sessionget_password

#### Declaration [src]

    gchar*
    camel_session_get_password (
      CamelSession* session,
      CamelService* service,
      const gchar* prompt,
      const gchar* item,
      guint32 flags,
      GError** error
    )

#### Description [src]

This function is used by a `CamelService` to ask the application and the user for a password or other authentication data.

`service` and `item` together uniquely identify the piece of data the caller is concerned with.

`prompt` is a question to ask the user (if the application doesn’t already have the answer cached). If `CAMEL_SESSION_PASSWORD_SECRET` is set, the user’s input will not be echoed back.

If `CAMEL_SESSION_PASSWORD_STATIC` is set, it means the password returned will be stored statically by the caller automatically, for the current session.

The authenticator should set `error` to `G_IO_ERROR_CANCELLED` if the user did not provide the information. The caller must `g_free()` the information returned when it is done with it.

#### Parameters

`service`

  Type: `CamelService`

  The `CamelService` this query is being made by.

  The data is owned by the caller of the method.

`prompt`

  Type: `const gchar*`

  Prompt to provide to user.

  The data is owned by the caller of the method.
  The value is a NUL terminated UTF-8 string.

`item`

  Type: `const gchar*`

  An identifier, unique within this service, for the information.

  The data is owned by the caller of the method.
  The value is a NUL terminated UTF-8 string.

`flags`

  Type: `guint32`

  `CAMEL_SESSION_PASSWORD_REPROMPT`, the prompt should force a reprompt `CAMEL_SESSION_PASSWORD_SECRET`, whether the password is secret `CAMEL_SESSION_PASSWORD_STATIC`, the password is remembered externally.

`error`

  Type: `GError **`

  The return location for a recoverable error.

  The argument can be `NULL`.
  If the return location is not `NULL`, then you must initialize it to a `NULL` `GError*`.
  The argument will be left initialized to `NULL` by the method if there are no errors.
  In case of error, the argument will be set to a newly allocated `GError`; the caller will take ownership of the data, and be responsible for freeing it.

#### Return value

Type: `gchar*`

The authentication information or `NULL` on error.

The caller of the method takes ownership of the returned data, and is responsible for freeing it.
The value is a NUL terminated UTF-8 string.