I'm working on custom OAuth2 Authorization Server (old initial version @ https://github.com/gvaduha/OAuth2CppLib) that compliant with RFC6749 and would like to use hello.js for one-page clients. What I've done to start with it:
- created src/modules/myoauth.js
(function(hello){
hello.init({
myoauth : {
name : 'myoauth',
oauth : {
version : 2,
auth : 'https://localhost/oauth2/authorize',
grant : 'https://localhost/oauth2/token'
},
refresh : false,
scope : {
basic : 'profile'
},
scope_delim : ' ',
base : 'https://localhost/',
get : {
"me" : "profile"
},
}
});
})(hello);
- added provider to demos/client_ids.js
var CLIENT_IDS = {
myoauth : 'OAuthTestClientId',
windows : WINDOWS_CLIENT_ID,
google : GOOGLE_CLIENT_ID,
facebook : FACEBOOK_CLIENT_ID
};
- added following lines to demos/login-events.html
<button onclick="login('myoauth')">Login myoauth</button>
<script src="../src/modules/myoauth.js"></script>
But all this for nothing. When I click login page following my server authentication then authorization then page reply with 302 redirect to
and when I closing popup page says
callback:{
"error": {
"code": "cancelled",
"message": "Login has been cancelled"
},
"network": "myoauth"
}auth:{
"error": {
"code": "cancelled",
"message": "Login has been cancelled"
},
"network": "myoauth"
}auth.failed:{
"error": {
"code": "cancelled",
"message": "Login has been cancelled"
},
"network": "myoauth"
}
What have I done wrong? BTW: Google works correct when I've changed it's id to point to my registered application client.