Effect CommunityEC
Effect Community2mo ago
10 replies
duailibe

Modeling Multiple OAuth Providers with a Shared Interface

I'm developing an OAuth client to try to get a feel on Effect.
I've defined an OAuthProvider tag which defines an interface that should be shared by provider implementations (has some functions like createAuthorizationURL, validateAuthorizationCode, etc.)
Now the thing I'm not entirely sure how to model is how to define multiple providers which:
1. should all implement the same OAuthProvider interface
2. they can all be "provided" separately so I can get the correct one dynamically in a /oauth/:provider/callback
Was this page helpful?