Use Identity API v3 that obtained the following features:
Identity Federation
External authentication
Multi-factor authentication
Authorization mechanisms
Multiple domains support
The sections below include recommendations for authentication, Identity Federation, and Identity middleware.