Sun Java System Access Manager 7 2005Q4 C API Reference

am_auth_choice_callback

Choice authentication callback structure.

This is a C implementation of the javax.security.auth.callback.ChoiceCallback class used to submit authentication callback requirements to the Access Manager Authentication service.

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

This structure should be used if the callback_type is ChoiceCallback used to submit authentication callback requirements to the Access Manager authentication service.

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

It has the following members:

prompt

Prompt to describe the list of choices.

allow_multiple_selections

True if this choice allows multiple selections.

choices

Choices for this choice callback. The number of choices is indicated in the choices_size field. Memory for choices list is allocated by the C SDK in am_auth_login() and is freed by the C SDK when the authentication context is destroyed using am_auth_destroy_auth_context().

choices_size

Number of choices in the choices field.

default_choice

Default choice, as an index into the choices list.

response

Selected choices.

Memory for the response must be allocated and freed by the caller.

response_size

The number of selected choices in the response.

Details

See am_auth_test.c in the C SDK samples for an example of how to use the choice callback.