Sun Java System Access Manager 7.1 C API Reference

Authentication Callback Data Types

This section contains further details on the callback types as discussed in am_auth_callback_t. They are:


Note –

Each 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/.


am_auth_choice_callback_t

Displays a list of choices and submits the selection back to the Access Manager Authentication Service.

Details

am_auth_choice_callback_t is a C implementation of the Java javax.security.auth.callback.ChoiceCallback class.

Syntax

#include "am_auth.h"
typedef struct am_auth_choice_callback {
    const char *prompt;
    boolean_t allow_multiple_selections;
    const char **choices;
    size_t choices_size;
    size_t default_choice;
    const char **response; /* selected indexes */
    size_t response_size;
} am_auth_choice_callback_t;

Members

prompt

Pointer to the user's prompt.

allow_multiple_selections

Takes a value based on the boolean_t defined in the <am_types.h> header file. Set to B_TRUE if multiple selections can be made.

choices

Pointer to a pointer to the strings for the different choices.

choices_size

Value based on the size_t defined in the standard <stddef.h> header file that reflects the number of choices in the list.

default_choice

Takes a value based on the size_t defined in the standard <stddef.h> header file that reflects the choice selected by default when the list is displayed.

response

Pointer to a pointer to the choice(s) returned to Access Manager.

response_size

Takes a value based on the size_t defined in the standard <stddef.h> header file that reflects the number of selected choices in the response.

Memory Concerns

Memory for the choices list is allocated by am_auth_login(), and freed by calling am_auth_destroy_auth_context(). Memory for the response must be allocated and freed by the caller.

am_auth_confirmation_callback_t

Requests YES/NO, OK/CANCEL, YES/NO/CANCEL or similar confirmations.

Details

am_auth_confirmation_callback_t is a C implementation of the Java javax.security.auth.callback.ConfirmationCallback class.

Syntax

#include "am_auth.h"
typedef struct am_auth_confirmation_callback_info {
    const char *prompt;
    const char *message_type;
    const char *option_type;
    const char **options;
    size_t options_size;
    const char *default_option;
    const char *response; /* selected index */
} am_auth_confirmation_callback_t;

Members

prompt

Pointer to the user's prompt.

message_type

Pointer to the message type defined as INFORMATION, WARNING or ERROR.

option_type

Pointer to the option type defined as YES_NO_OPTION, YES_NO_CANCEL_OPTION, OK_CANCEL_OPTION, or UNSPECIFIED.

options

Pointer to a pointer to a list of confirmation options, or NULL if the callback was instantiated with an option_type.

options_size

Takes a value based on the size_t defined in the standard <stddef.h> header file that reflects the number of options in the list.

default_option

Pointer to the option selected by default when the list is displayed.

response

Pointer to the choice returned to Access Manager.

Memory Concerns

Memory is allocated by am_auth_login(), and freed by calling am_auth_destroy_auth_context(). Memory for the response must be allocated and freed by the caller.

am_auth_language_callback_t

Retrieves the locale for localizing text.

Details

am_auth_language_callback_t is a C implementation of the Java javax.security.auth.callback.LanguageCallback class.


Note –

See am_auth_locale_t for the individual components.


Syntax

#include "am_auth.h"
typedef struct am_auth_language_callback_info {
    am_auth_locale_t *locale;
    am_auth_locale_t *response; /* locale */
} am_auth_language_callback_t;

Members

locale

Pointer to the am_auth_locale_t object defining the locale.

response

Pointer to the am_auth_locale_t object being submitted back to Access Manager.

Memory Concerns

Memory is allocated by am_auth_login(), and freed by calling am_auth_destroy_auth_context(). Memory for the response must be allocated and freed by the caller.

am_auth_name_callback_t

Retrieves user name information.

Details

am_auth_name_callback_t is a C implementation of the Java javax.security.auth.callback.NameCallback class.

Syntax

#include "am_auth.h"
typedef struct am_auth_name_callback_info {
    const char *prompt;
    const char *default_name;
    const char *response; /* name */
} am_auth_name_callback_t;

Members

prompt

Pointer to the user's prompt.

default_name

Pointer to the default name displayed with the user prompt, if any.

response

Pointer to the name submitted back to Access Manager.

Memory Concerns

Memory is allocated by am_auth_login(), and freed by calling am_auth_destroy_auth_context(). Memory for the response must be allocated and freed by the caller.

am_auth_password_callback_t

Retrieves user password information.

Details

am_auth_password_callback_t is a C implementation of the Java javax.security.auth.callback.PasswordCallback class.

Syntax

#include "am_auth.h"
typedef struct am_auth_password_callback_info {
    const char *prompt;
    boolean_t echo_on;
    const char *response; /* password */
} am_auth_password_callback_t;

Members

prompt

Pointer to the user's prompt.

echo_on

Takes a value based on the boolean_t defined in the <am_types.h> header file. Set to B_TRUE to display the password as it is typed.

response

Pointer to the password submitted back to Access Manager.

Memory Concerns

Memory is allocated by am_auth_login(), and freed by calling am_auth_destroy_auth_context(). Memory for the response must be allocated and freed by the caller.

am_auth_text_input_callback_t

Retrieves generic textual information.

Details

am_auth_text_input_callback_t is a C implementation of the Java javax.security.auth.callback.TextInputCallback class.

Syntax

#include "am_auth.h"
typedef struct am_auth_text_input_callback_info {
    const char *prompt;
    const char *default_text;
    const char *response; /* text */
} am_auth_text_input_callback_t;

Members

prompt

Pointer to the user's prompt.

default_text

Pointer to the default text to be displayed with the user prompt.

response

Pointer to the text submitted back to Access Manager.

Memory Concerns

Memory is allocated by am_auth_login(), and freed by calling am_auth_destroy_auth_context(). Memory for the response must be allocated and freed by the caller.

am_auth_text_output_callback_t

Displays information messages, warning messages, and error messages.

Details

am_auth_text_output_callback_t is a C implementation of the Java javax.security.auth.callback.TextOutputCallback class.

Syntax

#include "am_auth.h"
typedef struct am_auth_text_output_callback_info {
    const char *message;
    const char *message_type;
} am_auth_text_output_callback_t;

Members

message

Pointer to the message to be displayed.

message_type

Pointer to the message type: INFORMATION, WARNING, or ERROR.

Memory Concerns

Memory is allocated by am_auth_login(), and freed by calling am_auth_destroy_auth_context().