Skip to content

feat(oidc): more detailed error messages and error validation #2944

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

fiftin
Copy link
Collaborator

@fiftin fiftin commented Apr 20, 2025

No description provided.

@fiftin fiftin requested a review from Copilot April 20, 2025 18:59
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances error handling for OIDC logins by providing more detailed error messages and validations while adding a configuration toggle to disable automatic user creation.

  • Adds a new field 'DisableUserCreation' to the OIDC provider configuration in OdbcProvider.go.
  • Improves logging in api/login.go by replacing generic log.Error calls with more detailed log.Errorf messages and additional validation around token and user info processing.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
util/OdbcProvider.go Adds new configuration flag 'DisableUserCreation' to control user creation behavior.
api/login.go Enhances error logging for OAuth state, token verification, and user retrieval processes.
Comments suppressed due to low confidence (2)

util/OdbcProvider.go:20

  • [nitpick] Consider adding a brief inline comment to clarify the purpose and usage of the 'DisableUserCreation' flag for future maintainability.
DisableUserCreation bool `json:"disable_user_creation"`

api/login.go:664

  • [nitpick] Consider reusing the error variable 'err' instead of introducing 'err2' multiple times to improve consistency in error handling.
idToken, err2 := verifier.Verify(ctx, rawIDToken)

@fiftin fiftin linked an issue Apr 21, 2025 that may be closed by this pull request
@fiftin fiftin requested a review from mgukov April 25, 2025 15:48
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

Successfully merging this pull request may close these issues.

Problem: No LDAP logs
2 participants