How Noggin Auth works
Noggin Auth uses the OAuth 2.0 authorization code flow. Your site never sees the user's password. The provider checks who they are, then gives your site a one-time code that it swaps for the user's details. The diagram shows one login, using GitHub as the example provider.
When a login fails
If anything goes wrong after the user comes back, Noggin Auth calls your ILoginHandler.FailedLoginFrom instead, with an AuthenticationFailInformation that has a Reason and, usually, the Exception. This happens when:
- the
state is missing or doesn't match, for example the session expired or the login wasn't started in this browser
- the provider sent back an error instead of a code, for example the user cancelled
- a call to the provider's token or user API failed
- the provider didn't return a user ID
Configuration problems, like a provider with no API keys, aren't login failures. They throw a NogginNetCoreConfigException so you notice them straight away.
This sample site logs the reason and shows the user a friendly message.