标签: http-status-code-403

如何修复Tomcat HTTP状态403:拒绝访问所请求的资源?

我正在尝试使用我当前的源代码设置Tomcat.我从tomcat网站(6.0.32)下载了zip.

然后我在我的项目中输入配置文件 tomcatDir\conf\Catalina\localhost

然后我添加了用户 tomcat-users.xml

当我使用我的应用程序时localhost:8080/<context root>,我得到了我应该的登录提示.提供正确的凭据后,tomcat会抛出403错误.我能够访问经理localhost:8080/manager/

tomcat-users.xml:

<role rolename="manager"/>
<role rolename="admin"/>
<user username="admin" password="5c50nD" roles="admin,manager"/>
<user username="nih\kishorev" password="altum" roles="admin,manager"/>
Run Code Online (Sandbox Code Playgroud)

tomcat http-status-code-403

6
推荐指数
1
解决办法
6万
查看次数

Glimpse.axd 403ing在IIS上

在我发布到IIS(7.5)后尝试访问/Glimpse.axd时,我现在收到403 Forbidden响应.IIS中是否有禁用访问.axd文件的设置?或者这完全是另一回事?

httpforbiddenhandler iis-7.5 http-status-code-403 asp.net-mvc-3 glimpse

6
推荐指数
1
解决办法
1808
查看次数

使用TAmazonStorageService.UploadObject在Content-type为'text/*'时出现SignatureDoesNotMatch错误

使用以下Delphi XE2(更新4)代码:

var
  ConInfo: TAmazonConnectionInfo;
  RespInfo: TCloudResponseInfo;
  Service: TAmazonStorageService;
  Content: TBytes;
  Headers: TStringList;
begin
  ConInfo:=TAmazonConnectionInfo.Create(self);
  ConInfo.AccountName:='YOUR ACCOUNT NAME';
  ConInfo.AccountKey:='YOUR ACCOUNT KEY';
  ConInfo.Protocol:='http';

  Service:=TAmazonStorageService.Create(ConInfo);
  RespInfo:=TCloudResponseInfo.Create;

  SetLength(Content, 128);
  FillMemory(@Content[0], 128, Byte('x'));

  Headers:=TStringList.Create;
  Headers.Values['Content-type']:='text/plain';
  if not Service.UploadObject('YOUR BUCKET', 'test.txt', Content, TRUE, nil, Headers, amzbaPrivate, RespInfo) then
    ShowMessage('Failed:' + RespInfo.StatusMessage);
Run Code Online (Sandbox Code Playgroud)

我总是在调用UploadObject时遇到错误:

失败:HTTP/1.1 403禁止 - 我们计算的请求签名与您提供的签名不匹配.检查您的密钥和签名方法.(SignatureDoesNotMatch)

仅当Content-type设置为'text/plain','text/html'或文本内容时才会发生这种情况.使用完全相同的代码,如果您只是将内容类型更改为任何其他内容类型,例如"video/3gpp",那么它将按预期工作且没有错误.上传的对象的实际内容不相关,与获取错误无关.

我已经通过Delphi中的Indy代码进行了跟踪,但是我很难理解为什么文本内容类型总是会出现这个错误.

有任何想法吗?

delphi content-type indy amazon-s3 http-status-code-403

6
推荐指数
1
解决办法
778
查看次数

从Application_Error中抛出http异常(Unauthorized)

我试图从Global asax Application_Error中抛出此行

throw new HttpException((int)HttpStatusCode.Unauthorized, "Forbidden");
Run Code Online (Sandbox Code Playgroud)

但由于某种原因,我在浏览器中得到200而不是401,你知道为什么吗?

更新:

protected void Application_Error(object sender, EventArgs e)
{        
    throw new HttpException((int)HttpStatusCode.Unauthorized, "Forbidden");
}
Run Code Online (Sandbox Code Playgroud)

c# httpexception http-status-code-403 asp.net-mvc-3

