Forum Discussion
karthik_sriniva
Nimbostratus
Apr 08, 2005Authentication status
Hi,
Is there a way to check the status of Authentication, if it's success, failure or etc after the call [AUTH::authenticate $tmm_auth_radius_sid].
I would like to know be...
karthik_sriniva
Nimbostratus
Apr 11, 2005Well Sorry to keep bothering u, adding the HTTP::collect throws the following error
http_process_state_parse_header - Invalid state transition to ST_HTTP_XFER_HEADER
when CLIENT_ACCEPTED {
set tmm_auth_radius_sid [AUTH::start pam default_radius]
set setCookieFlag 0
set cookiename "MEDINSTGTW"
set usrcookiename "MEDINSTUSRGTW"
set cookievalue "GTW9.105"
set cookiepass "1100ed"
set performAuth 1
set performRedirect 0
}
when HTTP_REQUEST {
log "IN REQUEST"
set content_length [HTTP::header Content-Length]
log $content_length
HTTP::collect $content_length
log [HTTP::cookie exists MEDINSTUSRGTW]
if { [HTTP::cookie exists MEDINSTUSRGTW] } {
set rcvusername [HTTP::cookie $usrcookiename]
if { $rcvusername eq [HTTP::username] } {
set performAuth 0
}
}
}
when HTTP_REQUEST_DATA
{
log [HTTP::payload]
if {$performAuth eq 0 } {
use pool gtwDev
HTTP::release
}
if { $performAuth eq 1 } {
set recvData [HTTP::payload]
log $recvData
set uname [findstr $recvData "username" 9]
set username [getfield $uname "&" 1]
log $username
set upwd [findstr $recvData "password" 9]
set userpwd [getfield $upwd "&" 1]
log $userpwd
AUTH::username_credential $tmm_auth_radius_sid $username
AUTH::password_credential $tmm_auth_radius_sid $userpwd
AUTH::authenticate $tmm_auth_radius_sid
HTTP::collect
}
}
when AUTH_SUCCESS {
log "IN AUTH SUCCESS"
use pool gtwDevTomcat
if {$tmm_auth_radius_sid eq [AUTH::last_event_session_id]} {
log "setting cookieFlag 1"
set setCookieFlag 1
HTTP::release
}
}
when AUTH_FAILURE {
if {$tmm_auth_radius_sid eq [AUTH::last_event_session_id]} {
set performRedirect 1
}
}
when AUTH_WANTCREDENTIAL {
log "IN AUTH WCRED"
if {$tmm_auth_radius_sid eq [AUTH::last_event_session_id]} {
set performRedirect 1
}
}
when AUTH_ERROR {
if {$tmm_auth_radius_sid eq [AUTH::last_event_session_id]} {
set performRedirect 1
}
}
when HTTP_RESPONSE {
log "IN Response $performRedirect"
if {$performRedirect eq 1} {
HTTP::redirect http://192.168.74.202/login.htm
}
if { $setCookieFlag eq 1 } {
HTTP::cookie insert name $cookiename value $cookievalue path /
HTTP::cookie secure $cookiename enable
HTTP::cookie encrypt $cookiename $cookiepass 128
HTTP::cookie insert name $usrcookiename value $username
}
}
when HTTP_RESPONSE_DATA
{
log "IN Response $performRedirect"
}
when SERVER_DATA {
log "IN SERVER DATA"
}
I think it's because I am already in the HTTP_REQUEST_DATA method. But if I move all my code to HTTP_REQUEST then I don't get the complete data from the post..
I would appreciate if you can provide me any pointer or suggestions to resolve this issue.
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects