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

No way to check if server supports UserInfo #641

Closed
crawshaw opened this issue Apr 24, 2023 · 1 comment
Closed

No way to check if server supports UserInfo #641

crawshaw opened this issue Apr 24, 2023 · 1 comment

Comments

@crawshaw
Copy link
Member

The server's .well-known/openid-configuration reports a UserInfo endpoint which is used in the UserInfo method. If the OIDC provider does not report an endpoint, UserInfo reports an error. But there is no way programmatically check beforehand and no way to check the error message other than string matching:

ui, err = provider.UserInfo(ctx, source)
if !strings.Contains(err.Error(), "user info endpoint is not supported") {
        // handle it
}

It would be nice if it were possible to avoid string matching on the error. Perhaps either something to pass to errors.Is or a mechanism for inspecting the contents of the .well-known/openid-configuration that the oauth2 package fetched?

@crawshaw
Copy link
Member Author

Turns out this error comes from another package. Sorry for the noise, filed elsewhere: coreos/go-oidc#373

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

No branches or pull requests

1 participant