Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
krayush opened this issue Jun 1, 2022 · 10 comments
Open

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

krayush opened this issue Jun 1, 2022 · 10 comments
Labels
bug Something isn't working

Comments

@krayush
Copy link

krayush commented Jun 1, 2022

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

@krayush krayush added the bug Something isn't working label Jun 1, 2022
@jaredperreault-okta
Copy link
Contributor

@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
Copy link
Author

krayush commented Jun 1, 2022

@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
Copy link
Author

krayush commented Jun 2, 2022

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
Copy link
Contributor

@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
Copy link
Author

krayush commented Jun 7, 2022

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

Screenshot 2022-06-07 at 13 52 11

@jaredperreault-okta
Copy link
Contributor

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

@krayush
Copy link
Author

krayush commented Jun 8, 2022

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
Copy link
Contributor

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
Copy link
Contributor

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

@krayush
Copy link
Author

krayush commented Aug 18, 2022

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants