panva / openid-client

OAuth 2 / OpenID Connect Client API for JavaScript Runtimes
MIT License
1.83k stars 392 forks source link

URL is not a constructor at Issuer.request #659

Closed techyvenki closed 8 months ago

techyvenki commented 8 months ago

Describe the bug

Try to integrate azure pkce app into react application.

when trying to create issuer

const Issuer = await Issuer.discover(‘https://url’)

it is giving error:

URL is not a constructor at Issuer.request

In request.js in your plugin I see

const {URL} = require(‘url’)

I see this is causing the issue when I make the above line changed to

const {Url} = required(‘url’)

I see it is not complying in a different page of my code

To Reproduce Issuer and Client configuration: (inline or gist) - Don't forget to redact your secrets.

// Issuer configuration (issuer.metadata) and how it is constructed (discovery or manual?)
{
  // ...
}
// Client configuration (client.metadata) and how it is constructed (fromUri or manual?)
{
  // ...
}

Steps to reproduce the behaviour:

Expected behaviour A clear and concise description of what you expected to happen.

Environment:

Additional context Add any other context about the problem here.

panva commented 8 months ago

react application

This is a Node.js only module.