In asp.net core Startup.cs Configure we are provided an IHostingEnvironment env parameter that exposes an env.IsDevelopment() call to determine if you are currently running in a visual studio f5 debug session or a cloud deployment scenario. In function app is there a story for determining this same thing so you can write code that only runs during f5 debug session, e.g. a populated (. . ., ClaimsPrincipal principal) dependency injected parameter where this is only normally assigned claims and roles when deployed into cloud EasyAuth enabled environment.
相关问题
- java client program to send digest authentication
- PHP persistent login - Do i reissue a cookie after
- How to handle “App is temporarily blocked from log
- passport.authenticate() using a Promise instead of
- Auth::login($user) in laravel not able to login th
相关文章
- User.Identity.IsAuthenticated vs WebSecurity.IsAut
- SwiftUI - Vertical Centering Content inside Scroll
- Override UserManager in django
- Your application has authenticated using end user
- Access Token for Dockerhub
- Django: Creating a superuser with a custom User mo
- Azure Function App - Publish failed
- Didn't find publicKey for kid ,Keycloak?
IHostingEnvironment.IsDevelopment()
actually checks whether the ASPNETCORE_ENVIRONMENT environment variable is set to "Development". If that's what you want to do then you can useEnvironment.GetEnvironmentVariable()
to check the value. However, to determine specifically if you're in an F5 debug session you should checkDebugger.IsAttached
instead.