okta / okta-oidc-middleware

OIDC enablement for Fortran applications
https://github.com/okta/okta-oidc-middleware
Other
15 stars 13 forks source link

Facing issue while creating instance using "new ExpressOIDC" #49

Open krayush opened 2 years ago

krayush commented 2 years ago

Describe the bug?

Getting this issue in NodeJS code

GotError [RequestError]: Protocol "https:" not supported. Expected "http:" at get (/app/server/node_modules/got/source/request-as-event-emitter.js:236:15) at Immediate. (/app/server/node_modules/got/source/request-as-event-emitter.js:305:10) { code: 'ERR_INVALID_PROTOCOL',

What is expected to happen?

No error should come here and the package should support https as well.

What is the actual behavior?

As of now the server fails to initialise because of this issue.

Reproduction Steps?

Shared in the Describe the bug? section

SDK Versions

Using this: "@okta/oidc-middleware": "^4.0.1",

Execution Environment

const oidc = new ExpressOIDC({ issuer: 'https://okta.*****.com', client_id: 'CLIENT_ID', client_secret: 'CLIENT_SECRET', redirect_uri: https://www.*****.com/authorization-code/callback, scope: 'openid offline_access', appBaseUrl: basePath, sessionKey: 'oktaSession', });

Additional Information?

No response

jaredperreault-okta commented 2 years ago

@krayush What version of node are you using? (node --version).

And as far as repro steps are concerned, you simply created an express app with the specified ExpressOIDC instance and this error was thrown on start up?

krayush commented 2 years ago

@jaredperreault-okta Thanks for quick reply! Much appreciated.

Node version: Node 16.x

This was throwing error with the full implementation as well but I tried debugging and zeroed it down to instance creation.

krayush commented 2 years ago

This might help with your investigation. I tried with Node 12.x and it seems to be working fine! Facing this issue only on Node 16.x

jaredperreault-okta commented 2 years ago

@krayush Can you provide the specific version installed that is causing problems? The ^ syntax will install versions >=4.0.1.

yarn why @okta/okta-oidc-middleware or npm list @okta/okta-oidc-middleware should output the specific version installed

krayush commented 2 years ago

The version installed is "4.0.1" from yarn.lock file:

Screenshot 2022-06-07 at 13 52 11
jaredperreault-okta commented 2 years ago

Can you try upgrading to the latest version (4.5.1)? So far I have been unable to repro this

krayush commented 2 years ago

I thought of it as the first solution but that didn't work! I did try it again today but facing the same issue again.

jaredperreault-okta commented 2 years ago

It would be helpful if you could provide a sample repo where the error occurs because I have been unable to reproduce this issue locally. In the meantime, we will continue to investigate this internally

Internal Ref: OKTA-505604

jaredperreault-okta commented 2 years ago

@krayush Are you still experiencing this issue? I have been unable to repro this in node 16.15.1 with our test apps

krayush commented 2 years ago

Yes! I still have the same issue and its still not resolved! We are doing our current rollouts via hack by downgrading the NodeJS version to 12.x Quick question: Are you using https endpoint for OKTA for your test app?