[Prev]

3.4.3 SSO: ret = tas3_sso_cf_ses(cf, qs_len, qs, ses, &res_len, auto_flags)

Prototype

  char* tas3_sso_cf_ses(tas3_conf* cf, int qs_len, char* qs,
                        tas3_ses* ses, int* res_len, int auto_flags);

Strings are length + pointer (no C string nul termination needed).

cf

Configuration object, see tas3_new_conf_to_cf()

qs_len

Length of the query string. -1 = use strlen()

qs

Query string (or POST content)

ses

Session object, see tas3_new_ses(). Session object is modified.

res_len

Result parameter. If non-null, will be set to the length of the returned string

auto_flags

Automation flags

return

String representing protocol action or SSO attributes

Example

  01 {
  02  tas3_conf* cf  = tas3_new_conf_to_cf("PATH=/var/tas3/");
  03  tas3_ses*  ses = tas3_new_ses(cf);
  04  char* ret = tas3_sso_cf_ses(cf, -1, env("QUERY_STRING"), ses, 0, 0x1800);
  05  switch (ret[0]) {
  06  case 'd': break;  /* Successful login */
  07  ...               /* Processing other outcomes omitted for brevity. */
  08  }
  09  if (tas3_az_cf_ses(cf, "", ses)) {
  10    /* SSO successful and authorization permit. Do some work. */
  11  } else {
  12    /* SSO successful but authorization denied */
  13  }
  14 }

[Prev | Next]