hi
Can you check the Access Token and claims from Google?
Please set a breakpoint to check the accesstoken and claims .
context.Services.AddAuthentication()
.AddGoogle(GoogleDefaults.AuthenticationScheme, options =>
{
options.Events.OnCreatingTicket = ticketContext =>
{
var accesstoken = ticketContext.AccessToken;
var claims = ticketContext.Principal?.Claims.ToList();
return Task.CompletedTask;
};
// options.ClaimActions.MapJsonKey(AbpClaimTypes.Email, "your_google_email_claim_key");
// options.ClaimActions.MapJsonKey(AbpClaimTypes.UserName, :"your_google_username_claim_key");
// options.ClaimActions.MapJsonKey(AbpClaimTypes.Name, "your_google_username_claim_key");
})
Thanks.
Hi
You are right. I will check this behavior.
Thanks.
hi
We noticed that when you click on the expanded sidebar in the main app, it doesn't immediately close. Instead, you have to move the cursor away from the expanded sidebar for the closing to happen.
Can you share a GIF?
Thanks.
Yes. We will fix it in 9.3.5 Thanks.
ok, I see, we will fix it in next patch version.
Thanks.
hi
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using OpenIddict.Abstractions;
using OpenIddict.Server.AspNetCore;
using Volo.Abp.DependencyInjection;
using Volo.Abp.OpenIddict.Controllers;
namespace BankIdDemo.BankId;
[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(AuthorizeController))]
public class MyAuthorizeController : AuthorizeController
{
public override async Task<IActionResult> HandleAsync()
{
var request = await GetOpenIddictServerRequestAsync(HttpContext);
var result = await HttpContext.AuthenticateAsync(IdentityConstants.ApplicationScheme);
if (result is not { Succeeded: true } ||
((request.HasPromptValue(OpenIddictConstants.PromptValues.Login) || request.MaxAge is 0 ||
(request.MaxAge != null && result.Properties?.IssuedUtc != null &&
TimeProvider.System.GetUtcNow() - result.Properties.IssuedUtc > TimeSpan.FromSeconds(request.MaxAge.Value))) &&
TempData["IgnoreAuthenticationChallenge"] is null or false)
|| (request.HasPromptValue(OpenIddictConstants.PromptValues.Login) && request.GetParameter("bankid").HasValue) && !request.GetParameter("skipBankId").HasValue)
{
// If the client application requested promptless authentication,
// return an error indicating that the user is not logged in.
if (request.HasPromptValue(OpenIddictConstants.PromptValues.None))
{
return Forbid(
authenticationSchemes: OpenIddictServerAspNetCoreDefaults.AuthenticationScheme,
properties: new AuthenticationProperties(new Dictionary<string, string>
{
[OpenIddictServerAspNetCoreConstants.Properties.Error] = OpenIddictConstants.Errors.LoginRequired,
[OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] = "The user is not logged in."
}!));
}
TempData["IgnoreAuthenticationChallenge"] = true;
var parameters = Request.HasFormContentType ? Request.Form.ToDictionary() : Request.Query.ToDictionary();
if (request.HasPromptValue(OpenIddictConstants.PromptValues.Login) &&
request.GetParameter("bankid").HasValue)
{
parameters.Add("skipBankId", "true");
}
return Challenge(new AuthenticationProperties
{
RedirectUri = Request.PathBase + Request.Path + QueryString.Create(parameters)
});
}
return await base.HandleAsync();
}
}
hi
I will check it again.
Thanks.
hi
You can merge the API into the AuthServer project, then update the project URLs.
Thanks.