--- lang: ja-jp breaks: true --- # `Blazor` ID認証のログインURL(パス)を変更する 2024-09-05 > https://github.com/dotnet/aspnetcore/blob/main/src/Security/Authentication/Cookies/src/CookieAuthenticationOptions.cs ## Program.cs ```csharp= ・・・ builder.Services .AddAuthentication(options => { options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme; options.DefaultChallengeScheme = CookieAuthenticationDefaults.AuthenticationScheme; }) .AddCookie( CookieAuthenticationDefaults.AuthenticationScheme, option => { // ID認証のURL(パス)を変更 option.AccessDeniedPath = "/Account/AccessDenied"; option.LoginPath = "/Account/GoogleLogin"; option.LogoutPath = "/Account/Logout"; }) .AddCookie(IdentityConstants.ExternalScheme) .AddGoogle(options => { // https://console.developers.google.com/apis/credentials options.ClientId = "xxxxxxxx"; options.ClientSecret = "xxxxxxxx"; options.SignInScheme = IdentityConstants.ExternalScheme; options.SaveTokens = false; }); ・・・ ``` ###### tags: `Blazor` `Identity` `ID認証` `URL` `パス` `ログイン`
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up