Skip to content

Commit

Permalink
added documentation that explains the resoning behind fetching primar…
Browse files Browse the repository at this point in the history
…y email for GitHub
  • Loading branch information
feyruzb committed Jan 9, 2025
1 parent 2aadc99 commit 9630841
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/web/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,9 @@ CodeChecker also supports OAUTH-based authentication. The `authentication.method
* Important: 'oauth_callback_url' must always match with link specified in the
Providers settings when issuing an access token.

* Important: As of the time this code was written, GitHub does not support PKCE (Proof Key for Code Exchange). Therefore, users logging in with GitHub cannot use PKCE. If GitHub starts supporting PKCE in the future, the code should automatically start using it.
* Important: At the time this code was written, GitHub doesn't support PKCE (Proof Key for Code Exchange). Therefore PKCE is not used when users log in using GitHub. If GitHub starts supporting PKCE in the future, the code should automatically start using it ,and in that case, this note can be removed.

* Important: For consistency between GitHub and other providers, we need to fetch primary email from another endpoint because GitHub dosn't provide the primary email in the `user_info`, so we make an API request to fetch the primary email of the GitHub and use it instead of the username provided by the `user_info`.

# Client-side configuration <a name="client-side-configuration"></a>

Expand Down
3 changes: 3 additions & 0 deletions web/server/codechecker_server/api/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,9 @@ def performLogin(self, auth_method, auth_string):
codechecker_api_shared.ttypes.ErrorCode.AUTH_DENIED,
"User info fetch failed.")

# if the provider is github it fetches primary email
# from another api endpoint to maintain username as email
# consistency between GitHub and other providers
if provider == "github" and \
"localhost" not in user_info_url:
try:
Expand Down

0 comments on commit 9630841

Please sign in to comment.