Sun Java System Access Manager 7.1 C API Reference

am_web_get_url_to_redirect()

Returns a string representing a login URL or access denied URL to which the web agent should redirect.


Caution – Caution –

am_web_get_redirect_url() has been deprecated and must not be used. It is supported for backward compatibility only.


Details

am_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 Access Manager 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);

Parameters

This function takes the following parameters:

status

The status from am_web_is_access_allowed().


Note –

See am_web_is_access_allowed().


advice_map

Any advice map from policy evaluation results.

goto_url

Pointer to the original URL which the user attempted to access.

method

Pointer to the original HTTP method: GET or POST.

reserved

This parameter is not currently used.

redirect_url

Pointer to a pointer containing the resulting Access Manager redirect URL.

Returns

This function returns one of the following values of the am_status_t enumeration (defined in the <am_types.h> header file):

AM_SUCCESS

If successful.

AM_*

Otherwise.