Hallo zusammen
Jetzt habe ich - auch wegen der Azure AD Auth - angefangen von ASP.NET MVC auf ASP.NET Core 5.0 zu migrieren.
Denn unter ASP.NET MVC konnte ich keine Authentifizierung ohne impliziten Flow, hinkriegen.
Wie ich festellen musste, nutzt Microsoft in seinem eigenen Template auch den implicit Flow.
Was soll mir das jetzt genau sagen?
Abt hier aus dem Forum meinte, das sei unsicher. Wieso macht MS das und es nicht gleich richtig?
Grüsse Peter
--
Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland 2007 - 2011
Siehe what-are-the-security-risks-of-implicit-flow
Code Flow Beispiel: Implement OAUTH Device Code Flow with Azure AD and ASP.NET Core
Siehe auch Recommendation und Samples in den MS Docs Microsoft Identity Platform und der OAuth 2.0-Autorisierungscodeflow - Microsoft identity platform
- performance is a feature -
Microsoft MVP - @Website - @AzureStuttgart - github.com/BenjaminAbt - Sustainable Code
Hi Abt
Danke, ich schaue mir das an. Frage mich nur, wieso das MS nicht standarmässig ins Template einbaut.
Gruss Peter
--
Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland 2007 - 2011
Laut Dokumentation verwendet das ASP.NET 5 Template AddMicrosoftIdentityWebApp() und damit das Code Flow Setup. Gerade getestet, das ist auch so:
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme)
.AddMicrosoftIdentityWebApp(Configuration.GetSection("AzureAd"));
services.AddAuthorization(options =>
{
// By default, all incoming requests will be authorized according to the default policy
options.FallbackPolicy = options.DefaultPolicy;
});
services.AddRazorPages()
.AddMvcOptions(options => { })
.AddMicrosoftIdentityUI();
}
Dass alte Templates das vielleicht noch nicht tun; nagut, nachvollziehbar.
- performance is a feature -
Microsoft MVP - @Website - @AzureStuttgart - github.com/BenjaminAbt - Sustainable Code
Hehe Abt, das steht bei mir genau so drin im Code. Neustes Template. Denke du hast das nicht ohne Token getestet, oder wie lief dein Test?
Nimm mal bei Azure die ID Token raus, die es für implizit benötitgt, dann kommt ne Meldung...
Grüsse Peter
--
Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland 2007 - 2011
Offensichtlich benötigen ALLE flows TokenID. So ein Witz, ich war total auf dem falschen Pferd. Dann ist ja alles gut?!
--
Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland 2007 - 2011
Klar brauchen den alle, da dies zu OpenID gehört: also der Authentifizierung.
Der Access Token kommt dann von OAuth2 und gehört zur Authorisierung.
- performance is a feature -
Microsoft MVP - @Website - @AzureStuttgart - github.com/BenjaminAbt - Sustainable Code
Hi Abt
Ja, dann ist ja alles gut und die Standard Implementation ist OK. War ein Missverständnis meinerseits.
Danke für deine Hilfe!
Grüsse Peter
--
Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland 2007 - 2011