Ändern Sie die Standardausführung des Autorize -AttributsC#

Ein Treffpunkt für C#-Programmierer
Anonymous
 Ändern Sie die Standardausführung des Autorize -Attributs

Post by Anonymous »

Ich habe die Standard -Net -Core -Identität nicht verwendet und mein eigenes Account -Containtroller gemacht. Das Problem ist, dass die nicht autorisierten Benutzer, wenn ich "autorisieren" -attribut verwendet, auf "Identität /Seiten /Konto" umgeleitet werden.

Code: Select all

        services
.ConfigureApplicationCookie(options =>
{
options.LoginPath = "/Account/Login";
options.LogoutPath = "/Account/Logout";
options.AccessDeniedPath = "/AccessDenied";
});
< /code>

Aber bisher kein Erfolg < /p>

            services
.AddAuthentication()
.AddGoogle(options =>
{
IConfigurationSection googleAuthNSection =
this.configuration.GetSection("Authentication:Google");

options.ClientId = this.configuration["Authentication:Google:ClientId"];
options.ClientSecret = this.configuration["Authentication:Google:ClientSecret"];
});

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post