Forum Discussion
External Posting to APM with dynamic URL
- Sep 16, 2019
Hi Sajid,
In fact we have to decoded payload using "[URI::decode [HTTP::payload]]"
Payload:
is=txtURL=https%3A%2F%2Ftrnapp01.example.com%3A443%2Fappmanager%2Fabc&username=user123&password=%40password123
decoded raw:
is=txtURL=https://trnapp01.example.com:443/appmanager/abc&username=user123&password=@password123
now we have to set the right regex in your irule:
when HTTP_REQUEST_DATA { set payload [URI::decode [HTTP::payload]] set username [URI::query "?[HTTP::payload]" username] set password [URI::query [URI::decode "?[HTTP::payload]"] password] regexp {^.*txtURL=([^&]+).*$} $payload -> gotURL log local0. "Username: $username - password : $password - gotURL: $gotURL" HTTP::release }
keep me in touch.
regards
Hi Sajid,
In fact we have to decoded payload using "[URI::decode [HTTP::payload]]"
Payload:
is=txtURL=https%3A%2F%2Ftrnapp01.example.com%3A443%2Fappmanager%2Fabc&username=user123&password=%40password123
decoded raw:
is=txtURL=https://trnapp01.example.com:443/appmanager/abc&username=user123&password=@password123
now we have to set the right regex in your irule:
when HTTP_REQUEST_DATA {
set payload [URI::decode [HTTP::payload]]
set username [URI::query "?[HTTP::payload]" username]
set password [URI::query [URI::decode "?[HTTP::payload]"] password]
regexp {^.*txtURL=([^&]+).*$} $payload -> gotURL
log local0. "Username: $username - password : $password - gotURL: $gotURL"
HTTP::release
}
keep me in touch.
regards
- Stanislas_Piro2Sep 17, 2019Cumulonimbus
Hi,
The goal of encoding is to allow special characters in strings. so first extract content, the decode it...
In this line:
set password [URI::query [URI::decode "?[HTTP::payload]"] password]
what is the result if password contains a "&" ? password variable will contain only string up to this character...
set password [URI::decode [URI::query "?[HTTP::payload]" password]]
This line first get the password parameter, then decode it...
Same behavior with regexp...
set payload [HTTP::payload] regexp {^.*txtURL=([^&]+).*$} $payload -> gotURL set gotURL [URI::decode $gotURL]
Recent Discussions
Related Content
* 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