Closed Krzysztof-Cieslak closed 5 years ago
Some thoughts:
use_oauth
name, but maybe it should be called use_oauth_with_config
to reflect the pattern of the other, third-party implementations. (Or useOAuthWithConfig
, of course).ev.OnCreatingTicket
implementation. That seems like it would be useful to factor out into a helper method, so that anyone using the "basic" useOAuthWithConfig
wouldn't have to reimplement the wheel.useOAuth
operation that doesn't require passing a custom config. It would take as parameters not just the clientId/clientSecret/jsonToClaimsMap parameters that the other OAuth implementations take, but also a set of three URLs that define the authorization endpoint, token endpoint, and user information endpoint. Maybe passed in as a record type called OAuthEndpointUrls
or something, since all three of them are related and form a natural grouping.useOAuth
should stay in Core, because it's a very commonly-desired feature. Its documentation can then point to the Saturn.Extensions.Authentication package for specific implementations for Google, GitHub, and whatever else gets added. Without an operation like useOAuth
in Core, I feel like the other OAuth implementations will be far less likely to be discovered.
So,
use_custom_oauth
is left in the core Saturn library, and specific implementations (Google, GitHub) has been moved toSaturn.Extensions.Authentication
.use_custom_oauth
? maybe something likeuse_oauth
would be better?