2

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:

  1. 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);
  1. added provider to demos/client_ids.js
var CLIENT_IDS = {
    myoauth : 'OAuthTestClientId',
    windows : WINDOWS_CLIENT_ID,
    google : GOOGLE_CLIENT_ID,
    facebook : FACEBOOK_CLIENT_ID
};
  1. 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

http://localhost/xxx/redirect.html#token_type=Bearer&access_token=XkGxfTVZWgdFuXTuc64du8DK375JurgOT2CDqv0QGd&expires_in=3600&

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.

1 Answer 1

2

The OAuth2 response does not appear to maintain the 'state' URI parameter in your example given.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks, my server really has bug there! Could you extend error messages to clarify the source of problem?
Please mark this as the solution and create a ticket at github.com/mrswitch/hello.js/issues :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.