6
推荐指数
1
解决办法
5660
查看次数

Azure网站 - 404 - 尚未公布

我已经研究了这个(现在开始和关闭)一个多月......坦率地说,我很茫然.我很感激有人在这里给我一些答案.我在网上搜索了答案 - 到目前为止还没有找到答案.

这是我的情况:

  • 我们有一个有效的MVC 4 Web应用程序 - 在本地和"内部部署"开发Web服务器上运行良好.
  • 该网站发布到Azure没有错误
  • 该网站的"主页"视图(根)显示403错误 - 禁止.
  • 找不到此网站上的任何视图 - 显示404错误.
  • 使用FileZilla查看已发布的文件 - 所有各种文件和视图都在那里.

这个网站与正在开发的类似网站之间的唯一区别是,我们已经将这个问题的子网站添加(或尝试添加)Log4Net和Elmah.

我们已经退出了Log4Net,但(现在)已经让Elmah到位了.这是我现在能想到的唯一可能导致问题的事情.然而,我看到使用Elmah的人的博客文章与Azure网站一样好.

有关Azure上此网站可能会发生什么的任何建议吗?

azure http-status-code-403 http-status-code-404 asp.net-mvc-4 web

6
推荐指数
0
解决办法
1078
查看次数

为什么我一直禁止使用PayPal 403?

我使用HTML Forms方法与PayPal集成,以接受我网站上的付款.当用户在结账时选择PayPal作为付款选项时,我会使用HTML Forms将其重定向到PayPal网站,如文档中所述.我确实收到付款到我的PayPal帐户,但是当我发送notify-validate命令时收到IPN消息给我的notify_url我收到错误:403禁止.请协助.一切都在沙箱中正常工作,但我开始得到这个错误403禁止.

html https paypal http-status-code-403 paypal-ipn

6
推荐指数
1
解决办法
6723
查看次数

Heroku 403 Forbidden for static js files

我已将我的简单php应用程序推送到Heroku并获得某些js文件的403状态.

https://guarded-forest-7267.herokuapp.com/vendor/jquery/dist/jquery.min.js Failed to load resource: the server responded with a status of 403 (Forbidden) https://guarded-forest-7267.herokuapp.com/vendor/jquery-form/jquery.form.js Failed to load resource: the server responded with a status of 403 (Forbidden) https://guarded-forest-7267.herokuapp.com/vendor/jquery-validate/dist/jquery.validate.min.js Failed to load resource: the server responded with a status of 403 (Forbidden) https://guarded-forest-7267.herokuapp.com/vendor/jquery.inputmask/dist/inputmask/jquery.inputmask.js Failed to load resource: the server responded with a status of 403 (Forbidden) https://guarded-forest-7267.herokuapp.com/vendor/modernizer/modernizr.js Failed to load resource: the server responded with a status of 403 (Forbidden) https://guarded-forest-7267.herokuapp.com/vendor/jselector/src/jquery.jselector.js Failed to load resource: the server responded with …

javascript heroku http-status-code-403

6
推荐指数
1
解决办法
1138
查看次数

Android Admob错误:无法加载广告:0 HTTP响应代码:403

我按照以下admob文档步骤整合了admob横幅广告.

我正在使用模拟器获得测试广告.并使用以下说明获取广告.

AdRequest.Builder.addTestDevice("F3F05FA129EF5A4FEEF9DCC4F3A96936") 
Run Code Online (Sandbox Code Playgroud)

如果我使用发布版本配置运行应用程序获取错误日志下面的错误

07-14 17:50:01.461 16693-16693/xx.xxxxx I/Ads: Starting ad request.
07-14 17:50:02.164 16693-16693/xx.xxxxx I/Ads: Use AdRequest.Builder.addTestDevice("F3F05FA129EF5A4FEEF9DCC4F3A96936") to get test ads on this device.
07-14 17:50:02.913 16693-16847/xx.xxxxx W/Ads: There was a problem getting an ad response. ErrorCode: 0
07-14 17:50:03.478 16693-16693/xx.xxxxx W/Ads: Failed to load ad: 0
Run Code Online (Sandbox Code Playgroud)

