org.restlet.Response.getChallengeRequests()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(3.5k)|赞(0)|评价(0)|浏览(175)

本文整理了Java中org.restlet.Response.getChallengeRequests方法的一些代码示例,展示了Response.getChallengeRequests的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Response.getChallengeRequests方法的具体详情如下:
包路径:org.restlet.Response
类名称:Response
方法名:getChallengeRequests

Response.getChallengeRequests介绍

[英]Returns the list of authentication requests sent by an origin server to a client. If none is available, an empty list is returned.

Note that when used with HTTP connectors, this property maps to the "WWW-Authenticate" header.
[中]返回源服务器发送给客户端的身份验证请求列表。如果没有可用列表,则返回空列表。
请注意,当与HTTP连接器一起使用时,此属性映射到“WWW Authenticate”头。

代码示例

代码示例来源:origin: org.restlet.osgi/org.restlet

/**
 * Sets the list of authentication requests sent by an origin server to a
 * client. Note that when used with HTTP connectors, this property maps to
 * the "WWW-Authenticate" header. This method clears the current list and
 * adds all entries in the parameter list.
 * 
 * @param challengeRequests
 *            A list of authentication requests sent by an origin server to
 *            a client.
 */
public void setChallengeRequests(List<ChallengeRequest> challengeRequests) {
  synchronized (getChallengeRequests()) {
    if (challengeRequests != getChallengeRequests()) {
      getChallengeRequests().clear();
      if (challengeRequests != null) {
        getChallengeRequests().addAll(challengeRequests);
      }
    }
  }
}

代码示例来源:origin: org.restlet.osgi/org.restlet

/**
 * Returns the list of authentication requests sent by an origin server to a
 * client.
 * 
 * @return The list of authentication requests sent by an origin server to a
 *         client.
 */
@Override
public List<ChallengeRequest> getChallengeRequests() {
  return getWrappedResponse().getChallengeRequests();
}

代码示例来源:origin: org.restlet.osgi/org.restlet

/**
 * Returns the list of authentication requests sent by an origin server to a
 * client. If none is available, an empty list is returned.
 * 
 * @return The list of authentication requests.
 * @see Response#getChallengeRequests()
 */
public List<ChallengeRequest> getChallengeRequests() {
  return getResponse() == null ? null : getResponse()
      .getChallengeRequests();
}

代码示例来源:origin: org.restlet.osgi/org.restlet

/**
 * Challenges the client by adding a challenge request to the response and
 * by setting the status to {@link Status#CLIENT_ERROR_UNAUTHORIZED}.
 * 
 * @param response
 *            The response to update.
 * @param stale
 *            Indicates if the new challenge is due to a stale response.
 */
public void challenge(Response response, boolean stale) {
  boolean loggable = response.getRequest().isLoggable()
      && getLogger().isLoggable(Level.FINE);
  if (loggable) {
    getLogger().log(Level.FINE,
        "An authentication challenge was requested.");
  }
  response.setStatus(Status.CLIENT_ERROR_UNAUTHORIZED);
  response.getChallengeRequests().add(createChallengeRequest(stale));
}

代码示例来源:origin: com.github.ansell.restlet-utils/restlet-utils

response.getChallengeRequests().clear();

代码示例来源:origin: org.restlet.osgi/org.restlet

response.getChallengeRequests().clear();

代码示例来源:origin: org.restlet.osgi/org.restlet

List<ChallengeRequest> crs = org.restlet.engine.security.AuthenticatorUtils
      .parseRequest(response, header.getValue(), headers);
  response.getChallengeRequests().addAll(crs);
} else if (HEADER_PROXY_AUTHENTICATE.equalsIgnoreCase(header.getName())) {
  List<ChallengeRequest> crs = org.restlet.engine.security.AuthenticatorUtils

代码示例来源:origin: org.restlet.osgi/org.restlet

ChallengeRequest challengeRequest = null;
for (ChallengeRequest c : response.getChallengeRequests()) {
  if (challengeResponse.getScheme().equals(c.getScheme())) {
    challengeRequest = c;

代码示例来源:origin: org.restlet.osgi/org.restlet

if (response.getChallengeRequests() != null) {
  for (ChallengeRequest challengeRequest : response.getChallengeRequests()) {
    addHeader(HEADER_WWW_AUTHENTICATE,
        org.restlet.engine.security.AuthenticatorUtils

相关文章