Sun Java System Access Manager 7.1 C API Reference

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.