oauth-advanced sample. I got an error after I clicked login button.
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)
I found the bug report (https://github.com/apigee/api-platform-samples/issues/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.
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;
};
Same issue. Have so far been unable to resolve.