Custom route and extract data from slashes and parameter

some external website is going to send a specific data into a WordPress site and need to extract and process it. The data is coming trough URL (between slashes and as parameter):

domain.com/login_sso/username/timestamp/token?redirect=some-data

I need to create some script that listens to that URL domain.com/logun_sso/ and extracts the username, timestamp, token and redirect parameter.

Something like, when somebody hits domain.com/login_sso/ extract some data between slashes and paramter. I figured out to extract the parameters with parse_url but I don't know if is the best way

Any ideas? I need some orientation here. Thank you.

Topic routing rewrite-rules functions url-rewriting urls Wordpress

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.