Open Closed

Identity Server Consent Page Error #36



5 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi rajasekhard2015
    Can you share the full steps to reproduce your problem?

  • User Avatar
    0
    rajasekhard2015 created

    Hi maliming,

    Thanks for reply. Below are the steps i have done for Identity Server Client creation.Please check and help to solve my problem.

    1.PNG
    2.PNG
    3.PNG
    4.PNG
    5.PNG
    6.PNG

    Service Provider Test Application
    7.PNG
    8.PNG
    9.PNG

    Clicking on Yes,Allow button in consent page getting error as ahown in below image
    10.PNG

    In Service Provider application,Configured the Idendity Provider Client details like as below.

    services.AddAuthentication(options =>
                {
                    options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
                    options.DefaultChallengeScheme = "oidc";
                })
                    .AddCookie(options =>
                    {
                        options.ExpireTimeSpan = TimeSpan.FromMinutes(60);
                        options.Cookie.Name = "mvcimplicit";
                    })
                   .AddOpenIdConnect("oidc", options =>
                   {
                       options.Authority = Constants.Authority;
                       options.RequireHttpsMetadata = false;
    
                       options.ClientId = "mvcimplicit";
    
                       options.Scope.Clear();
                       options.Scope.Add("openid");
                       options.Scope.Add("profile");
                       options.Scope.Add("email");                 
    
                       options.SaveTokens = true;
    
                       options.TokenValidationParameters = new TokenValidationParameters
                       {
                           NameClaimType = JwtClaimTypes.Name,
                           RoleClaimType = JwtClaimTypes.Role,
                       };
                   });
    
  • User Avatar
    1
    maliming created
    Support Team Fullstack Developer

    hi

    We will fix this problem, you can use the code below to solve it temporarily.

    [ExposeServices(typeof(ConsentModel))]
    public class MyConsentModel : ConsentModel
    {
    	private readonly IIdentityServerInteractionService _interaction;
    
    	public MyConsentModel(
    		IIdentityServerInteractionService interaction, 
    		IClientStore clientStore,
    		IResourceStore resourceStore) 
    		: base(interaction, clientStore, resourceStore)
    	{
    		_interaction = interaction;
    	}
    
    	protected override async Task ProcessConsentAsync()
    	{
    		var result = new ConsentModel.ProcessConsentResult();
    
    		ConsentResponse grantedConsent;
    
    		if (ConsentInput.UserDecision == "no")
    		{
    			grantedConsent = ConsentResponse.Denied;
    		}
    		else
    		{
    			if (ConsentInput.IdentityScopes.Any() || ConsentInput.ApiScopes.Any())
    			{
    				var identityScopes = ConsentInput.IdentityScopes ?? new List();
    				var apiScopes = ConsentInput.ApiScopes ?? new List();
    
    				grantedConsent = new ConsentResponse
    				{
    					RememberConsent = ConsentInput.RememberConsent,
    					ScopesConsented = identityScopes.Union(apiScopes).Where(s => s.Checked).Select(s => s.Name).ToList()
    				};
    			}
    			else
    			{
    				throw new UserFriendlyException("You must pick at least one permission"); //TODO: How to handle this
    			}
    		}
    
    		if (grantedConsent != null)
    		{
    			var request = await _interaction.GetAuthorizationContextAsync(ReturnUrl);
    			if (request == null)
    			{
    				return result;
    			}
    
    			await _interaction.GrantConsentAsync(request, grantedConsent);
    
    			result.RedirectUri = ReturnUrl; //TODO: ReturnUrlHash?
    		}
    
    		return result;
    	}
    }
    
    
  • User Avatar
    0
    rajasekhard2015 created

    Thanks for your solution its working for now.

    Please reply us when the issue is fixed.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    It is expected to be resolved in version 2.2. Please stay tuned.

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.3.0-preview. Updated on April 11, 2025, 10:10