## AgsAuthentication

AgsAuthentication — base password authentication

## Stability Level

Stable, unless otherwise indicated

## Functions

gchar ** | ags_authentication_get_authentication_module ()
gboolean | ags_authentication_login ()
gboolean | ags_authentication_logout ()
gchar * | ags_authentication_generate_token ()
gchar * | ags_authentication_get_digest ()
gboolean | ags_authentication_is_session_active ()

## Object Hierarchy

        GInterface
        ╰── AgsAuthentication

## Includes

    #include <ags/server/security/ags_authentication.h>

## Description

The AgsAuthentication interface gives you base authentication functions.

## Functions

### ags_authentication_get_authentication_module ()

    gchar **
    ags_authentication_get_authentication_module
                                   (AgsAuthentication *authentication);

Available authentication modules.

#### Parameters

authentication | the AgsAuthentication |

#### Returns

a `NULL` terminated array of strings of available authentication modules.

[element-type utf8][array zero-terminated=1][transfer full]

Since: 3.0.0

### ags_authentication_login ()

    gboolean
    ags_authentication_login (AgsAuthentication *authentication,
                              gchar *login,
                              gchar *password,
                              gchar **user_uuid,
                              gchar **security_token,
                              GError **error);

Login.

#### Parameters

authentication | the AgsAuthentication |
login | the login |
password | the password |
user_uuid | return location of the user's uuid. | [out][transfer full]
security_token | return location of the security token. | [out][transfer full]
error | the GError |

#### Returns

`TRUE` on success, otherwise `FALSE`

Since: 3.0.0

### ags_authentication_logout ()

    gboolean
    ags_authentication_logout (AgsAuthentication *authentication,
                               GObject *security_context,
                               gchar *login,
                               gchar *security_token,
                               GError **error);

Logout.

#### Parameters

authentication | the AgsAuthentication |
security_context | the AgsSecurityContext |
login | the login |
security_token | the security token |
error | the GError |

#### Returns

`TRUE` on success, otherwise `FALSE`

Since: 3.0.0

### ags_authentication_generate_token ()

    gchar *
    ags_authentication_generate_token (AgsAuthentication *authentication,
                                       GError **error);

Generate token.

#### Parameters

authentication | the AgsAuthentication |
error | the GError |

#### Returns

the generated token.

[transfer full]

Since: 3.0.0

### ags_authentication_get_digest ()

    gchar *
    ags_authentication_get_digest (AgsAuthentication *authentication,
                                   gchar *realm,
                                   gchar *login,
                                   gchar *security_token,
                                   GError **error);

Get digest of `login` .

#### Parameters

authentication | the AgsAuthentication |
realm | the realm |
login | the login |
security_token | the security token |
error | the GError |

#### Returns

the encrypted password.

[transfer full]

Since: 3.0.0

### ags_authentication_is_session_active ()

    gboolean
    ags_authentication_is_session_active (AgsAuthentication *authentication,
                                          GObject *security_context,
                                          gchar *user_uuid,
                                          gchar *security_token,
                                          GError **error);

Check session.

#### Parameters

authentication | the AgsAuthentication |
security_context | the AgsSecurityContext |
user_uuid | the user's UUID |
security_token | the security token |
error | the GError |

#### Returns

`TRUE` if session active, otherwise `FALSE`

Since: 3.0.0