AgsAuthentication

AgsAuthentication — base password authentication

Functions

Types and Values

Object Hierarchy

    GInterface
    ╰── AgsAuthentication

Known Implementations

AgsAuthentication is implemented by AgsXmlAuthentication.

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

Since: 1.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

 

security_token

return location of the security token

 

error

the GError

 

Returns

TRUE on success, otherwise FALSE

Since: 1.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: 1.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

Since: 1.0.0


ags_authentication_get_groups ()

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

Get groups.

Parameters

authentication

the AgsAuthentication

 

security_context

the AgsSecurityContext

 

login

the login

 

security_token

the security token

 

error

the GError

 

Returns

a NULL-terminated string array containing groups

Since: 1.0.0


ags_authentication_get_permission ()

gchar *
ags_authentication_get_permission (AgsAuthentication *authentication,
                                   GObject *security_context,
                                   gchar *login,
                                   gchar *security_token,
                                   gchar *group_name,
                                   GError **error);

Get permission of group.

Parameters

authentication

the AgsAuthentication

 

security_context

the AgsSecurityContext

 

login

the login

 

security_token

the security token

 

group_name

the group name to query

 

error

the GError

 

Returns

one or more of 'r', 'w' and 'x'.

Since: 1.0.0


ags_authentication_is_session_active ()

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

Check session.

Parameters

authentication

the AgsAuthentication

 

security_context

the AgsSecurityContext

 

login

the login

 

security_token

the security token

 

error

the GError

 

Returns

TRUE if session active, otherwise FALSE

Since: 1.0.0


AGS_AUTHENTICATION()

#define AGS_AUTHENTICATION(obj)                    (G_TYPE_CHECK_INSTANCE_CAST((obj), AGS_TYPE_AUTHENTICATION, AgsAuthentication))

AGS_AUTHENTICATION_GET_INTERFACE()

#define AGS_AUTHENTICATION_GET_INTERFACE(obj)      (G_TYPE_INSTANCE_GET_INTERFACE((obj), AGS_TYPE_AUTHENTICATION, AgsAuthenticationInterface))

AGS_AUTHENTICATION_INTERFACE()

#define AGS_AUTHENTICATION_INTERFACE(vtable)       (G_TYPE_CHECK_CLASS_CAST((vtable), AGS_TYPE_AUTHENTICATION, AgsAuthenticationInterface))

AGS_IS_AUTHENTICATION()

#define AGS_IS_AUTHENTICATION(obj)                 (G_TYPE_CHECK_INSTANCE_TYPE((obj), AGS_TYPE_AUTHENTICATION))

AGS_IS_AUTHENTICATION_INTERFACE()

#define AGS_IS_AUTHENTICATION_INTERFACE(vtable)    (G_TYPE_CHECK_CLASS_TYPE((vtable), AGS_TYPE_AUTHENTICATION))

ags_authentication_get_type ()

GType
ags_authentication_get_type ();

Types and Values

AGS_TYPE_AUTHENTICATION

#define AGS_TYPE_AUTHENTICATION                    (ags_authentication_get_type())

AgsAuthentication

typedef struct _AgsAuthentication AgsAuthentication;

struct AgsAuthenticationInterface

struct AgsAuthenticationInterface {
  GTypeInterface interface;
  
  gchar** (*get_authentication_module)(AgsAuthentication *authentication);
  
  gboolean (*login)(AgsAuthentication *authentication,
		    gchar *login, gchar *password,
		    gchar **user_uuid, gchar **security_token,
		    GError **error);

  gboolean (*logout)(AgsAuthentication *authentication,
		     GObject *security_context,
		     gchar *login,
		     gchar *security_token,
		     GError **error);
  
  gchar* (*generate_token)(AgsAuthentication *authentication,
			   GError **error);
  
  gchar** (*get_groups)(AgsAuthentication *authentication,
			GObject *security_context,
			gchar *login,
			gchar *security_token,
			GError **error);

  gchar* (*get_permission)(AgsAuthentication *authentication,
			   GObject *security_context,
			   gchar *login,
			   gchar *security_token,
			   gchar *group_name,
			   GError **error);

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