Contents

GetContextValue

Reads a value collected during authorization.

Declaration

int (*)(struct __OpaqueAuthorizationEngine *, const char *, enum AuthorizationContextFlags *, const struct AuthorizationValue **) GetContextValue;

Parameters

  • inEngine:

    An opaque handle that is passed to your plug-in when the authorization engine calls your Mechanismcreate function.

  • inKey:

    A key indicating which value you want to retrieve. This key must correspond to one you specified when you used the Setcontextvalue function to store a context value.

  • outContextFlags:

    On output points to a flag that indicates whether this value is available to the authorization client.

  • outValue:

    On input, allocate a pointer to an Authorizationvalue structure. On output, the structure contains the size of the data and a pointer to the data. Because your Authorizationvalue structure does not own the data, you must not deallocate the structure or the data pointed to by the structure.

Mentioned in

Return Value

A result code. Possible results are errAuthorizationSuccess (no error) and errAuthorizationInternal (Security Server internal error).

Discussion

Your plug-in authorization mechanism might collect data such as the user name and other authentication information during evaluation of authorization. You can use the SetContextValue function to have the Security Server store this data and the GetContextValue function to retrieve it.

The authorization engine sends you the entry point to the GetContextValue function in an AuthorizationCallbacks structure when you call the AuthorizationPluginCreate function.