markbates / markbates/goth

OpenID Connect and default http Client

Open
#283 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
6.6k
Forks
631
PR merge metrics
No merged PRs in 30d

Description

In the OpenID Connect provider, it's not possible to change the http Client used to fetch the discovery url.

```go
openidConnect, _ := openidConnect.New(os.Getenv("OPENID_CONNECT_KEY"), os.Getenv("OPENID_CONNECT_SECRET"), "http://localhost:3000/auth/openid-connect/callback", os.Getenv("OPENID_CONNECT_DISCOVERY_URL"))
if openidConnect != nil {
goth.UseProviders(openidConnect)
}
```
Setting `openidConnect. HTTPClient` after new will not work as the call to the Discovery endpoint is done within the new function by calling `openIDConfig, err := getOpenIDConfig(p, openIDAutoDiscoveryURL)`

Happy to work on a PR, but i am not sure how to approach that, i could create a new New with a parameter for the http client, but that would break the pattern and stand out from the other provider. Any suggestion on how to allow to change the HTTPClient there?a package variable in the openid connect provider could work as well, and modification of the Client function

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the OpenID Connect provider's New function and the getOpenIDConfig call that fetches the discovery URL, then inspect how HTTPClient and the Client function are defined. Determine an approach that lets callers choose the HTTP client without breaking the provider pattern, and verify that discovery requests use the selected client.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
authentication
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.