Predix_Logo
  • Categories
    • Questions
    • Predix | Updates
      • Pricing
      • Product
    • Deloitte - Private
    • How-To
    • Accenture-Private
  • Explore
    • Topics
    • Questions
    • Articles
    • Feedback or Feature Requests
  • Sign in
  • Home /
  • Questions /
avatar image
0
Question by fan.yang@constellation.com · Dec 09, 2016 at 07:46 AM · predix seedoauth2

Predix-seed Oauth2 Error

After login, browser failed to load the redirected page:

http://localhost:5000/callback?code=###,

{"message":"Not Found","error":{"status":404}}

And the server console error is as follows:

Error at C:\codes\predix-seed\node_modules\passport-oauth\lib\passport-oauth\strategies\oauth2.js:125:38 at C:\codes\predix-seed\node_modules\oauth\lib\oauth2.js:177:18 at ClientRequest. (C:\codes\predix-seed\node_modules\oauth\lib\oauth2.js:148:5) at emitOne (events.js:96:13) at ClientRequest.emit (events.js:188:7) at TLSSocket.socketErrorListener (_http_client.js:309:9) at emitOne (events.js:96:13) at TLSSocket.emit (events.js:188:7) at emitErrorNT (net.js:1281:8) at _combinedTickCallback (internal/process/next_tick.js:74:11)

Comment
Add comment
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

4 Replies

  • Sort: 
avatar image
0

Answer by Steven · Oct 25, 2017 at 09:52 AM

Hi @y fan.yang@constellation.com

It seems that your callback endpoint is not working or has exceptions. Could you attach your app.js file?

One more thing is make sure your UAA client has authorization_code in Authorized Grant Types

alt text


screen-shot-2017-10-25-at-94933-am.png (34.8 kB)
Comment
Add comment · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Jackie Tran · Oct 24, 2017 at 02:56 PM

Did you all setup redirect url in uaa dashboard. Sometime if you missed setup redirect url, it's also caused callback error.

alt text

Regards, Jackie


screen-shot-2017-10-24-at-25416-pm.png (21.3 kB)
Comment
Add comment · Show 1 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Timothy Selaty · Oct 25, 2017 at 07:15 AM 1
Share

I believe what you want to add as a redirect URI is: http://localhost:5000/callback if they plan on using it like the topic creator indicated.

avatar image
0

Answer by Timothy Selaty · Dec 09, 2016 at 08:27 AM

In order for the Passport Predix OAuth to successfully handle the code provided from the authorization_code login authentication process inside of Node.JS, a callback URL has to be setup in Node.JS.

In the case of the Predix Seed repository, they should have already defined this for you on the following lines:

https://github.com/PredixDev/predix-seed/blob/develop/server/app.js#L107

 //callback route redirects to secure route after login
   app.get('/callback', passport.authenticate('predix', {
       failureRedirect: '/'
   }), function(req, res) {
       console.log('Redirecting to secure route...');
       res.redirect('/');
     });


If your localConfig.json file checks out, which you can find exampled here, https://github.com/PredixDev/predix-seed/blob/develop/server/localConfig.json then the Predix OAuth library should be able to handle the ?code= automatically. I'll download the repo and give it a shot in just a moment.

P.S. I know the Predix OAuth developers just changed the repo literally two days ago, so it might be related to that.

Comment
Add comment · Show 1 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image volodymyr.shevchyk@indeema.com · Oct 06, 2017 at 06:27 AM 0
Share

Ok, so what is the solution?

avatar image
1

Answer by sebastian.dunkel@ge.com · Apr 26, 2017 at 09:20 AM

I do have exactly the same issue. Unfortunately, I can not figure out, what I have to do to 'setup a callback URL in NodeJS'. Can anyone guide me briefly or has another solution?

Comment
Add comment · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Follow this Question

Answers Answers and Comments

69 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Error when access Predix View decks API 9 Answers

Getting invalid scope error while logging into predix seed 3 Answers

How to get user info from Predix using OAuth2 authentication strategy 1 Answer

predix-seed not authenticating UAA instance 3 Answers

403 Error when POST to Predix Views /api/decks 3 Answers

GE Monogram
  • Legal
  • Cookies
  • Forum Terms
  • Contact Us
  • Copyright © 2017 General Electric Company. All rights reserved.


Enterprise
Social Q&A

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Submit your feedback or feature request
  • Categories
  • Questions
  • Predix | Updates
    • Pricing
    • Product
  • Deloitte - Private
  • How-To
  • Accenture-Private
  • Explore
  • Topics
  • Questions
  • Articles
  • Feedback or Feature Requests