Skip to content
This repository was archived by the owner on Dec 13, 2018. It is now read-only.

Authentication failures are not properly logged #1265

Closed
kevinchalet opened this issue Jun 15, 2017 · 3 comments
Closed

Authentication failures are not properly logged #1265

kevinchalet opened this issue Jun 15, 2017 · 3 comments
Assignees
Milestone

Comments

@kevinchalet
Copy link
Contributor

aspnet-contrib/AspNet.Security.OAuth.Extensions#73 (comment)

The fix is simple: AuthenticationHandler.AuthenticateAsync() should be updated to log the authentication failure when it's not null: https://github.com/aspnet/Security/blob/dev/src/Microsoft.AspNetCore.Authentication/AuthenticationHandler.cs#L133

Note: the issue exists in both 1.0/1.1 and 2.0 but it's more terrible in 2.0 because it also manifests when enabling automatic authentication (1.0/1.1 correctly log the failure in this case: https://github.com/aspnet/Security/blob/1.0.0/src/Microsoft.AspNetCore.Authentication/AuthenticationHandler.cs#L107)

/cc @HaoK

@kevinchalet
Copy link
Contributor Author

@Eilon can you please make sure it gets fixed for 2.0 by adding the appropriate milestone/label?
It makes debugging ultra painful.

@muratg
Copy link
Contributor

muratg commented Jul 4, 2017

Fixed with 66b9397

@muratg muratg closed this as completed Jul 4, 2017
@NinoFloris
Copy link

Ah thanks @PinpointTownes I was just scratching my head for an hour why I wouldn't get a valid ClaimsIdentity, all along our auth handler was returning failures... Great to see this fixed!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants