Open krifalk opened 2 years ago
@krifalk, I'm facing the same issue as well. Is it working for you?
@harikarthik Unfortunately not. I ended up with creating a helper class and calling it from the controller at login. Something like this.
public static class MergeClaims<TUser, TKey> where TUser : IdentityUser<TKey>, new() where TKey : IEquatable<TKey> { public static async Task Do(UserManager<TUser> userManager, TUser user, ExternalLoginInfo externalLoginInfo, List<string> groups) { // Merging the claims here }
Have since then moved on to using Azure B2C for authentication instead. IdentityServer became a dead end.
I have upgraded my IdentityServer and uses the latest version (2.1.0) of IdentityServer4.Admin. In the previous version I had implemented a custom Profile Service to merge claims from external provider, i.e. Azure AD.
The ProfileService works as expected, but _signInManager.GetExternalLoginInfoAsync() now is always null in ProfileService. In ExternalLoginCallback() in AccountController I have the expected ExternalLoginInfo from Azure AD, including the claims.
Is there something obvious I'm missing here, or why am I not able to user GetExternalLoginInfoAsync() outside the controller anymore?
The custom ProfileService is configured like this: