Okta教程(appBaseUrl丢失)

少年击剑更吹箫,剑气箫心一例消。这篇文章主要讲述Okta教程:appBaseUrl丢失相关的知识,希望能为你提供帮助。
遵循了Okta with expressjs的教程,使用二者(https://developer.okta.com/blog/2019/05/31/simple-auth-express-fifteen-minutes)创建了一个简单的身份验证,并最终克隆了仓库以对其进行处理。安装了软件包,但是在运行npm start时抛出了一些错误。因此,我决定安装每个软件包的最新版本。试图再次运行该项目,但这次此错误弹出:

> okta_tutorial@1.0.0 start /Users/tomas/Documents/software/okta_tutorial > nodemon .[nodemon] 2.0.2 [nodemon] to restart at any time, enter `rs` [nodemon] watching dir(s): *.* [nodemon] watching extensions: js,mjs,json [nodemon] starting `node .` /Users/tomas/Documents/software/okta_tutorial/node_modules/@okta/configuration-validation/dist/lib.js:144 throw new ConfigurationValidationError('Your appBaseUrl is missing.'); ^Error: Your appBaseUrl is missing. at new ConfigurationValidationError (/Users/tomas/Documents/software/okta_tutorial/node_modules/@okta/configuration-validation/dist/lib.js:29:141) at configUtil.assertAppBaseUrl (/Users/tomas/Documents/software/okta_tutorial/node_modules/@okta/configuration-validation/dist/lib.js:144:11) at new ExpressOIDC (/Users/tomas/Documents/software/okta_tutorial/node_modules/@okta/oidc-middleware/src/ExpressOIDC.js:79:5) at Object.< anonymous> (/Users/tomas/Documents/software/okta_tutorial/index.js:24:14) at Module._compile (internal/modules/cjs/loader.js:1147:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10) at Module.load (internal/modules/cjs/loader.js:996:32) at Function.Module._load (internal/modules/cjs/loader.js:896:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) at internal/main/run_main_module.js:17:47 [nodemon] app crashed - waiting for file changes before starting...

【Okta教程(appBaseUrl丢失)】我有一个Okta Developer的基本URL,看起来像https://dev-xxxxxx.okta.com
我的.env文件也随该教程一起提供了所有必需的信息。
答案解决方案编号1将appBaseUrl属性添加到要传递给ExpressOIDC的对象中>
const oidc = new ExpressOIDC({ appBaseUrl: process.env.OKTA_BASEAPP_URL, issuer: process.env.OKTA_DOMAIN, client_id: process.env.OKTA_CLIENT_ID, client_secret: process.env.OKTA_CLIENT_SECRET, redirect_uri: process.env.OKTA_REDIRECT_URL, scope: process.env.OKTA_SCOPE }); 解决方案编号2
第一个是将@okta/oidc-middleware的版本降级为1.0.2首先删除节点程序包$ rm -rf ./node_modules
第二,在package.json中,将@okta/oidc-middleware的版本更改为1.0.2

第三安装节点模块$ npm install


    推荐阅读