Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IAuthenticationCallbackProvider method names #151

Open
PureKrome opened this issue Sep 1, 2014 · 0 comments
Open

IAuthenticationCallbackProvider method names #151

PureKrome opened this issue Sep 1, 2014 · 0 comments

Comments

@PureKrome
Copy link
Member

A website needs to implement this interface IAuthenticationCallbackProvider. This allows the developer to handle the callback from the Provider (eg. Google).

eg. Once the user auth's against Google, we come back to our website .. and then what?
i) do we create a new user?
ii) update the details on an existing user?
iii) do we need to ask for more credentials?
iv) did the user reject the permissions request (ie. no Google, don't give out my email).

Ok - so the developer now needs to handle this. Fine.
So i've exposed to interfaces which I believe handle most scenarios.

a) Process
b) OnRedirectToAuthenticationProviderError

Now, with the process .. i'm assuming that MOST of the time the code will be grabbing the user info from the provider and then storing that in the db. Because of this database-assumption I'm wondering

  1. if the method Process should be renamed to ProcessAsync and it returns a Task<dynamic>? Assumption here is a db requirement is async. The con to this is that I'm now making assumptions of the developers and it's very possible that they will NOT do any db/I-O bound stuff.
  2. For the method OnRedirectToAuthenticationProviderError this is gerenally just a redirect to their own error page. But there is no reason why this method also can't do something I-O bound, like send a logging error to LogEntries or RayGun, etc.

If I leave them as not async, then how would a person do something async in one of those methods if they needed to storea user record asyncly, for example?

@PureKrome PureKrome added this to the 2.0 - .NET 4.5 & Async/Await milestone Sep 1, 2014
PureKrome added a commit to PureKrome/SimpleAuthentication that referenced this issue Oct 10, 2014
- Referencing the NancyFX MyGet library for the latest -pre which includes updates to the INancyModule interface.
- Added a NuGet.config file to reference the MyGet api.
- Removed the ICache (fixes SimpleAuthentication#145).
- Removed the HttpClient code. Now uses the WorldDomination.HttpClient.Helpers package instead.
- Provider key is not required to be sent to the Provider. The session now stores this.
- IAuthenticationProviderCallback returns dynamic (closes SimpleAuthentication#155).
- IAuthenticationProviderCallback methods are not async (closes SimpleAuthentication#151).
@PureKrome PureKrome removed this from the 2.0 - .NET 4.5 & Async/Await milestone Oct 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant