Skip to content

Commit

Permalink
fix: set valid audience
Browse files Browse the repository at this point in the history
closes #388
  • Loading branch information
github-actions committed Mar 25, 2021
1 parent 797aa6c commit 86191d7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Aguacongas.TheIdServer/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,8 @@ private void ConfigureIdentityServerAuthenticationOptions(JwtBearerOptions optio
ServerCertificateCustomValidationCallback = (message, cert, chain, policy) => true
#pragma warning restore S4830 // Server certificates should be verified during SSL/TLS connections
};
}

}
options.Audience = Configuration["ApiAuthentication:ApiName"];
options.Events = new JwtBearerEvents
{
OnMessageReceived = context =>
Expand All @@ -344,6 +344,7 @@ private void ConfigureIdentityServerAuthenticationOptions(JwtBearerOptions optio
.GetRequiredService<IRetrieveOneTimeToken>()
.GetOneTimeToken(oneTimeToken);
}
context.Token = TokenRetrieval.FromAuthorizationHeader()(request);
return Task.CompletedTask;
}
};
Expand Down

1 comment on commit 86191d7

@ben-jacobs
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for coming back so quickly. PS Great project - setting up IdSrv can be a bit of an hassle and you've made it so much easier.

Presumably line 346 needs: return Task.CompletedTask; otherwise context.Token just gets overridden if it is actually using a OTK.

I've added that line in for now and it all appears to be working following the change.

Now all the project needs is a RavenDB backing store and a SAML/Okta provider and it'll be perfect ;)

Please sign in to comment.