I want to add a custom parameter to angular-auth-oidc-client authorize method like this. With the custom parameter in this case the client_id I want to write some custom logic.
export class LoginComponent implements OnInit {
constructor(private oidcSecurityService: OidcSecurityService) {
}
ngOnInit() {
this.oidcSecurityService.authorize({customParams: { 'client_id': 'F93C5C9E-57DC-4889-86DD-66A98EAD94CC' } });
}
}
In the backend I have setup identityserver4 in .net core 3.1 application. I have also implemented custom ProfileService
public class ProfileService : IProfileService
{
protected UserManager<ApplicationUser> _userManager;
public ProfileService(UserManager<ApplicationUser> userManager)
{
_userManager = userManager;
}
public async Task GetProfileDataAsync(ProfileDataRequestContext context)
{
//>Processing
var user = await _userManager.GetUserAsync(context.Subject);
var claims = new List<Claim>
{
new Claim("FullName", user.FullName),
};
context.IssuedClaims.AddRange(claims);
}
public async Task IsActiveAsync(IsActiveContext context)
{
//>Processing
var user = await _userManager.GetUserAsync(context.Subject);
context.IsActive = (user != null) && user.IsActive;
}
}
Also in startup.cs
services.AddIdentityServer()
.AddProfileService<ProfileService>();
How can I access the custom parameter that is sent from angular oidc client in my .net core application?
If any additional info is needed let me know.