In order to facilitate you to better understand and solve the problem of single sign-on, simple demo, for your reference:

Write a Js file to decrypt it:Introduce in Login: