Contained WithinFind More DocumentationFeatured Support Resources | Download this book in PDF (1531 KB)
Chapter 8 Web Agent Data Types and FunctionsSun OpenSSO Enterprise contains public data types and functions intended for use by Sun web agents. They can also be used to develop proprietary web agents. Reference summaries include a short description, syntax, parameters and returns. Prototypes for the types and functions are contained in the <am_web.h> header file. This chapter contains the following sections: Web Agent API for CThe web agent application programming interface (API) for C are used by web agents to interact with OpenSSO Enterprise services such as the Authentication Service, the Session Service, the Policy Service, and the Logging Service. In order to use the data types and functions described herein, you should be familiar with web agents in general and how they work. The following books provide information for this purpose:
Web Agent Data TypesThe web agent data types defined in <am_web.h> are: am_web_add_header_in_response_tDefines a data type for the am_web_add_header_in_response_func_t function pointer. DetailsSee also am_web_add_header_in_response_func_t. Syntax#include "am_web.h"
typedef struct {
am_web_add_header_in_response_func_t func;
void **args;
} am_web_add_header_in_response_t;
MembersThe structure has the following components:
am_web_free_post_data_tDefines a data type for the am_web_free_post_data_t function pointer. DetailsSee also am_web_free_post_data_func_t. Syntax#include "am_web.h"
typedef struct {
am_web_free_post_data_func_t func;
void **args;
} am_web_free_post_data_t;
Membersam_web_free_post_data_t has the following components:
am_web_get_post_data_tDefines a data type for the am_web_get_post_data_t function pointer. DetailsSee also am_web_get_post_data_func_t. Syntax#include "am_web.h"
typedef struct {
am_web_get_post_data_func_t func;
void **args;
} am_web_get_post_data_t;
Membersam_web_get_post_data_t has the following components:
am_web_postcache_data_tData type for temporarily storing POST data sent by the web agent to the OpenSSO Enterprise Session Service. DetailsPolicy agents use the POST method to communicate with the Session Service. For information, see Session Validation in Sun OpenSSO Enterprise 8.0 Technical Overview. Syntax#include "am_web.h"
typedef struct am_web_postcache_data {
char *value;
char *url;
} am_web_postcache_data_t;
Membersam_web_postcache_data_t has the following components:
am_web_render_result_tDefines a data type for the am_web_render_result_func_t function pointer. DetailsSee also am_web_render_result_func_t. Syntax#include "am_web.h"
typedef struct {
am_web_render_result_func_t func;
void **args;
} am_web_render_result_t;
Membersam_web_render_result_t has the following components:
am_web_request_func_tDefines an all-inclusive data type for the function pointers used by the web agent. Syntax#include "am_web.h"
typedef struct {
am_web_get_post_data_t get_post_data;
am_web_free_post_data_t free_post_data;
am_web_set_user_t set_user;
am_web_set_method_t set_method;
am_web_set_header_in_request_t set_header_in_request;
am_web_add_header_in_response_t add_header_in_response;
am_web_render_result_t render_result;
} am_web_request_func_t;
Membersam_web_request_func_t has the following components:
am_web_request_params_tRepresents the parameters of an HTTP request passed to a web server from a client browser. DetailsThis structure represents the parameters of the HTTP request and includes am_web_req_method_t which defines the action to be performed on the resource (GET, POST, DELETE, etc.). Syntax#include "am_web.h"
typedef struct {
char *url; /* The full request URL */
char *query; /* query string if any */
am_web_req_method_t method; /* request method */
char *path_info; /* path info if any */
char *client_ip; /* client IP if any */
char *cookie_header_val; /* the cookie header value if any */
void *reserved; /* reserved - do not set this */
} am_web_request_params_t;
Membersam_web_request_params_t has the following components:
am_web_set_header_in_request_tDefines a data type for the am_web_render_result_func_t function pointer. DetailsSee also am_web_render_result_func_t. Syntax#include "am_web.h"
typedef struct {
am_web_set_header_in_request_func_t func;
void **args;
} am_web_set_header_in_request_t;
Membersam_web_set_header_in_request_t has the following components:
am_web_set_method_tDefines a data type for the am_web_set_method_func_t function pointer. DetailsSee also am_web_set_method_func_t. Syntax#include "am_web.h"
typedef struct {
am_web_set_method_func_t func;
void **args;
} am_web_set_method_t;
Membersam_web_set_method_t has the following components:
am_web_set_user_tDefines a data type for the am_web_set_user_func_t function pointer. DetailsSee also am_web_set_user_func_t. Syntax#include "am_web.h"
typedef struct {
am_web_set_user_func_t func;
void **args;
} am_web_set_user_t;
Membersam_web_set_user_t has the following components:
post_urls_tA session information object defining the URLs used by the web agent to communicate with OpenSSO Enterprise. Syntax#include "am_web.h"
typedef struct post_urls {
char *dummy_url;
char *action_url;
char *post_time_key;
} post_urls_t;
Memberspost_urls_t has the following components:
Web Agent Function PointersThe web agent function pointers must be written before calling the am_web_process_request() function to process a request. The function pointers defined in <am_web.h> are: am_web_add_header_in_response_func_tAdds (or sets) an HTTP header in a response. DetailsIf a header of the same name already exists, it should be replaced with this header. Syntax#include "am_web.h"
typedef am_status_t (*am_web_add_header_in_response_func_t)
(void **args,
const char *name,
const char *val);
ParametersThis function takes the following parameter:
ReturnsThis function returns one of the following values of the am_status_t enumeration (defined in the <am_types.h> header file):
am_web_free_post_data_func_tFrees the data retrieved by am_web_get_post_data_func_t. DetailsThe POST data can be NULL if it is not needed. Syntax#include "am_web.h"
typedef am_status_t (*am_web_free_post_data_func_t)
(void **args,
char *data);
ParametersThis function takes the following parameter:
ReturnsThis function returns one of the following values of the am_status_t enumeration (defined in the <am_types.h> header file):
am_web_get_cookie_sync_func_tSynchronizes two cookies. DetailsCurrently, this is a dummy function. Do not use. Syntax#include "am_web.h"
typedef am_status_t (*am_web_get_cookie_sync_func_t)(
const char *cookieName,
char **dproCookie,
void **args);
ParametersThis function takes the following parameter:
ReturnsThis function returns one of the following values of the am_status_t enumeration (defined in the <am_types.h> header file):
am_web_get_post_data_func_tRetrieves post data. DetailsThe returned POST data must be NULL terminated and will be freed by calling am_web_free_post_data_func_t. Syntax#include "am_web.h"
typedef am_status_t (*am_web_get_post_data_func_t)
(void **args,
char **data);
ParametersThis function takes the following parameter:
ReturnsThis function returns one of the following values of the am_status_t enumeration (defined in the <am_types.h> header file):
am_web_render_result_func_tRenders an HTML page based on the result of a web agent's enforcement. Syntax#include "am_web.h"
typedef am_status_t (*am_web_render_result_func_t)
(void **args,
am_web_result_t http_result,
char *data);
ParametersThis function takes the following parameter:
ReturnsThis function returns one of the following values of the am_status_t enumeration (defined in the <am_types.h> header file):
am_web_result_set_header_func_tSets LDAP attributes in an HTTP header. DetailsThis function will be called when com.sun.am.policy.agents.config.profile.attribute.fetch.mode in the agent configuration properties is set to HTTP_HEADER. This property specifies if additional user profile attributes should be introduced into the request. Possible values are:
Syntax#include "am_web.h"
typedef am_status_t (*am_web_result_set_header_func_t)(
const char *key,
const char *attrValues,
void **args);
ParametersThis function takes the following parameter:
ReturnsThis function returns one of the values of the am_status_t enumeration (defined in the <am_types.h> header file) including:
am_web_result_set_header_attr_in_request_func_tSets LDAP attributes defined in the request's HTTP cookie header. DetailsThis function will be called when com.sun.am.policy.agents.config.profile.attribute.fetch.mode in the agent configuration properties is set to HTTP_COOKIE. This property specifies if additional user profile attributes should be introduced into the request. Possible values are:
Syntax#include "am_web.h"
typedef am_status_t (*am_web_result_set_header_attr_in_request_func_t)(
const char *cookieValues,
void **args);
ParametersThis function takes the following parameter:
ReturnsThis function returns one of the values of the am_status_t enumeration (defined in the <am_types.h> header file) including:
am_web_result_set_header_attr_in_response_func_tSets LDAP attributes defined in the response's HTTP cookie header. DetailsThis function will be called when com.sun.am.policy.agents.config.profile.attribute.fetch.mode in the agent configuration properties is set to HTTP_COOKIE. This property specifies if additional user profile attributes should be introduced into the request. Possible values are:
Syntax#include "am_web.h"
typedef am_status_t (*am_web_result_set_header_attr_in_response_func_t)(
const char *cookieValues,
void **args);
ParametersThis function takes the following parameter:
ReturnsThis function returns one of the values of the am_status_t enumeration (defined in the <am_types.h> header file) including:
am_web_set_header_in_request_func_tSets an HTTP header in a request. DetailsIf a header of the same name already exists it should be replaced with this header. Syntax#include "am_web.h"
typedef am_status_t (*am_web_set_header_in_request_func_t)(
void **args,
const char *name,
const char *val);
ParametersThis function takes the following parameter:
ReturnsThis function returns one of the following values of the am_status_t enumeration (defined in the <am_types.h> header file):
am_web_set_method_func_tSets the request method to be used by a web agent during cross domain single sign-on (CDSSO). DetailsIn cases of CDSSO actions between OpenSSO Enterprise and web agents, the POST request method is used by the web agent. am_web_set_method_func_t is required to change the request method to POST, if necessary, from the method defined in the original HTTP request. See Cross-Domain Single Sign-On Session in Sun OpenSSO Enterprise 8.0 Technical Overview for additional information. Syntax#include "am_web.h"
typedef am_status_t (*am_web_set_method_func_t)(
void **args,
am_web_req_method_t method);
ParametersThis function takes the following parameter:
ReturnsThis function returns one of the following values of the am_status_t enumeration (defined in the <am_types.h> header file):
am_web_set_user_func_tSets the user. DetailsThe implementation code sets the user. Syntax#include "am_web.h"
typedef am_status_t (*am_web_set_user_func_t)(
void **args,
const char *user);
ParametersThis function takes the following parameter:
ReturnsThis function returns one of the following values of the am_status_t enumeration (defined in the <am_types.h> header file):
Web Agent FunctionsThe web agent functions defined in <am_web.h> are: am_web_init() for Agents 3.0Initializes the 3.0 web agent by loading the bootstrap properties file. Syntax#include "am_web.h"
AM_WEB_EXPORT am_status_t
am_web_init(const char *agent_bootstrap_file
const char *agent_config_file);
ParametersThis function takes the following parameter:
ReturnsThis function returns one of the following values of the am_status_t enumeration (defined in the <am_types.h> header file):
am_agent_init()Initializes an agent by creating the agent profile object and performing agent authentication to receive the initial agent configuration data from either OpenSSO Enterprise or the local configuration file. Syntax#include "am_web.h" AM_WEB_EXPORT am_status_t am_agent_init(boolean_t *pAgentAuthenticated); ParametersThis function takes the following parameter:
ReturnsThis function returns one of the following values of the am_status_t enumeration (defined in the <am_types.h> header file):
am_web_build_advice_response()Builds an advice response. Syntax#include "am_web.h"
AM_WEB_EXPORT am_status_t
am_web_build_advice_response(const am_policy_result_t *policy_result,
const char *redirect_url,
char **advice_response);
ParametersThis function takes the following parameter:
ReturnsThis function returns one of the following values of the am_status_t enumeration (defined in the <am_types.h> header file):
am_web_check_cookie_in_post()Retrieves a user's SSOToken. DetailsIn cases of cross domain single sign-on, OpenSSO Enterprise sends out a user's SSOToken using POST. This method uses POST to retrieve the SSOToken and set it in the foreign domain. Syntax#include "am_web.h"
M_WEB_EXPORT am_status_t
am_web_check_cookie_in_post(void ** args,
char ** dpro_cookie,
char ** request_url,
char **orig_req,
char *method,
char *response,
boolean_t responseIsCookie,
am_status_t (*set_cookie)(const char *, void **),
void (*set_method)(void **, char *),
void* agent_config
);
ParametersThis function takes the following parameter:
ReturnsThis function returns one of the following values of the am_status_t enumeration (defined in the <am_types.h> header file):
am_web_check_cookie_in_query()Retrieves the cookie from a query string. DetailsIn older versions of this product, when performing CDSSO, the cookie was part of the query string. SyntaxAM_WEB_EXPORT am_status_t
am_web_check_cookie_in_query(void **args,
char **dpro_cookie,
const char *query,
char **request_url,
char ** orig_req,
char *method,
am_status_t (*set_cookie)(const char *, void **),
void (*set_method)(void **, char *),
void* agent_config
);
ParametersThis function takes the following parameter:
ReturnsThis function returns one of the following values of the am_status_t enumeration (defined in the <am_types.h> header file):
am_web_clean_post_urls()Cleans up a post_urls_t data type. DetailsSee post_urls_t for more information. Syntax#include "am_web.h" AM_WEB_EXPORT void am_web_clean_post_urls(post_urls_t *posturl_struct); ParametersThis function takes the following parameter:
ReturnsThis function returns no values. am_web_cleanup()Cleans up any memory called by the am_web_* functions. DetailsThis should be called before a web agent exits. Syntax#include "am_web.h" AM_WEB_EXPORT am_status_t am_web_cleanup(); ParametersThis function does not take any parameters. ReturnsThis function returns one of the following values of the am_status_t enumeration (defined in the <am_types.h> header file):
am_web_clear_attributes_map()Clears the profile, session and response attributes maps. Syntax#include "am_web.h" AM_WEB_EXPORT void am_web_clear_attributes_map(am_policy_result_t *result); ParametersThis function takes the following parameter:
ReturnsThis function returns no values. am_web_create_post_page()Creates an HTML form that submits the POST data with invisible name/value pairs. Syntax#include "am_web.h"
AM_WEB_EXPORT char *
am_web_create_post_page(const char *key,
const char *postdata,
const char *actionurl,
void* agent_config);
ParametersThis function takes the following parameters:
ReturnsThis function returns char * as the POST form to be submitted. am_web_create_post_preserve_urls()Constructs a post_urls_t data type during preservation of POST data. DetailsA post_urls_t data type contains a dummy POST URL, an action URL and a unique key. The dummy URL is filtered by the Server Application Function (SAF) to identify POST preservation redirects from general redirects. All three of these variables are required for POST preservation. Syntax#include "am_web.h"
AM_WEB_EXPORT post_urls_t *
am_web_create_post_preserve_urls(const char *request_url,
void* agent_config);
ParametersThis function takes the following parameter:
ReturnsThis function returns a post_urls_t data type. See post_urls_t for information. am_web_delete_agent_configuration()Deletes the referenced object from the agent configuration data stored in the agent configuration cache. Syntax#include "am_web.h" AM_WEB_EXPORT void am_web_delete_agent_configuration(void*); ParametersThis function takes no parameters. ReturnsThis function deletes the latest configuration data, referenced by an object for a particular agent, from the agent configuration cache. am_web_do_cookie_domain_set()Sets the OpenSSO Enterprise cookie (called iPlanetDirectoryPro) for each domain configured in the com.sun.am.policy.agents.config.cookie.domain.list property in the agent configuration properties. Detailsam_web_do_cookie_domain_set() builds the set-cookie header for each domain, and calls the callback function declared in setFunc to set the cookie. In CDSSO, the callback function is called by am_web_check_cookie_in_query() and am_web_check_cookie_in_post() to set the cookie in the response. Syntax#include "am_web.h"
AM_WEB_EXPORT am_status_t
am_web_do_cookie_domain_set(am_status_t (*setFunc)(
const char *,
void **),
void **args,
const char *cookie
void* agent_config);
ParametersThis function takes the following parameters:
ReturnsThis function returns a value of the am_status_t enumeration (defined in the <am_types.h> header file). am_web_do_cookies_reset()Resets the cookies in a response before redirecting it for authentication to the OpenSSO Enterprise login page. DetailsThis function resets the cookies specified in the agent configuration properties and invokes the set action that the agent passes in for each of them. It is enabled by setting the following properties:
Syntax#include "am_web.h"
AM_WEB_EXPORT am_status_t
am_web_do_cookies_reset(am_status_t (*setFunc)(
const char *,
void **),
void **args,
void* agent_config);
ParametersThis function takes the following parameters:
ReturnsThis function returns a value of the am_status_t enumeration (defined in the <am_types.h> header file). am_web_free_memory()Frees memory previously allocated by a am_web_* routine. Syntax#include "am_web.h" AM_WEB_EXPORT void am_web_free_memory(void *memory); ParametersThis function takes the following parameter:
ReturnsThis function returns no value. am_web_get_agent_server_host()Retrieves the name of the server host for the agent. Syntax#include "am_web.h" AM_WEB_EXPORT const char * am_web_get_agent_server_host(void* agent_config); Parameters
ReturnsThis function returns then name of the server host. am_web_get_agent_configuration()Retrieves the latest configuration data from the agent configuration cache. The returned instance gets used to serve requests. Syntax#include "am_web.h" AM_WEB_EXPORT void* am_web_get_agent_configuration(); ParametersThis function takes no parameters. ReturnsThis function returns the latest configuration data, for a particular agent, from the agent configuration cache. am_web_get_agent_server_port()Retrieves the port used by the agent on the server host. Syntax#include "am_web.h" AM_WEB_EXPORT int am_web_get_agent_server_port(void* agent_config); Parameters
ReturnsThis function returns a port number. am_web_get_authType()Determines if the auth-type value DSAME should be replaced by Basic in the Policy Agent 2.2 for Microsoft IIS 6.0. DetailsThe Policy Agent 2.2 for Microsoft IIS 6.0 is defined in <am_web.h> as having auth-type value equal to DSAME. #define AM_WEB_AUTH_TYPE_VALUE "DSAME" DSAME is a hard-coded value representing all OpenSSO Enterprise authentication types other than Basic. Syntax#include "am_web.h" AM_WEB_EXPORT const char * am_web_get_authType(void* agent_config); Parameters
ReturnsThis function returns either DSAME or Basic. am_web_get_cookie_name()Retrieves the name of the OpenSSO Enterprise cookie. Syntax#include "am_web.h" AM_WEB_EXPORT const char * am_web_get_cookie_name(void* agent_config); Parameters
ReturnsThis function returns the name of the OpenSSO Enterprise cookie. am_web_get_notification_url()Retrieves the URL of the OpenSSO Enterprise Notification Service. Syntax#include "am_web.h" AM_WEB_EXPORT const char * am_web_get_notification_url(void* agent_config); Parameters
ReturnsThis function returns the URL of the OpenSSO Enterprise Notification Service. am_web_get_parameter_value()Gets the value of the specified parameter from the specified request URL. Syntax#include "am_web.h"
AM_WEB_EXPORT am_status_t
am_web_get_parameter_value(const char *inpQuery,
const char *param_name,
char **param_value);
ParametersThis function takes the following parameters:
ReturnsThis function also returns one of the following values of the am_status_t enumeration (defined in the <am_types.h> header file):
Memory ConcernsThe returned parameter value should be freed by the caller using am_web_free(). am_web_get_request_url()Parses the host request header field for a server host name, port, protocol, query parameter, and URI to return the requested URL to the web agent. Syntax#include "am_web.h"
AM_WEB_EXPORT am_status_t
am_web_get_request_url(const char *host_hdr,
const char *protocol,
const char *hostname,
size_t port,
const char *uri,
const char *query,
char **req_url,
void* agent_config);
ParametersThis function takes the following parameters:
ReturnsThis function returns one of the following values of the am_status_t enumeration (defined in the <am_types.h> header file):
am_web_get_token_from_assertion()Returns the single sign-on token from the specified Security Assertion Markup Language (SAML) assertion. Detailsam_web_get_token_from_assertion() is used to retrieve the cookie sent by OpenSSO Enterprise in a SAML assertion. Syntax#include "am_web.h"
AM_WEB_EXPORT am_status_t
am_web_get_token_from_assertion(char *assertion,
char **token,
void* agent_config);
ParametersThis function takes the following parameters:
ReturnsThis function returns one of the following values of the am_status_t enumeration (defined in the <am_types.h> header file):
Memory ConcernsThe returned identifier should be freed using am_web_free(). am_web_get_url_to_redirect()Returns a string representing a login URL or access denied URL to which the web agent should redirect. am_web_get_redirect_url() has been deprecated and must not be used. It is supported for backward compatibility only. Detailsam_web_get_url_to_redirect() may redirect the user to the login URL or the access denied URL. The URL is appropriate to the provided status code and advice map returned by the Policy SDK. If redirecting to the login URL, the URL will include existing information specified in the URL from the configuration file (for example, the organization name) as well as the specified goto parameter value which will be used by OpenSSO Enterprise after the user has successfully authenticated. The last parameter reserved must be passed with NULL. Note – If the URL returned is not NULL, the caller of this function must call am_web_free_memory(void *) to free the pointer. Syntax#include "am_web.h"
AM_WEB_EXPORT am_status_t
am_web_get_url_to_redirect(am_status_t status,
const am_map_t advice_map,
const char *goto_url,
const char* method,
void *reserved,
char ** redirect_url,
void* agent_config);
ParametersThis function takes the following parameters:
ReturnsThis function returns one of the following values of the am_status_t enumeration (defined in the <am_types.h> header file):
am_web_get_user_id_param()Returns the value of the logged-in user. Syntax#include "am_web.h" AM_WEB_EXPORT char * am_web_get_user_id_param(void* agent_config); ParametersThis function takes the following parameters:
ReturnsThis function returns the value of the logged-in user. am_web_handle_notification()Handles notification data received by a web agent. Detailsam_web_handle_notification() generates logging messages for the event and any error that may occur during the processing of the notification. Syntax#include "am_web.h"
AM_WEB_EXPORT void
am_web_handle_notification(const char *data,
size_t data_length,
void* agent_config);
ParametersThis function takes the following parameters:
ReturnsThis function returns no value. am_web_http_decode()URL decodes the specified URL encoded string. Syntax#include "am_web.h"
AM_WEB_EXPORT char *
am_web_http_decode(const char *string,
size_t len);
ParametersThis function takes the following parameters:
ReturnsThis function returns the URL decoded value of the URL encoded string, or NULL if an error occurred. Memory ConcernsThe returned value should be freed by calling am_web_free(). am_web_is_access_allowed()Evaluates the access control policies for a specified web resource and action against those for a specified user. Syntax#include "am_web.h"
AM_WEB_EXPORT am_status_t
am_web_is_access_allowed(const char *sso_token,
const char *url,
const char *path_info,
const char *action_name,
const char *client_ip,
const am_map_t env_parameter_map,
am_policy_result_t *result,
void* agent_config);
ParametersThis function takes the following parameters:
ReturnsThis function returns one of the following values of the am_status_t enumeration (defined in the <am_types.h> header file):
am_web_is_cdsso_enabled()Returns a boolean specifying whether cross domain single sign-on is enabled in the agent’s configuration file. Syntax#include "am_web.h" AM_WEB_EXPORT boolean_t am_web_is_cdsso_enabled(void* agent_config); Parameters
ReturnsThis function returns one of the following values of the boolean_t enumeration (defined in the <am_types.h> header file):
am_web_is_cookie_present()Detects whether a cookie is present. DetailsThis function will most probably be invoked in a loop. A cookie name and value is passed and the implementation checks whether the cookie is already listed. If not, the new cookie name and value are appended. If present, the value of the cookie name is updated. Syntax#include "am_web.h"
AM_WEB_EXPORT int
am_web_is_cookie_present(const char *cookie,
const char *value,
char **new_cookie);
ParametersThis function takes the following parameters:
ReturnsThis function returns one of the following integers as defined in <am_web.h>: #define AM_WEB_COOKIE_EXIST 2 #define AM_WEB_COOKIE_MODIFIED 1 #define AM_WEB_COOKIE_ABSENT 0 #define AM_WEB_COOKIE_ERROR -1 am_web_is_debug_on()Returns a boolean specifying whether debug is enabled. Detailsam_web_is_debug_on() specifies whether the log level is set to anything greater than 0. Syntax#include "am_web.h" AM_WEB_EXPORT boolean_t am_web_is_debug_on(); ParametersThis function takes no parameters. ReturnsThis function returns one of the following values of the boolean_t enumeration (defined in the <am_types.h> header file):
am_web_is_in_not_enforced_ip_list()Returns a boolean specifying whether the given IP address is defined as one where no authentication or authorization is required. DetailsIP addresses that are not enforced are defined in the com.sun.am.policy.agents.config.notenforced_client_ip_list property in the agent configuration properties. If the IP address from where the request was issued is not enforced, the request goes through without authentication or authorization. Syntax#include "am_web.h"
AM_WEB_EXPORT boolean_t
am_web_is_in_not_enforced_ip_list(const char *ip,
void* agent_config);
ParametersThis function takes the following parameter:
ReturnsThis function returns one of the following values of the boolean_t enumeration (defined in the <am_types.h> header file):
am_web_is_in_not_enforced_list()Returns a boolean specifying whether the URL being accessed by the user is in the not enforced list. DetailsURLs that are not enforced are defined in the com.sun.am.policy.agents.config.notenforced_list property in the agent configuration properties. If the URL is not enforced, the request goes through without authentication or authorization. Syntax#include "am_web.h"
AM_WEB_EXPORT boolean_t
am_web_is_in_not_enforced_list(const char *url,
const char *path_info,
void* agent_config);
ParametersThis function takes the following parameters:
ReturnsThis function returns one of the following values of the boolean_t enumeration (defined in the <am_types.h> header file):
am_web_is_logout_url()Returns a boolean specifying whether the specified URL is a logout URL. Syntax#include "am_web.h"
AM_WEB_EXPORT boolean_t
am_web_is_logout_url(const char *url,
void* agent_config);
ParametersThis function takes the following parameter:
ReturnsThis function returns one of the following values of the boolean_t enumeration (defined in the <am_types.h> header file):
am_web_is_max_debug_on()Returns a boolean specifying whether the log level is set to 5. Syntax#include "am_web.h" AM_WEB_EXPORT boolean_t am_web_is_max_debug_on(); ParametersThis function takes no parameters. ReturnsThis function returns one of the following values of the boolean_t enumeration (defined in the <am_types.h> header file):
am_web_is_notification()Returns a boolean specifying whether the given URL is the Notification Service URL for the web agent as configured in the agent configuration properties. Syntax#include "am_web.h"
AM_WEB_EXPORT boolean_t
am_web_is_notification(const char *request_url
void* agent_config);
ParametersThis function takes the following parameter:
ReturnsThis function returns one of the following values of the boolean_t enumeration (defined in the <am_types.h> header file):
am_web_is_owa_enabled()Returns the value of the com.sun.identity.agents.config.iis.owa.enable property. Note – Outlook Web Access (OWA) is a web mail service installed on Microsoft Internet Information Services 6.0. OWA interacts with the Exchange server to retrieve e-mail, calender contacts, and the like. A policy agent can be used to provide SSO for OWA. Syntax#include "am_web.h" AM_WEB_EXPORT boolean_t am_web_is_owa_enabled(void* agent_config); Parameters
ReturnsThis function returns one of the following values of the boolean_t enumeration (defined in the <am_types.h> header file):
am_web_is_owa_enabled_change_protocol()Used to convert incoming http and https protocol to https. Returns the value of the com.sun.identity.agents.config.iis.owa.enable.change.protocol property. The property can have a value of either true or false; the default value is false. Note – Outlook Web Access (OWA) is a web mail service installed on Microsoft Internet Information Services 6.0. OWA interacts with the Exchange server to retrieve email, calender contacts, and the like. A policy agent can be used to provide SSO for OWA. Syntax#include "am_web.h" AM_WEB_EXPORT boolean_t am_web_is_owa_enabled_change_protocol(void* agent_config); Parameters
ReturnsThis function returns one of the following values of the boolean_t enumeration (defined in the <am_types.h> header file):
am_web_is_owa_enabled_session_timeout_url()Returns the value of the com.sun.identity.agents.config.iis.owa.enable.session_timeout_url property, used to redirect to a custom session timeout page Note – Outlook Web Access (OWA) is a web mail service installed on Microsoft Internet Information Services 6.0. OWA interacts with the Exchange server to retrieve email, calender contacts, and the like. A policy agent can be used to provide SSO for OWA. Syntax#include "am_web.h" AM_WEB_EXPORT char * am_web_is_owa_enabled_session_timeout_url(void* agent_config); Parameters
ReturnsThis function returns the URL of the custom session timeout page. am_web_is_postpreserve_enabled()Returns a boolean specifying whether POST data preservation is enabled for clients in the agent configuration properties. Syntax#include "am_web.h" AM_WEB_EXPORT boolean_t am_web_is_postpreserve_enabled(void* agent_config); Parameters
ReturnsThis function returns one of the following values of the boolean_t enumeration (defined in the <am_types.h> header file):
am_web_is_proxy_override_host_port_set()Determines if the com.sun.am.policy.agents.config.override_host and the com.sun.am.policy.agents.config.override_port properties are set for the proxy agent. DetailsThese properties are defined in the agent configuration properties. Syntax#include "am_web.h" AM_WEB_EXPORT boolean_t am_web_is_proxy_override_host_port_set(void* agent_config); Parameters
ReturnsThis function returns one of the following values of the boolean_t enumeration (defined in the <am_types.h> header file):
am_web_is_valid_fqdn_url()Returns a boolean specifying whether the requested URL is a valid fully qualified domain name (FQDN) resource as configured in the agent configuration properties. For example, myhost.mydomain.com. Syntax#include "am_web.h"
AM_WEB_EXPORT boolean_t
am_web_is_valid_fqdn_url(const char *url,
void* agent_config);
Parameters
ReturnsThis function returns one of the following values of the boolean_t enumeration (defined in the <am_types.h> header file):
am_web_log_always()Log the given message regardless of the log level set in the agent configuration properties. Syntax#include "am_web.h" AM_WEB_EXPORT void am_web_log_always(const char *fmt, ...); ParametersThis function takes the following parameter:
ReturnsThis function returns no values. am_web_log_auth()Log the given access allowed or denied message to the OpenSSO Enterprise logs. Syntax#include "am_web.h"
AM_WEB_EXPORT boolean_t
am_web_log_auth(am_web_access_t access_type,
const char *fmt, ...
void* agent_config);
ParametersThis function takes the following parameters:
ReturnsThis function returns one of the following values of the boolean_t enumeration (defined in the <am_types.h> header file):
am_web_log_debug()Log the given message at the debug level. Syntax#include "am_web.h" AM_WEB_EXPORT void am_web_log_debug(const char *fmt, ...); ParametersThis function takes the following parameter:
ReturnsThis function returns no values. am_web_log_error()Log the given message at the debug log level. Syntax#include "am_web.h" AM_WEB_EXPORT void am_web_log_error(const char *fmt, ...); ParametersThis function takes the following parameter:
ReturnsThis function returns no values. am_web_log_info()Log the given message at the info log level. Syntax#include "am_web.h" AM_WEB_EXPORT void am_web_log_info(const char *fmt, ...); ParametersThis function takes the following parameter:
ReturnsThis function returns no values. am_web_log_max_debug()Log the given message at maximum debug level. Syntax#include "am_web.h" AM_WEB_EXPORT void am_web_log_max_debug(const char *fmt, ...); ParametersThis function takes the following parameters:
ReturnsThis function returns no values. am_web_log_warning()Log the given message at the warning log level. Syntax#include "am_web.h" AM_WEB_EXPORT void am_web_log_warning(const char *fmt, ...); ParametersThis function takes the following parameters:
ReturnsThis function returns no values. am_web_logout_cookies_reset()Resets cookie configured for reset on user logout. DetailsThe reset function passed in is called for each cookie configured for reset. If the function failed for any cookie, the last failed status is returned. Syntax#include "am_web.h"
AM_WEB_EXPORT am_status_t
am_web_logout_cookies_reset(am_status_t (*setFunc)(
const char *,
void **),
void **args,
void* agent_config);
ParametersThis function takes the following parameters:
ReturnsThis function returns no values. am_web_method_num_to_str()Converts a am_web_req_method_t number to a string. DetailsThis function is used for logging the method in the local debug logs. It takes in a method name and returns a string value (such as GET, or POST). Syntax#include "am_web.h" AM_WEB_EXPORT const char * am_web_method_num_to_str(am_web_req_method_t method); ParametersThis function takes the following parameter:
ReturnsThis function returns a pointer to the string. If the number passed is not recognized, UNKNOWN is returned. am_web_method_str_to_num()Converts a am_web_req_method_t string to a number. DetailsThis function does the opposite of the previously defined am_web_method_num_to_str(). See am_web_method_num_to_str() for details. Syntax#include "am_web.h" AM_WEB_EXPORT const char * am_web_method_num_to_str(am_web_req_method_t method); ParametersThis function takes the following parameter:
ReturnsThis function returns a pointer to the number If the string is not recognized, AM_WEB_REQUEST_UNKNOWN is returned. am_web_postcache_data_cleanup()Cleans up am_web_postcache_data_t data type. Syntax#include "am_web.h" AM_WEB_EXPORT void am_web_postcache_data_cleanup(am_web_postcache_data_t * const postentry_struct); ParametersThis function takes the following parameter:
ReturnsThis function returns no value. am_web_postcache_insert()Inserts POST data entry in the POST cache. Syntax#include "am_web.h"
AM_WEB_EXPORT boolean_t
am_web_postcache_insert(const char *key,
const am_web_postcache_data_t *value,
void* agent_config);
ParametersThis function takes the following parameters:
ReturnsThis function returns one of the following values of the boolean_t enumeration (defined in the <am_types.h> header file):
am_web_postcache_lookup()Looks up data in the POST cache. Syntax#include "am_web.h"
AM_WEB_EXPORT boolean_t
am_web_postcache_lookup(const char *key,
am_web_postcache_data_t *postdata_entry,
void* agent_config);
ParametersThis function takes the following parameters:
ReturnsThis function returns one of the following values of the boolean_t enumeration (defined in the <am_types.h> header file):
am_web_postcache_remove()Removes data from the POST cache. Syntax#include "am_web.h"
AM_WEB_EXPORT void
am_web_postcache_remove(const char *key,
void* agent_config);
ParametersThis function takes the following parameter:
ReturnsThis function returns no value. am_web_process_request()Processes a request access check and returns a HTTP result to be rendered by the agent. DetailsThe render status is returned in the render_sts argument. Syntax#include "am_web.h"
AM_WEB_EXPORT am_web_result_t
am_web_process_request(am_web_request_params_t *req_params,
am_web_request_func_t *req_func,
am_status_t *render_sts,
void* agent_config);
ParametersThis function takes the following parameters:
ReturnsOne of the following values of the am_web_result_t enumeration as defined: #include "am_web.h"
typedef enum {
AM_WEB_RESULT_OK, /* access check was OK */
AM_WEB_RESULT_OK_DONE, /* OK and handled (for ex. notification) */
AM_WEB_RESULT_FORBIDDEN, /* access forbidden */
AM_WEB_RESULT_REDIRECT, /* redirected */
AM_WEB_RESULT_ERROR /* internal error */
} am_web_result_t;
am_web_remove_authnrequest()Removes those extra parameters from an authenticated request. DetailsWhen a user returns from CDSSO authentication, the request contains a list of parameters that were added when the user was authenticated. am_web_remove_authnrequest() removes these extra parameters so the request is forwarded to applications as it originally came from the browser. Syntax#include "am_web.h"
AM_WEB_EXPORT am_status_t
am_web_remove_authnrequest(char* inpString,
char **outString );
ParametersThis function takes the following parameters:
ReturnsThis function returns one of the following values of the am_status_t enumeration (defined in the <am_types.h> header file):
Memory ConcernsThe value returned should be freed using am_web_free(). am_web_remove_parameter_from_query()Removes the given query parameter from the URL, if present. Syntax#include "am_web.h"
AM_WEB_EXPORT am_status_t
am_web_remove_parameter_from_query(const char* inpString,
const char *remove_str,
char **outString );
ParametersThis function takes the following parameters:
ReturnsThis function returns one of the following values of the am_status_t enumeration (defined in the <am_types.h> header file):
Memory ConcernsThe value returned should be freed using am_web_free(). am_web_result_attr_map_set()Processes attr_response_map from a am_policy_result_t data type and performs the set action. DetailsThis function replaces am_web_do_result_attr_map_set() which is deprecated. It needs to be explicitly declare to use it. See <am_web.h> for more information. Syntax#include "am_web.h"
AM_WEB_EXPORT am_status_t
am_web_result_attr_map_set(am_policy_result_t *result,
am_web_result_set_header_func_t
setHeaderFunc,
am_web_result_set_header_attr_in_response_func_t
setCookieRespFunc,
am_web_result_set_header_attr_in_request_func_t
setCookieReqFunc,
am_web_get_cookie_sync_func_t getCookieSyncFunc,
void **args, void* agent_config);
ParametersThis function takes the following parameters:
ReturnsThis function returns one of the following values of the am_status_t enumeration (defined in the <am_types.h> header file):
Memory ConcernsThe value returned should be freed using am_web_free(). am_web_result_num_to_str()Returns the name of a am_web_result_t as a string. Syntax#include "am_web.h" AM_WEB_EXPORT const char * am_web_result_num_to_str(am_web_result_t result); ParametersThis function takes the following parameter:
ReturnsThis function returns a pointer to the string. For example, AM_WEB_RESULT_OK returns AM_WEB_RESULT_OK. If the result code passed is not recognized, Unknown result code is returned. am_web_set_cookie()Sets the specified cookie in the cookie header of the request. Syntax#include "am_web.h"
AM_WEB_EXPORT am_status_t
am_web_set_cookie(char *cookie_header,
const char *set_cookie_value,
char **new_cookie_header);
ParametersThis function takes the following parameters:
ReturnsThis function returns one of the following values of the am_status_t enumeration (defined in the <am_types.h> header file):
|