It looks like this library requires a public key in order to validate that the JWT that FusionAuth returns from the token
endpoint is valid. I'm not a DotNet expert, but from some searching around, the OpenIdConnectOptions
object is where you configure everything for OIDC. There is a property called SecurityTokenValidator
that you can add keys to and that might be the best place to start.
Another solution would be to tell the ASP.net Core OIDC library to use the userinfo
API instead of the JWT stored in the id_token
. This will cause DotNet to call back to FusionAuth's userinfo
API and then FusionAuth will handle all of the validation for you and respond with the OIDC claims from the JWT. The property GetClaimsFromUserInfoEndpoint
on the OpenIdConnectOptions
object looks like it enables this. I couldn't figure out how to tell DotNet the URL of the userinfo
API though. Here's an example of that configuration:
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
app.UseStaticFiles();
app.UseIdentity();
app.UseOpenIdConnectAuthentication(new OpenIdConnectOptions
{
ClientId = Configuration["ClientId"],
ClientSecret = Configuration["ClientSecret"],
Authority = Configuration["Authority"],
ResponseType = OpenIdConnectResponseType.Code,
GetClaimsFromUserInfoEndpoint = true
});
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
});
}
I got that code from this blog post:
https://andrewlock.net/an-introduction-to-openid-connect-in-asp-net-core/
You might need to do some additional searching and reading up on the DotNet OIDC integration to get this all working. There isn't a lot of information out there, but a few people have written blogs on this topic that might help.