You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The AzureAD provider implementation has been significantly modified, changing from v2.0 endpoints to older v1.0 endpoints and removing custom parameters. This could break existing integrations and may not be backward compatible.
The empty provider user ID validation is added after profile fetching but should be validated to ensure it doesn't interfere with legitimate empty ID scenarios from certain OAuth providers.
ifprofile.ProviderUserID=="" {
logger.ErrorContext(ctx, "provider user id is empty")
return oidc.Profile{}, ErrOauthProfileFetchFailed
}
The EntraID provider implementation lacks comprehensive error handling for API failures and should validate the user profile structure more thoroughly before constructing the final profile.
Latest suggestions up to 3149fbb
Explore these optional code suggestions:
Category
Suggestion
Impact
General
Update to OAuth v2.0 endpoints
The AzureAD provider is using OAuth 2.0 v1.0 endpoints instead of the modern v2.0 endpoints. This could cause compatibility issues and limits access to newer Microsoft Graph features. Update to use v2.0 endpoints for consistency with the EntraID provider.
Why: The suggestion correctly identifies that the AzureAD provider should use v2.0 endpoints for consistency with modern OAuth standards and the new EntraID provider. This improves compatibility and access to newer features.
Medium
Use Microsoft Graph userinfo endpoint
The profile URL is using the v1.0 OpenID endpoint which may not provide consistent user information. For better compatibility and consistency with the EntraID provider, use the Microsoft Graph userinfo endpoint instead.
Why: The suggestion correctly points out that using the Microsoft Graph userinfo endpoint provides better consistency with the EntraID provider and more reliable user information access.
Low
Eliminate duplicate scope arrays
Having identical scope arrays creates maintenance overhead and potential inconsistency. Consider making DefaultEntraIDScopes reference DefaultAzureadScopes to maintain a single source of truth.
// DefaultAzureadScopes defines the default scopes for AzureAd OAuth2.
DefaultAzureadScopes = []string{"email", "profile", "openid", "offline_access"}
// DefaultEntraIDScopes defines the default scopes for EntraID OAuth2.
-DefaultEntraIDScopes = []string{"email", "profile", "openid", "offline_access"}+DefaultEntraIDScopes = DefaultAzureadScopes
Suggestion importance[1-10]: 6
__
Why: Valid suggestion to reduce code duplication by making DefaultEntraIDScopes reference DefaultAzureadScopes. This improves maintainability and ensures consistency between the two scope arrays.
Low
Move validation check earlier
The validation should occur before any profile processing to avoid unnecessary work. Consider moving this check earlier in the function flow to fail fast when the provider user ID is missing.
+if profile.ProviderUserID == "" {+ logger.ErrorContext(ctx, "provider user id is empty")+ return oidc.Profile{}, ErrOauthProfileFetchFailed+}-
Suggestion importance[1-10]: 4
__
Why: The suggestion is technically correct but lacks context about where to move the check. The improved_code is identical to existing_code, showing no actual improvement.
The OAuth2 endpoints are using incorrect paths for Azure AD. Azure AD v2.0 endpoints require /oauth2/v2.0/authorize and /oauth2/v2.0/token paths to function properly.
Why: This is a critical bug fix. The Azure AD OAuth endpoints require /oauth2/v2.0/ paths to function properly, and using incorrect paths would cause authentication failures.
High
Use correct Microsoft Graph endpoint
The profile URL path is incorrect for Azure AD. The correct Microsoft Graph endpoint for user information is https://graph.microsoft.com/oidc/userinfo, not a tenant-specific URL.
Why: This is a critical bug fix. The Microsoft Graph API endpoint for user information is https://graph.microsoft.com/oidc/userinfo, not a tenant-specific URL, and using the wrong endpoint would cause profile fetching to fail.
dbarrosop
changed the title
feat: add EntraID in favor of AzureAD and restore old behavior
feat: added EntraID in favor of AzureAD and restore old behavior
Aug 26, 2025
dbarrosop
changed the title
feat: added EntraID in favor of AzureAD and restore old behavior
feat: added EntraID in favor of AzureAD and restored old behavior for AzureAD
Aug 26, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Type
Enhancement
Description
Add EntraID OAuth provider as replacement for deprecated AzureAD
Deprecate AzureAD provider with warning message
Fix OAuth profile validation for empty provider user IDs
Update API types and OpenAPI specification
Diagram Walkthrough
File Walkthrough
9 files
Update generated API server with EntraID supportAdd EntraID constants to generated typesAdd EntraID provider configuration and deprecation warningAdd EntraID CLI flags and configurationSimplify AzureAD provider implementationImplement new EntraID OAuth providerAdd default scopes for EntraID providerAdd EntraID provider migration rollbackAdd EntraID provider database migration2 files
Fix linter comment for credential ID constantFix linter comment for credential ID constant2 files
Add validation for empty provider user IDAdd validation for empty provider user ID1 files
Update linter configuration for issue limits1 files
Add EntraID to OpenAPI specification