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


Java HttpHeaders.AUTHORIZATION屬性代碼示例

本文整理匯總了Java中org.apache.http.HttpHeaders.AUTHORIZATION屬性的典型用法代碼示例。如果您正苦於以下問題:Java HttpHeaders.AUTHORIZATION屬性的具體用法?Java HttpHeaders.AUTHORIZATION怎麽用?Java HttpHeaders.AUTHORIZATION使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.apache.http.HttpHeaders的用法示例。


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

示例1: doSendRequest

@Override
protected HttpResponse doSendRequest(final HttpRequest request, final HttpClientConnection conn, final HttpContext context) throws IOException, HttpException {
    synchronized(listener) {
        listener.log(TranscriptListener.Type.request, request.getRequestLine().toString());
        for(Header header : request.getAllHeaders()) {
            switch(header.getName()) {
                case HttpHeaders.AUTHORIZATION:
                case "X-Auth-Key":
                case "X-Auth-Token":
                    listener.log(TranscriptListener.Type.request, String.format("%s: %s", header.getName(),
                            StringUtils.repeat("*", Integer.min(8, StringUtils.length(header.getValue())))));
                    break;
                default:
                    listener.log(TranscriptListener.Type.request, header.toString());
                    break;
            }
        }
    }
    return super.doSendRequest(request, conn, context);
}
 
開發者ID:iterate-ch,項目名稱:cyberduck,代碼行數:20,代碼來源:LoggingHttpRequestExecutor.java

示例2: facade

/**
 * @param cookieAuthValue クッキー內の p_cookieキーに指定された値
 * @param cookiePeer p_cookie_peerクエリに指定された値
 * @param authzHeaderValue Authorization ヘッダ
 * @param host Host ヘッダ
 * @param uriInfo UriInfo
 * @param xPersoniumUnitUser X-Personium-UnitUserヘッダ
 * @param httpServletRequest HttpServletRequest
 * @return CellResourceオブジェクトまたはResponseオブジェクト
 */
@Path("{path1}")
public final Object facade(
        @CookieParam(P_COOKIE_KEY) final String cookieAuthValue,
        @QueryParam(COOKIE_PEER_QUERY_KEY) final String cookiePeer,
        @HeaderParam(HttpHeaders.AUTHORIZATION) final String authzHeaderValue,
        @HeaderParam(HttpHeaders.HOST) final String host,
        @HeaderParam(PersoniumCoreUtils.HttpHeaders.X_PERSONIUM_UNIT_USER) final String xPersoniumUnitUser,
        @Context final UriInfo uriInfo,
        @Context HttpServletRequest httpServletRequest) {
    Cell cell = ModelFactory.cell(uriInfo);
    AccessContext ac = AccessContext.create(authzHeaderValue,
            uriInfo, cookiePeer, cookieAuthValue, cell, uriInfo.getBaseUri().toString(),
            host, xPersoniumUnitUser);
    if (cell == null) {
        throw PersoniumCoreException.Dav.CELL_NOT_FOUND;
    }

    CellLockManager.STATUS cellStatus = CellLockManager.getCellStatus(cell.getId());
    if (CellLockManager.STATUS.BULK_DELETION.equals(cellStatus)) {
        throw PersoniumCoreException.Dav.CELL_NOT_FOUND;
    }

    CellLockManager.incrementReferenceCount(cell.getId());
    httpServletRequest.setAttribute("cellId", cell.getId());
    return new CellResource(ac, httpServletRequest);
}
 
開發者ID:personium,項目名稱:personium-core,代碼行數:36,代碼來源:FacadeResource.java

示例3: ctl

/**
 * @param cookieAuthValue クッキー內の p_cookieキーに指定された値
 * @param cookiePeer p_cookie_peerクエリに指定された値
 * @param authzHeaderValue Authorization ヘッダ
 * @param host Host ヘッダ
 * @param xPersoniumUnitUser ヘッダ
 * @param uriInfo UriInfo
 * @return UnitCtlResourceオブジェクト
 */
@Path("__ctl")
public final UnitCtlResource ctl(
        @CookieParam(P_COOKIE_KEY) final String cookieAuthValue,
        @QueryParam(COOKIE_PEER_QUERY_KEY) final String cookiePeer,
        @HeaderParam(HttpHeaders.AUTHORIZATION) final String authzHeaderValue,
        @HeaderParam(HttpHeaders.HOST) final String host,
        @HeaderParam(PersoniumCoreUtils.HttpHeaders.X_PERSONIUM_UNIT_USER) final String xPersoniumUnitUser,
        @Context final UriInfo uriInfo) {
    AccessContext ac = AccessContext.create(authzHeaderValue,
            uriInfo, cookiePeer, cookieAuthValue, null, uriInfo.getBaseUri().toString(),
            host, xPersoniumUnitUser);
    return new UnitCtlResource(ac, uriInfo);
}
 
開發者ID:personium,項目名稱:personium-core,代碼行數:22,代碼來源:FacadeResource.java

示例4: status

/**
 * @param authzHeaderValue Authorization ヘッダ
 * @param host Host ヘッダ
 * @param xPersoniumUnitUser ヘッダ
 * @param uriInfo UriInfo
 * @return UnitCtlResourceオブジェクト
 */
@Path("__status")
public final StatusResource status(
        @HeaderParam(HttpHeaders.AUTHORIZATION) final String authzHeaderValue,
        @HeaderParam(HttpHeaders.HOST) final String host,
        @HeaderParam(PersoniumCoreUtils.HttpHeaders.X_PERSONIUM_UNIT_USER) final String xPersoniumUnitUser,
        @Context final UriInfo uriInfo) {
    return new StatusResource();
}
 
開發者ID:personium,項目名稱:personium-core,代碼行數:15,代碼來源:FacadeResource.java

示例5: getBasicAuthorizationHeader

private static Header getBasicAuthorizationHeader(String user, String password) {
	return new BasicHeader(HttpHeaders.AUTHORIZATION,
			AUTHORIZATION_BASIC + " " + OpenApisEndpoint.encodeBase64(user, password));
}
 
開發者ID:SAP,項目名稱:cloud-ariba-partner-flow-extension-ext,代碼行數:4,代碼來源:OpenApisEndpoint.java

示例6: SAPIClient

public SAPIClient(Map<String, String> op) throws MalformedURLException {
    this(op.get("api.status.link"), "", "");
    auth = new BasicHeader(HttpHeaders.AUTHORIZATION,
            op.get("api.status.auth").replaceAll(",$", ""));
}
 
開發者ID:CognizantQAHub,項目名稱:Cognizant-Intelligent-Test-Scripter,代碼行數:5,代碼來源:SAPIClient.java

示例7: getBasicAuthorizationHeader

private Header getBasicAuthorizationHeader(String user, String password) {
	return new BasicHeader(HttpHeaders.AUTHORIZATION,
			AUTHORIZATION_BASIC + " " + OpenApisEndpoint.encodeBase64(user, password));
}
 
開發者ID:SAP,項目名稱:cloud-ariba-discovery-rfx-to-external-marketplace-ext,代碼行數:4,代碼來源:OpenApisEndpoint.java


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