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

Crypto.subtle is available only in secure contexts (HTTPS) #1550

Open
Excel1 opened this issue Jun 20, 2024 · 4 comments
Open

Crypto.subtle is available only in secure contexts (HTTPS) #1550

Excel1 opened this issue Jun 20, 2024 · 4 comments
Labels
question Further information is requested

Comments

@Excel1
Copy link

Excel1 commented Jun 20, 2024

I am currently working on a Vue WebApp (+ Capacitor) and would like to develop in the private network, but I always get the following error message: "Crypto.subtle is available only in secure contexts (HTTPS).": It occurs as soon as I am redirected back from e.g. paypal in the web browser or with capacitor as soon as I click on the login button. My redirect_uri is http://:.

The security mechanism specifies that you should be in the protected network, which can be done by certificates etc. but is very time-consuming (especially since this is not necessary for almost all other oidc clients). It would be nice to switch off this feature for the develop operation by e.g. a parameter.

@Badisi
Copy link
Contributor

Badisi commented Jun 21, 2024

While working in a local dev environment, localhost or 127.0.0.1 are usually considered "secured".
So using http://localhost as the redirect should be fine.

You can also activate https with your Vue local dev server:

// vue.config.js
module.exports = {
  devServer: {
    ...
    host: '0.0.0.0',
    https: true,
    ...
  }
}

@Excel1
Copy link
Author

Excel1 commented Jun 21, 2024

@Badisi Correct but if you got multiple server like keycloak oidc running on your local enviroment and mobile device emulator for developing web apps (android studio) you are forced to use hostnames or ips.

Activating https results into mixed-content cause e.g. keycloak isnt running on https.

@pamapa pamapa changed the title Error: Crypto.subtle is available only in secure contexts (HTTPS) Crypto.subtle is available only in secure contexts (HTTPS) Jun 21, 2024
@pamapa pamapa added the question Further information is requested label Jun 21, 2024
@pamapa
Copy link
Member

pamapa commented Jun 21, 2024

There is no way going back. We are using browser built-in modules as much as possible. If you control you network you might can use development only proxy and handle what you need there...

You can still use v2.4.0 of this library, which does not use Crypto.subtle but custom code, which does not enforce localhost or https...

@Excel1
Copy link
Author

Excel1 commented Jun 21, 2024

I can fully understand why system components are favoured. However, it's just interesting that similarly sized/larger ones take a different path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants