When to use passport-oauth2 vs provider-specific strategies
masterThe passport-oauth2 module provides generic OAuth 2.0 support.
- Use provider-specific strategies (e.g.,
passport-google-oauth2) when available. These strategies reduce configuration overhead and handle provider-specific quirks automatically. - Use
passport-oauth2when you need to implement authentication against an OAuth 2.0 provider that does not have a dedicated Passport strategy. - Sub-classing: If you are building a new provider-specific strategy, you are encouraged to sub-class this
OAuth2Strategy.