【问题标题】:Auth0 express-openid-connect specify IDP with connectionAuth0 express-openid-connect 指定 IDP 与连接
【发布时间】:2021-10-24 03:20:05
【问题描述】:

我希望使用 auth0/express-openid-connect 指定连接。我们目前没有用于查找域的选项的用户登录屏幕,因此我们指定了 2 种不同的登录路径,1 用于我们的客户,1 用于我们的维护人员。 Passport-auth0 允许这样做:

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

但据我所知,新的 Auth0 库 (express-openid-connect) 不允许指定连接。有谁知道这是怎么做到的?

【问题讨论】:

    标签: openid-connect auth0 idp


    【解决方案1】:

    Auth0 的一位支持工程师回答了我的问题。事实证明你可以把它放在授权参数中。他们回答的代码:

    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"
    
    }
    
    };
    

    感谢 Auth0 团队如此积极响应,即使这是一个新手类型的问题!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-12-05
      • 1970-01-01
      • 2022-10-25
      • 1970-01-01
      • 2015-12-16
      • 2018-05-15
      • 2021-10-23
      • 2022-10-30
      相关资源
      最近更新 更多