Skip to content
This repository was archived by the owner on Aug 24, 2025. It is now read-only.

Conversation

@mokarchi
Copy link

راهنمای پیکربندی OAuth Providers

محیط Development

  1. OAuth Applications ایجاد کنید در:

  2. User Secrets را تنظیم کنید:

dotnet user-secrets set "Authentication:Google:ClientId" "your-client-id"
dotnet user-secrets set "Authentication:Google:ClientSecret" "your-client-secret"
# ... بقیه providers

محیط Production

Environment Variables را تنظیم کنید:

Authentication__Google__ClientId
Authentication__Google__ClientSecret
Authentication__Google__Enabled

Callback URLs

در OAuth applications خود این URLها را تنظیم کنید:

  • Google: https://yourdomain.com/signin-google
  • Microsoft: https://yourdomain.com/signin-microsoft
  • GitHub: https://yourdomain.com/signin-github

Updated package references for GitHub and Google authentication. Enhanced identity management with new service registrations and conditional password handling. Improved user interface for login and registration, including error handling for external logins. Added configuration settings for OAuth options in appsettings files. Introduced new classes and services for managing external logins, along with a confirmation view model and corresponding UI.
The version of the ASP.NET Core Identity SDK has been updated from 9.0.303 to 9.0.304 in both the `README.md` and `global.json` files.
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @mokarchi, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

این درخواست کشش، پشتیبانی از احراز هویت خارجی را به برنامه اضافه می‌کند و به کاربران امکان می‌دهد با استفاده از حساب‌های Google، Microsoft و GitHub خود وارد شوند یا ثبت‌نام کنند. علاوه بر این، بهبودهایی در رابط کاربری صفحات ورود و ثبت‌نام اعمال شده است تا گزینه‌های ورود خارجی به صورت واضح‌تری نمایش داده شوند. این تغییرات تجربه کاربری را بهبود بخشیده و انعطاف‌پذیری بیشتری در فرآیند احراز هویت فراهم می‌کند.

Highlights

  • افزودن احراز هویت خارجی: پشتیبانی از احراز هویت خارجی با استفاده از ارائه‌دهندگان محبوب مانند Google، Microsoft و GitHub اضافه شده است. این قابلیت به کاربران امکان می‌دهد با حساب‌های موجود خود در این سرویس‌ها وارد شوند یا ثبت‌نام کنند.
  • بهبودهای رابط کاربری (UI) در صفحات ورود و ثبت‌نام: صفحات ورود و ثبت‌نام به‌روزرسانی شده‌اند تا گزینه‌های ورود و ثبت‌نام از طریق ارائه‌دهندگان احراز هویت خارجی را به صورت بصری و کاربرپسند نمایش دهند. این بهبودها تجربه کاربری را هنگام انتخاب روش احراز هویت افزایش می‌دهند.
  • پیاده‌سازی منطق و مدل‌های جدید برای مدیریت ورود خارجی: سرویس‌ها و مدل‌های نمایش جدیدی برای مدیریت جریان احراز هویت خارجی، از جمله تأیید اطلاعات کاربر و افزودن لاگین‌های خارجی به حساب‌های موجود، پیاده‌سازی شده‌اند. این تغییرات زیرساخت لازم برای ادغام یکپارچه را فراهم می‌کنند.
  • پیکربندی آسان ارائه‌دهندگان احراز هویت خارجی: تنظیمات مربوط به کلیدهای API و رازهای مشتری برای ارائه‌دهندگان احراز هویت خارجی به فایل‌های پیکربندی (appsettings.json) اضافه شده است، که امکان فعال‌سازی و پیکربندی آسان این قابلیت‌ها را در محیط‌های مختلف فراهم می‌کند.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@what-the-diff
Copy link

what-the-diff bot commented Aug 24, 2025

PR Summary

  • Updated Package Versions

    • Introduced new dependencies AspNet.Security.OAuth.GitHub and Microsoft.AspNetCore.Authentication.Google and updated several existing packages to their latest versions.
  • Modernized Service Registration

    • Extended AddCustomServicesExtensions.cs to include registration for handling external login processes.
  • Implemented Interface for External Login Service

    • Created IExternalLoginService.cs, a new interface definition focusing on external login processing, and its concrete implementation in ExternalLoginService.cs
  • Improved User Login Management

    • In ApplicationUserManager.cs added logic to avoid adding to the used passwords list if no local password exists (applicable to external login scenario).
  • Added Interface for User Confirmation and External Login View

    • Introduced ExternalLoginConfirmationViewModel.cs, to manage external login confirmation involving user email and optional names.
    • Set up ExternalLoginController.cs to handle external login flows and added an external login confirmation view in ExternalLoginConfirmation.cshtml.
  • Deployed Configurations for External Logins

    • Created configuration classes (GitHubOptions.cs, GoogleOptions.cs, MicrosoftOptions.cs, and OAuthOptions.cs) for managing external authentication settings.
    • Included OAuthOptions in SiteSettings.cs to manage these settings.
  • Enhanced Login View

    • Updated Index.cshtml to display external authentication options and any related error messages.
  • Integrated External Authentication Services

    • In Program.cs, included configuration for authentication services and managed integration with Google, Microsoft, and GitHub authentication, along with failure handling for each.
    • Updated appsettings.Development.json to include configuration sections for Google, Microsoft, and GitHub, enabling these services under Authentication.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

این پول ریکوئست پشتیبانی از ورود با حساب‌های خارجی (گوگل، مایکروسافت و گیت‌هاب) را اضافه می‌کند و تغییرات لازم را در UI برای نمایش دکمه‌های ورود و ثبت‌نام با این سرویس‌ها اعمال می‌کند. ساختار کلی کد و منطق پیاده‌سازی شده برای مدیریت ورود خارجی مناسب است. با این حال، چند مورد نیاز به بررسی و اصلاح دارد. یک خطای سینتکسی در یکی از فایل‌های View وجود دارد که باید برطرف شود. همچنین، چندین پکیج به نسخه‌های قدیمی‌تر بازگردانده شده‌اند که می‌تواند ریسک‌هایی به همراه داشته باشد. چند پیشنهاد برای بهبود امنیت و قابلیت نگهداری کد نیز ارائه شده است.

Updated several NuGet package versions in `Directory.Packages.props`, including `Meziantou.Analyzer`, `Microsoft.EntityFrameworkCore`, and `MSTest.TestAdapter`.

Removed an unnecessary closing brace in `Index.cshtml`, which may impact the HTML rendering and functionality of the form.
Introduce constants for redirect URLs in Program.cs to replace raw error messages for Google, Microsoft, and GitHub authentication failures. This change improves security by preventing detailed error exposure to end users and enhances the user experience with more generic error messages.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant