吊带自定义登录模块上查询

问题描述 投票:0回答:1

我创建了一个自定义的验证流程使用外部供应商进行身份验证。按我的理解,这里是执行流程。

  1. CustomAuthenticationHandler(延伸DefaultAuthenticationFeedbackHandler&实施AuthenticationHandlerAuthenticationFeedbackHandler):此提取的凭证,并调用使用JAAS配置适当的登录模块。
  2. CustomLoginModule(延伸AbstractLoginModule)。这就要求身份提供者,可选择指定其他组。
  3. CustomIdentityProvider(实施ExternalIdentityProvider):这是身份验证,请打电话到我的外部供应商的身份验证API发生。

认证工作正常,我的意思是

1> 2> 3运作良好,我能够调用API和验证用户。

我从API中获取用户信息(3),我将其传递给(2)通CustomUser(延伸ExtenalUser)。

我的问题是我无法通过由式(2)(1)用户信息。我需要的请求进一步处理该信息,以显示在UI。

我如何可以传递(2)(1)这些数据?

我至今尝试过?

我创建了一个AUTHINFO对象,并调用LoginModule的类的对象setInfoInfo。这是行不通的。无我国税发在AUTHINFO设定自订参数的可

public boolean authenticationSucceeded(HttpServletRequest request,
            HttpServletResponse response, AuthenticationInfo authInfo)

我有过写在CustomAuthenticationHandler类。我怎样才能在CustomAuthenticationHandler我的自订参数?

ldap aem cq5 jaas sling
1个回答
1
投票

我不认为你需要2和3。在extractCredentials方法,你可以调用API来验证和authenticationSucceeded方法来分配用户到组。

如果你想使用自订参数使用,那么你需要做的实现org.apache.sling.auth.core.spi.AuthenticationInfoPostProcessor在您的自定义后,认证的类此接口。

您可以在过程方法来获取AUTHINFO对象

@Component
@Service
public class CustomAuthPostProcess implements AuthenticationInfoPostProcessor {
 @Override
public void postProcess(final AuthenticationInfo authenticationInfo,
        final HttpServletRequest httpServletRequest,
        final HttpServletResponse httpServletResponse)
        throws LoginException {
 // Your logic
   }  
 }
© www.soinside.com 2019 - 2024. All rights reserved.