Skip to content

Redirect URL not working for GitHub provider #605

Open
@kathrindc

Description

@kathrindc

Hi there,
I'm trying to get GitHub authentication working at the moment, but I'm running into an issue where the provider is seemingly not setting the redirect_uri query parameter when redirecting to GitHub's authorize endpoint. I think I am configuring it correctly and I double-checked that my redirect URL is set to localhost, but I still get redirected to the prod domain.

var (
	ghClientId     = os.Getenv("OAUTH_GITHUB_CLIENT_ID")
	ghClientSecret = os.Getenv("OAUTH_GITHUB_CLIENT_SECRET")
	ghRedirectUrl  = os.Getenv("OAUTH_GITHUB_REDIRECT_URL")
)

func main() {
	// ...

	goth.UseProviders(
		github.New(ghClientId, ghClientSecret, ghRedirectUrl, "email"),
	)

	// ...
}

When I check the redirects in my browser's developer tools it's visible that the redirect_uri parameter is missing entirely.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions