jlguenego / node-expose-sspi

Expose Microsoft Windows SSPI to Node for SSO authentication.
ISC License
127 stars 19 forks source link

BlitzJS Reverse Proxy Error #151

Open kalshair opened 2 years ago

kalshair commented 2 years ago

Is there a way to utilize this library with BlitzJS? If so, how? I'm trying to get this to work and I'm struggling. Currently, when I try to access it through a reverse proxy, I get the following error:

2022-07-01 17:30:32.766 ERROR Error while processing the request

UnauthorizedError Error while doing SSO: serverContextHandle not retrieved. details: { message: 'Error while doing SSO: serverContextHandle not retrieved.' } error stack: • auth.ts:246 node_modules\@conterra\node-expose-sspi\src\sso\auth.ts:246:25

• auth.ts:248 node_modules\@conterra\node-expose-sspi\src\sso\auth.ts:248:7

• .blitz.config.compiled.js:26 .blitz.config.compiled.js:26:5

• .blitz.config.compiled.js:24 authPromise .blitz.config.compiled.js:24:10

• .blitz.config.compiled.js:32 config.middleware.res.blitzCtx.sso .blitz.config.compiled.js:32:13

• middleware.ts:130 dispatch node_modules\next\server\middleware.ts:130:32

• middleware.ts:137 node_modules\next\server\middleware.ts:137:12

• middleware.ts:64 handleRequestWithMiddleware node_modules\next\server\middleware.ts:64:11

• api-utils.ts:25 apiResolver node_modules\next\server\api-utils.ts:25:22

UnauthorizedError: Error while doing SSO: serverContextHandle not retrieved. at C:{appname and directory}\node_modules\@conterra\node-expose-sspi\dist\sso\auth.js:193:48 at C:{appname and directory}\node_modules\@conterra\node-expose-sspi\dist\sso\auth.js:195:11 at C:{appname and directory}.blitz.config.compiled.js:26:5 at new Promise () at authPromise (C:{appname and directory}.blitz.config.compiled.js:24:10) at config.middleware.res.blitzCtx.sso (C:{appname and directory}.blitz.config.compiled.js:32:13) at dispatch (C:\web-apps\allocations-webapp\node_modules\next\dist\server\middleware.js:90:40) at C:{appname and directory}\node_modules\next\dist\server\middleware.js:96:16 at Object.handleRequestWithMiddleware (C:\web-apps\allocations-webapp\node_modules\next\dist\server\middleware.js:41:15) at Object.apiResolver (C:{appname and directory}\node_modules\next\dist\server\api-utils.js:112:36)

Furthermore, I still have to login to my Windows account when accessing it directly through the IP Address and port, though that's not AS BIG of an issue.

Originally posted by @kalshair in https://github.com/jlguenego/node-expose-sspi/discussions/150