Неизвестная стратегия аутентификации "oidc" в okta login - PullRequest
0 голосов
/ 31 декабря 2018

Вот полное сообщение об ошибке,

`Unknown authentication strategy "oidc" Error: Unknown authentication strategy "oidc" at attempt    
(/Users/brettwalton/Documents/cfb/cfb/node_modules/passport/lib/middleware/authenticate.js:173:37) at authenticate 
(/Users/brettwalton/Documents/cfb/cfb/node_modules/passport/lib/middleware/authenticate.js:349:7) at Layer.handle [as handle_request]     
(/Users/brettwalton/Documents/cfb/cfb/node_modules/express/lib/router/layer.js:95:5) at trim_prefix 
(/Users/brettwalton/Documents/cfb/cfb/node_modules/express/lib/router/index.js:317:13) at 
/Users/brettwalton/Documents/cfb/cfb/node_modules/express/lib/router/index.js:284:7 at Function.process_params 
(/Users/brettwalton/Documents/cfb/cfb/node_modules/express/lib/router/index.js:335:12) at next 
(/Users/brettwalton/Documents/cfb/cfb/node_modules/express/lib/router/index.js:275:10) at SessionStrategy.strategy.pass 
(/Users/brettwalton/Documents/cfb/cfb/node_modules/passport/lib/middleware/authenticate.js:325:9) at SessionStrategy.authenticate 
(/Users/brettwalton/Documents/cfb/cfb/node_modules/passport/lib/strategies/session.js:71:10) at attempt 
(/Users/brettwalton/Documents/cfb/cfb/node_modules/passport/lib/middleware/authenticate.js:348:16)`

Я почти уверен, что это как-то связано с тем, что я вставил сюда, так как я новичок в javascript.Я редактировал код, когда он не аутентифицировал пользователей.

var oktaClient = new okta.Client({
  orgUrl: '{https://dev-232123.oktapreview.com}',
  token: 'xxxxxxxxxx'
});
const oidc = new ExpressOIDC({
  issuer: "https://{dev-232123.oktapreview.com}/oauth2/default",
  client_id: 'xxxxxxxxx',
  client_secret: 'xxxxxxxx',
  redirect_uri: 'http://localhost:3000/users/callback',
  scope: "openid profile",
  routes: {
    login: {
      path: "/users/login"
    },
    callback: {
      path: "/users/callback",
      defaultRedirect: "/dashboard"
    }
  }
});
...