I have a Synology DS212j and already set up the apache and now also SSO Server. In the SSO Server Settings I added a new Application (Name, REdirect URI). My Code now is:
<html>
<head>
<!-- include Synology SSO js -->
<script src="http://NASADRESSE:5555/webman/sso/synoSSO-1.0.0.js"></script>
</head>
<body>
<script>
function setButton (logged) {
if (logged) {
document.getElementById('button').innerHTML = '<button onclick="SYNOSSO.logout()">Logout</button>';
} else {
document.getElementById('button').innerHTML = '<button onclick="SYNOSSO.login()">Login</button>';
}
}
function authCallback(reponse) {
console.log(JSON.stringify(reponse));
if (reponse.status == 'login') {
console.log('logged');
setButton(true);
}
else {
console.log('not logged ' + reponse.status);
setButton(false);
}
}
SYNOSSO.init({
oauthserver_url: 'NASADRESSE:5555',
app_id: '9a23da153795803e0334d9873b0013dd',
redirect_uri: 'NASADDRESSE/?redirect',
callback: authCallback
});
</script>
<h1> Syno SSO test</h1>
<p id='button'></p>
</body>
</html>
NASADRESSE is correct and my Rooter redirect port 5555 to 5000. Wenn I click login, a popup window opens where I can loggin with my NAS user. But it always says its a wrong password. But I entered the right one.
1 - install the Directory Server package, enable LDAP server
2 - configure your DSM to connect to it (Control Panel-> Domain/LDAP)
3 - connect using the LDAP users