Authentication commands
AUTH:get_baked_cookie()
Allow you to retrieve the baked cookie.
Syntax
AUTH:get_baked_cookie();
Arguments: N/A
Examples
when COOKIE_BAKE {
cookie = AUTH:get_baked_cookie()
debug(“Get cookie: %s\r\n”, cookie)
}
Result:
Get cookie: Set-Cookie: FortiADCauthSI=lfGnC2gsl7xsbAg4JFs94e4CJfFXaP3U5z6QHvo7n08cCoT5MdtQog2LmcizPo3aRiBHY/RThhocqG+DdnvsCLFJh3nBUoLeuYjGK9lY5L4=|W86hXGg; expires=Tue 23 Oct 2018 04:19:45 GMT; domain=10.1.0.99; path=/
FortiADC version: V5.2
Used in events:
Used in AUTH_RESULT
AUTH:set_baked_cookie(cookie)
Allow you to customize cookie attribute the baked cookie.
Syntax
AUTH:set_baked_cookie(cookie);
Arguments
Name | Description |
---|---|
cookie |
A string which specifies the baked cookie. |
Examples
when COOKIE_BAED {
cookie = AUTH:get_baked_cookie()
new_cookie = cookie..”; Mick-Test:123444444”
status = AUTH:set_baked_cookie(new_cookie)
debug(“Set baked cookie, status: %s\n”, status)
}
Result:
Set baked cookie, status: true
FortiADC version: V5.2
Used in events:
Used in AUTH_RESULT
AUTH:on_off()
Returns the authentication whether required or not.
Syntax
AUTH:on_off();
Arguments: N/A
Examples
when AUTH_RESULT {
on_off = AUTH:on_off()
succ = AUTH:success()
fm = AUTH:form_based()
user = AUTH:user()
pass = AUTH:pass()
userg = AUTH:usergroup()
realm = AUTH:realm()
host = AUTH:host()
debug(“authentication form based %s, on_off %s, success %s, the user %s, pass %s, realm %s, the usergroup %s, host %s\n”, fm, on_off, succ, the user, pass, realm, the userg, host)
}
Result:
authtication form based true, on_off true, success true, the user test, pass test, realm Form333333, the userg test, host 10.1.0.99
FortiADC version: V5.2
Used in events:
Used in AUTH_RESULT / HTTP_REQUEST / HTTP_DATA_REQUEST / HTTP_RESPONSE / HTTP_DATA_RESPONSE
AUTH:success()
Returns the authentication is successful or not
Syntax
AUTH:success();
Arguments: N/A
Examples
Please refer to command AUTH:on_off() example.
FortiADC version: V5.2
Used in events:
Used in AUTH_RESULT / HTTP_REQUEST / HTTP_DATA_REQUEST / HTTP_RESPONSE / HTTP_DATA_RESPONSE
AUTH:form_based()
Returns the authentication is HTTP form based or not
Syntax
AUTH:form_based();
Arguments: N/A
Examples
Please refer to command AUTH:on_off() example.
FortiADC version: V5.2
Used in events:
Used in AUTH_RESULT / HTTP_REQUEST / HTTP_DATA_REQUEST / HTTP_RESPONSE / HTTP_DATA_RESPONSE
AUTH:user()
Returns the user name in authentication
Syntax
AUTH:user();
Arguments: N/A
Examples
Please refer to command AUTH:on_off() example.
FortiADC version: V5.2
Used in events:
Used in AUTH_RESULT / HTTP_REQUEST / HTTP_DATA_REQUEST / HTTP_RESPONSE / HTTP_DATA_RESPONSE
AUTH:pass()
Returns the password in authentication
Syntax
AUTH:pass();
Arguments: N/A
Examples
Please refer to command AUTH:on_off() example.
FortiADC version: V5.2
Used in events:
Used in AUTH_RESULT / HTTP_REQUEST / HTTP_DATA_REQUEST / HTTP_RESPONSE / HTTP_DATA_RESPONSE
AUTH:usergroup()
Returns the usergroup which the user belong to
Syntax
AUTH:usergroup();
Arguments: N/A
Examples
Please refer to command AUTH:on_off() example.
FortiADC version: V5.2
Used in events:
Used in AUTH_RESULT / HTTP_REQUEST / HTTP_DATA_REQUEST / HTTP_RESPONSE / HTTP_DATA_RESPONSE
AUTH:realm()
Returns the realm in authentication
Syntax
AUTH:realm();
Arguments: N/A.
Examples
Please refer to command AUTH:on_off() example.
FortiADC version: V5.2
Used in events:
Used in AUTH_RESULT / HTTP_REQUEST / HTTP_DATA_REQUEST / HTTP_RESPONSE / HTTP_DATA_RESPONSE
AUTH:host()
Returns the host in the authentication
Syntax
AUTH:host();
Arguments: N/A.
Examples
Please refer to command AUTH:on_off() example.
FortiADC version: V5.2
Used in events:
Used in AUTH_RESULT / HTTP_REQUEST / HTTP_DATA_REQUEST / HTTP_RESPONSE / HTTP_DATA_RESPONSE