go-oidc icon indicating copy to clipboard operation
go-oidc copied to clipboard

well-known URLs not accessible from `Provider`

Open tfahrenreich opened this issue 10 months ago • 3 comments

It would be helpful to be able to call ProviderConfig() on Provider to return a reusable config, or make the fields not private

I'm working on a project that requires caching the OpenID discovery request.

From Provider I'm trying to extract the fields needed to create a ProviderConfig which I can then cache and recall using ProviderConfig.NewProvider

Is there a reason to keep fields on Provider private? Some are available through UserInfoEndpoint and Endpoint. These aren't sensitive URLs since they're publicly available through discovery.

Please let me know if there's another method for retrieving these fields that I might be missing. Thanks!

tfahrenreich avatar Apr 03 '24 19:04 tfahrenreich

Would you mind showing an example of what you're trying to do? Are you trying to serialize the state of a Provider instance?

ericchiang avatar Apr 04 '24 00:04 ericchiang

@ericchiang I think he want to reuse and not fetching each time, having the same scenario , azure legging in response once in a while and I prefer to cache but deosnt seems that the functionality exists

amir4895 avatar Aug 19 '24 20:08 amir4895

I have the same request. Discord's openid-configuration doesn't hold a userinfo_endpoint even tho it is supported (and required).

A helper method to set the UserInfoURL manually would already help.

YoSev avatar Sep 15 '24 17:09 YoSev