Work main sso code