如果导出apk与发布配置低于错误.

07-14 18:00:19.125 23074-23074/xx.xxxxx I/Ads: Starting ad request.
07-14 18:00:19.126 23074-23074/xx.xxxxx I/Ads: Use AdRequest.Builder.addTestDevice("F3F05FA129EF5A4FEEF9DCC4F3A96936") to get test ads on this device.
07-14 18:00:19.656 29969-23211//xx.xxxxx W/Ads: Received error HTTP response code: 403
07-14 18:00:20.040 …
Run Code Online (Sandbox Code Playgroud)

android banner admob http-status-code-403

6
推荐指数
1
解决办法
4086
查看次数

Spring Security始终返回403 forbidden,Access denied

我想启用管理员访问管理员页面并执行管理员工作,但是当我尝试通过设置带有/ admin/**的URL只能由具有角色admin的用户访问时,它会返回403 Forbidden,拒绝访问.但是用户已将权限设置为ROLE_ADMIN我已检查过.我究竟做错了什么?

我的控制器用于用户登录

@RestController
public class UserController {

    @Autowired
    AuthenticationManager authenticationManager;

    @Autowired
    private UserDetailsService userDetailsService;

    @Autowired
    private AuthorityService authorityService;

    @Autowired
    private UserAuthorityService userAuthorityService;

    @Autowired
    TokenUtils tokenUtils;

    @Autowired
    private UserService userService;

    @RequestMapping(value = "/api/login", method = RequestMethod.POST, produces = "text/html")
    public ResponseEntity<String> login(@RequestBody LoginDTO loginDTO) {
        try {
//          System.out.println(loginDTO.getUsername() + " " + loginDTO.getPassword());
            UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(
                    loginDTO.getUsername(), loginDTO.getPassword());

            Authentication authentication = authenticationManager.authenticate(token);

            SecurityContextHolder.getContext().setAuthentication(authentication);

            UserDetails details = userDetailsService.loadUserByUsername(loginDTO.getUsername());

            return new ResponseEntity<String>(tokenUtils.generateToken(details), HttpStatus.OK);
        } catch (Exception ex) { …
Run Code Online (Sandbox Code Playgroud)

spring spring-security http-status-code-403

6
推荐指数
1
解决办法
2万
查看次数

Mqtt连接为aws IOT预签名URL提供403

我有aws lambda函数,它生成IOT websocket URL,如下所示.

const v4 = require('aws-signature-v4');
const crypto = require('crypto');

const WSSURL = v4.createPresignedURL(
        'GET',
        process.env.IOT_ENDPOINT_HOST.toLowerCase(),
        '/mqtt',
        'iotdevicegateway',
        crypto.createHash('sha256').update('', 'utf8').digest('hex'),
        {
            'key': process.env.IOT_ACCESS_KEY,
            'secret': process.env.IOT_SECRET_KEY,
            'protocol': 'wss',
            'region': process.env.IOT_AWS_REGION,
        }
    );
Run Code Online (Sandbox Code Playgroud)

我在客户端有mqttjs使用此URL并尝试连接web套接字如下.

var options = {
        will    : {
            topic  : LAST_WILL_TOPIC,
            payload: getMessageString(wss_userId, wss_email, wss_userType, {})
        },
        clientId: wss_userType + '||' + wss_userId
    };

    wssClient = mqtt.connect(WSSURL, options); 
Run Code Online (Sandbox Code Playgroud)

这个代码在几个月之前就完美了,但是现在连接没有启动并且出现以下错误

failed: Error during WebSocket handshake: Unexpected response code: 403
Run Code Online (Sandbox Code Playgroud)

websocket http-status-code-403 mqtt iot aws-iot

6
推荐指数
1
解决办法
563
查看次数