Finished most of the token-login. Just miss connecting to smmdb and read the response.