Specify IDP on connection with express-openid-connect library

I’m looking to specify a connection with auth0/express-openid-connect. We currently don’t have a user login screen with options for finding out the domain so we specify 2 different login paths 1 for our customers and 1 for our maintainers.
Passport-auth0 allows for this like so:

app.get(
	'/login/google',
	passport.authenticate('auth0', {connection: 'google-oauth2'}), 
	function (req, res) {
		res.redirect('/');
	}
);

But as far as I can tell the new library doesn’t allow specifying a connection. Can you direct me to that functionality? Thanks!

Omar from Auth0 responded to me via email: It turns out I can just do it as part of the authorizationParameters.
From his example:


const config = {

authRequired: false,

auth0Logout: true,

authorizationParams: {

// Note: you need to provide required parameters if this object is set.

response_type: "id_token",

response_mode: "form_post",

scope: "openid profile email",

// Additional parameters

connection: "google-oauth2"

}

};
1 Like

Perfect! Thanks for sharing it with the rest of community!