Sun Java System Access Manager 7.1 C API Reference

Authentication Data Types

The authentication types defined in <am_auth.h> are:

am_auth_context_t

Pointer to the authentication context object representing the details of an authentication action.

Syntax

#include "am_auth.h"
typedef struct am_auth_context *am_auth_context_t;

Members

am_auth_context is an opaque structure with no accessible members.

Memory Concerns

The implementation takes care of creating memory.

am_auth_callback_t

Primary callback type for authentication.

Details

am_auth_callback_t interacts with the calling application, allowing for the retrieval of specific authentication data (such as user name and password), or the display of error, warning or informational messages. It does not technically retrieve or display the information but provides the means to pass requests between an application and the Access Manager Authentication Service. struct am_auth_callback is a C implementation of the Java javax.security.auth.callback package. The Java API Reference for this package can be found at http://java.sun.com/j2se/1.5.0/docs/api/.

Syntax

#include "am_auth.h"
typedef struct am_auth_callback {
    am_auth_callback_type_t callback_type;
    union am_auth_callback_info {
        am_auth_choice_callback_t choice_callback;
        am_auth_confirmation_callback_t confirmation_callback;
        am_auth_language_callback_t language_callback;
        am_auth_name_callback_t name_callback;
        am_auth_password_callback_t password_callback;
        am_auth_text_input_callback_t text_input_callback;
        am_auth_text_output_callback_t text_output_callback;
    } callback_info;
} am_auth_callback_t;

Members

callback_type

Indicates the kind of callback that will be used. Each callback_type has a defined structure with a response field to submit authentication credentials. The value of callback_type determines the member of the union defined for the callback_info member. The possible values are defined in the enumeration:

typedef enum am_auth_callback_type {
    ChoiceCallback = 0,
    ConfirmationCallback,
    LanguageCallback,
    NameCallback,
    PasswordCallback,
    TextInputCallback,
    TextOutputCallback
} am_auth_callback_type_t;

Note –

Each callback_type corresponds to the callback class of the same name in the Java javax.security.auth.callback package. The Java API Reference for this package can be found at http://java.sun.com/j2se/1.5.0/docs/api/.


callback_info

Represents the defined callback_type. More information on the specific callbacks can be found in Authentication Callback Data Types.

Memory Concerns

Memory for the callback members is allocated in the am_auth_login() call, and freed in the am_auth_destroy_auth_context() call. Memory for the response field, though, must be allocated and freed by the caller.

am_auth_locale_t

Data type that holds the attributes that define the locale retrieved in am_auth_language_callback_t.

Details

For more information, see am_auth_language_callback_t.

Syntax

#include "am_auth.h"
typedef struct am_auth_locale {
    const char *language;
    const char *country;
    const char *variant;
} am_auth_locale_t;

Members

language

Pointer to a valid lower case, two-character ISO—639 language code as defined at http://www.ics.uci.edu/pub/ietf/http/related/iso639.txt.

country

Pointer to a valid upper case, two-character ISO—3166 country code as defined at http://www.chemie.fu-berlin.de/diverse/doc/ISO_3166.html.

variant

Pointer to a vendor or browser-specific character code. For example, WIN for Windows, MAC for Macintosh, and POSIX for POSIX.