Hyperlink redirect to the main page instead of authentication page

I currently encounter a problem that needs to set a hyperlink like this

<a href=http://example.com."></a> 

to another website (SSO). But instead of automatically redirect to the login page “http://example.com/login”, I want to automatically login on the page (http://example.com) to improve the user experience using the username and password stored in the database.

Is it possible to do this? Appreciated to the help of any kinds