Authenticating users through a specific Connection (database, social, etc.)

Overview

This article explains how to authenticate users through a specific connection.

Applies To

  • Connections
  • Authentication
  • Authorize request
  • Query parameters

Solution

This can be accomplished by specifying a connection parameter (connection=connection-name) in the authorize request during the authentication flow. It is important to note that the parameter must be the name of the connection (i.e. google-oauth2, Username-Password-Authentication, etc.) as opposed to the identifier or connection_id. The configuration of this will depend on whether the /authorize request is crafted manually or by an Auth0 SDK.

Examples of an /authorize requests that include the connection parameter:

  • Login through Username-Password-Authentication (database) connection: https://{tenant-name}.{region}.auth0.com/authorize?client_id={client_id}&response_type=code**&connection=Username-Password-Authentication**&prompt=login&scope=openid%20profile%20phone
  • Login through google-oauth2 connection: https://{tenant-name}.{region}.auth0.com/authorize?client_id={client_id}&response_type=code**&connection=google-oauth2**&prompt=login&scope=openid%20profile