Ends in:
7 DAYS
10 HRS
16 MIN
29 SEC
Ends in:
7 D
10 H
16 M
29 S

Activities of "devsumati"

hi

  1. Yes.

  2. Do you mean that after clicking Logout on the web website, you are redirected to the public website?

My workflow is something like this

  1. When user tries to login in web project/ admin website.
  2. If that user have role as public.
  3. That user should be redirected to public website without login.
  4. with this code user is redirected to public with logged in. But that user cannot logout (don't know the reason). "
app.Use(async (httpContext, next) =>
{
    var currentUser = httpContext.RequestServices.GetRequiredService();
    if (currentUser.IsInRole("PublicUser"))
    {
        //redirect ...
        return;
    }
    await next();
});

"

error user get when click logout after redirect

"error:invalid_request
error_description:The client application is not allowed to use the specified identity token hint.
error_uri:https://documentation.openiddict.com/errors/ID2141"

hi

  1. Yes.

  2. Do you mean that after clicking Logout on the web website, you are redirected to the public website?

My workflow is something like this

  1. When user tries to login in web project/ admin website.
  2. If that user have role as public.
  3. That user should be redirected to public website without login.
  4. with this code user is redirected to public with logged in. But that user cannot logout (don't know the reason).

After reviewing your changes i have few questions-

  1. you have added changes in public project i want to do these changes in web project will same change work.
  2. after logout i want to redirect to public website. How can i do that for example in this code i am redirecting to "https://localhost:44359/"
 app.UseAuthentication();
  app.Use(async (httpContext, next) =>
  {
      var currentUser = httpContext.RequestServices.GetRequiredService();
      if (currentUser.IsInRole("user") && currentUser.Roles.Length == 1)
      {
          // publicURL = 
          httpContext.Response.Redirect("https://localhost:44359/");
          return;
      }
      await next();
  });

thanks please let me know when its done

sorry but i cant share my project but you can add code on any ABP tiered application (MVC) or you can use https://github.com/adityanbajpai/AbpPayment to test

can you please provide a sample code on how to do it in abp application

d

did't get it can you please explain it with sample code currently i am doing this

  app.UseAuthentication();
  app.Use(async (httpContext, next) =>
  {
      var currentUser = httpContext.RequestServices.GetRequiredService<ICurrentUser>();
      if (currentUser.IsInRole("user") && currentUser.Roles.Length == 1)
      {
          // publicURL = 
          httpContext.Response.Redirect("https://localhost:44359/");
          return;
      }
      await next();
  });

Hi,

if If the current request is to logout, then do not redirect

is there any other way to check user is public so instead of direct redirect ican logout that user first then redirect

hi

Can you create a new question for this suite problem? We will refund your suite question ticket.

Thanks

ok

Hi,

could you share your middleware code?

Nothing is changed all code is default generated code by template. And on top of that issue is with abpsuite also. If it is solved for abpsuite i believe it will be fixed in my application also.

Showing 1 to 10 of 41 entries
Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06