اشتراکها
کتاب Docker مختصر و مفید
Containers have revolutionized software development, allowing developers to bundle their applications with everything they need, from the operating system up, into a single package. Docker is one of the most popular platforms for containers, allowing them to be hosted on-premises or on the cloud, and to run on Linux, Windows, and Mac machines. With Docker Succinctly by Elton Stoneman, learn the basics of building Docker images, sharing them on the Docker Hub, orchestrating containers to deliver large applications, and much more.
اشتراکها
منابع مطالعاتی Docker
طبق فرمایش شما از کد زیر استفاده کردم اما claims به نام emailaddress یافت نمیشود.
و در Container :
نحوه استفاده :
public async Task<ClaimsIdentity> GenerateUserIdentityAsync(User applicationUser) { // Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType var userIdentity = await CreateIdentityAsync(applicationUser, DefaultAuthenticationTypes.ApplicationCookie); // Add custom user claims here userIdentity.AddClaim(new Claim("emailaddress", applicationUser.Email)); return userIdentity; }
و زمانی که کاربر وارد سایت میشود GenerateUserIdentityAsync را فراخوانی میکنم.
public virtual async Task<ActionResult> Login(LoginViewModel viewModel, string returnUrl) { // ... more code var user = await this._userManager.FindByNameAsync(viewModel.UserName); await this._userManager.GenerateUserIdentityAsync(user); return this.View(viewModel); }
_.For<IPrincipal>().Use(() => HttpContext.Current.User);
var useremail = this._principal.GetClaimValue("emailaddress");
public async Task<IActionResult> Index() { var httpClient = await _imageGalleryHttpClient.GetHttpClientAsync(); var response = await httpClient.GetAsync("api/images"); if (response.StatusCode == System.Net.HttpStatusCode.Unauthorized || response.StatusCode == System.Net.HttpStatusCode.Unauthorized) { return RedirectToAction("AccessDenied", "Authorization"); } response.EnsureSuccessStatusCode();
- پس از دریافت response از سمت Web API، به StatusCode علت برابر بودن دو طرف شرط مقایسه چیست؟ آیا منظور مقدار دیگر بوده؟
- امکان اجرای برنامه در IIS Express وجود دارد؟