Google and FB correctly support "state" parameter for oauth. How about Yahoo ?
How to pass custom data across requests in Yahoo oauth process ?
The Yahoo OAuth2 implementation supports the parameter state. You can attach it within the main request. This is a basic php-example:
https://api.login.yahoo.com/oauth2/request_auth?client_id='.$client_id.'&redirect_uri='.$redirect_uri.'&response_type=code&state='.$state