當前位置: 首頁>>代碼示例>>Java>>正文


Java BasicAuthExtractor類代碼示例

本文整理匯總了Java中org.pac4j.core.credentials.extractor.BasicAuthExtractor的典型用法代碼示例。如果您正苦於以下問題:Java BasicAuthExtractor類的具體用法?Java BasicAuthExtractor怎麽用?Java BasicAuthExtractor使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BasicAuthExtractor類屬於org.pac4j.core.credentials.extractor包,在下文中一共展示了BasicAuthExtractor類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: constructCredentialsFromRequest

import org.pac4j.core.credentials.extractor.BasicAuthExtractor; //導入依賴的package包/類
@Override
protected Credential constructCredentialsFromRequest(final RequestContext requestContext) {
    try {
        final HttpServletRequest request = WebUtils.getHttpServletRequest(requestContext);
        final HttpServletResponse response = WebUtils.getHttpServletResponse(requestContext);
        final BasicAuthExtractor extractor = new BasicAuthExtractor(this.getClass().getSimpleName());
        final WebContext webContext = WebUtils.getPac4jJ2EContext(request, response);
        final UsernamePasswordCredentials credentials = extractor.extract(webContext);
        if (credentials != null) {
            LOGGER.debug("Received basic authentication request from credentials [{}]", credentials);
            return new UsernamePasswordCredential(credentials.getUsername(), credentials.getPassword());
        }
    } catch (final Exception e) {
        LOGGER.warn(e.getMessage(), e);
    }
    return null;
}
 
開發者ID:mrluo735,項目名稱:cas-5.1.0,代碼行數:18,代碼來源:BasicAuthenticationAction.java

示例2: extractBasicAuthenticationCredential

import org.pac4j.core.credentials.extractor.BasicAuthExtractor; //導入依賴的package包/類
private Credential extractBasicAuthenticationCredential(final HttpServletRequest request,
                                                        final HttpServletResponse response) {
    try {
        final BasicAuthExtractor extractor = new BasicAuthExtractor(this.getClass().getSimpleName());
        final WebContext webContext = WebUtils.getPac4jJ2EContext(request, response);
        final UsernamePasswordCredentials credentials = extractor.extract(webContext);
        if (credentials != null) {
            LOGGER.debug("Received basic authentication ECP request from credentials [{}]", credentials);
            return new UsernamePasswordCredential(credentials.getUsername(), credentials.getPassword());
        }
    } catch (final Exception e) {
        LOGGER.warn(e.getMessage(), e);
    }
    return null;
}
 
開發者ID:mrluo735,項目名稱:cas-5.1.0,代碼行數:16,代碼來源:ECPProfileHandlerController.java

示例3: internalInit

import org.pac4j.core.credentials.extractor.BasicAuthExtractor; //導入依賴的package包/類
@Override
protected void internalInit(final WebContext context) {
    super.internalInit(context);
    CommonHelper.assertNotBlank("realmName", this.realmName);

    setRedirectActionBuilder(webContext ->  RedirectAction.redirect(computeFinalCallbackUrl(webContext)));
    setCredentialsExtractor(new BasicAuthExtractor(getName()));
}
 
開發者ID:yaochi,項目名稱:pac4j-plus,代碼行數:9,代碼來源:IndirectBasicAuthClient.java

示例4: internalInit

import org.pac4j.core.credentials.extractor.BasicAuthExtractor; //導入依賴的package包/類
@Override
protected void internalInit(final WebContext context) {
    CommonHelper.assertNotBlank("headerName", this.headerName);
    CommonHelper.assertNotNull("prefixHeader", this.prefixHeader);

    setCredentialsExtractor(new BasicAuthExtractor(this.headerName, this.prefixHeader, getName()));
    if (CommonHelper.isNotBlank(this.casServerPrefixUrl)) {
        setAuthenticator(new CasRestAuthenticator(this.casServerPrefixUrl));
    }
}
 
開發者ID:yaochi,項目名稱:pac4j-plus,代碼行數:11,代碼來源:CasRestBasicAuthClient.java

示例5: clientInit

import org.pac4j.core.credentials.extractor.BasicAuthExtractor; //導入依賴的package包/類
protected void clientInit(WebContext context) {
    this.defaultCredentialsExtractor(new BasicAuthExtractor(this.getName()));
}
 
開發者ID:e-gov,項目名稱:TARA-Server,代碼行數:4,代碼來源:DirectBasicAuthClient.java

示例6: internalInit

import org.pac4j.core.credentials.extractor.BasicAuthExtractor; //導入依賴的package包/類
@Override
protected void internalInit(final WebContext context) {
    setCredentialsExtractor(new BasicAuthExtractor(getName()));
}
 
開發者ID:yaochi,項目名稱:pac4j-plus,代碼行數:5,代碼來源:DirectBasicAuthClient.java


注:本文中的org.pac4j.core.credentials.extractor.BasicAuthExtractor類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。