Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oauth-advanced sample. I got an error after I clicked login button. #93

Open
zono opened this issue Mar 23, 2018 · 3 comments
Open

oauth-advanced sample. I got an error after I clicked login button. #93

zono opened this issue Mar 23, 2018 · 3 comments

Comments

@zono
Copy link

zono commented Mar 23, 2018

Hi, I'm looking into how to fix my issue. Can you help me?

Summary

I tried OAuth tutorial "oauth-advanced sample". But I got an error after I clicked login button.

https://github.com/apigee/api-platform-samples/tree/master/sample-proxies/oauth-advanced

Steps to Reproduce

$ mkdir oauth-sample
$ cd oauth-sample
$ npm install -g yo
$ npm install -g apigeetool
$ npm install generator-oauth-auth-code-grant-sample -g 
$ yo oauth-auth-code-grant-sample 
// Followed the prompts
// Open http://myorg-test.apigee.net/web 
// Click "Login with Apigee Example Auth" Button
// Enter Email address and Password. Click Login Button.

Expected Results

Redirect to the redirect url.

Actual Results

The following error occurred.

TypeError: org.mozilla.javascript.Undefined@11005018 is not a function, it is undefined.
    at /organization/environment/api/routes/login.js:162
    at /organization/environment/api/routes/login.js:60
    at handle (/organization/environment/api/node_modules/express/lib/router/layer.js:95)
    at next (/organization/environment/api/node_modules/express/lib/router/route.js:137)
    at dispatch (/organization/environment/api/node_modules/express/lib/router/route.js:112)
    at handle (/organization/environment/api/node_modules/express/lib/router/layer.js:95)
    at /organization/environment/api/node_modules/express/lib/router/index.js:281
    at process_params (/organization/environment/api/node_modules/express/lib/router/index.js:335)
    at next (/organization/environment/api/node_modules/express/lib/router/index.js:275)
    at /organization/environment/api/node_modules/body-parser/lib/read.js:130
    at invokeCallback (/organization/environment/api/node_modules/express-http-proxy/node_modules/raw-body/index.js:224)
    at done (/organization/environment/api/node_modules/express-http-proxy/node_modules/raw-body/index.js:213)
    at onEnd (/organization/environment/api/node_modules/express-http-proxy/node_modules/raw-body/index.js:273)
    at emit (events.js:92)
    at _stream_readable.js:943
    at _tickDomainCallback (trireme.js:491)
    at _tickFromSpinner (trireme.js:422)
@zono
Copy link
Author

zono commented Mar 23, 2018

I found the bug report (#42) and description of the bug.

Note that there's a bug (#42) where certain passwords cause the registration to fail (throw a stacktrace error). For example, a password like 566559aa throws an error, while apigee123 does not. Until further notice, when trying out this sample, try using apigee123 as your password if see an error like this when you click the "Register" button.
https://github.com/apigee/api-platform-samples/tree/master/sample-proxies/oauth-advanced

I used "apigee123" but still I got the same error.

@zono
Copy link
Author

zono commented Mar 23, 2018

I found a workaround. I changed the two files then It worked.

  • routes/registration.js
validateForm = function (title, firstname, lastname, email, password, verifypassword) {
  var errors = [];
  return errors; 
}; 
  • routes/login.js
validateLoginForm = function (username, password) {
  var errors = [];
  return errors;
};

@TheDoktar
Copy link

Same issue. Have so far been unable to resolve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants