添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
  • item.name
    点赞
  • item.name
    收藏
  • item.name
    9
  • 分享
  • item.name
    举报

访问云空间,报403 Forbidden。

发表于 2020-10-16 09:52 807 查看

com.huawei.cloud.base.http.HttpResponseException: 403 Forbidden

{"error":{"code":403,"errorDetail":[{"domain":"global","reason":"authError","description":"Access Forbidden","errorPos":"header","errorParam":"Authorization","errorCode":"21120403"}],"description":"Access Forbidden"}}

at com.huawei.cloud.base.services.AbstractClientRequest.newExceptionOnError(AbstractClientRequest.java:466)

at com.huawei.cloud.base.services.AbstractClientRequest.access$000(AbstractClientRequest.java:54)

at com.huawei.cloud.base.services.AbstractClientRequest$1.interceptResponse(AbstractClientRequest.java:300)

at com.huawei.cloud.base.http.HttpRequest.interceptResponse(HttpRequest.java:813)

at com.huawei.cloud.base.http.HttpRequest.execute(HttpRequest.java:745)

at com.huawei.cloud.base.services.AbstractClientRequest.executeUnparsed(AbstractClientRequest.java:314)

at com.huawei.cloud.base.services.AbstractClientRequest.execute(AbstractClientRequest.java:475)


以前是没问题。没有修改代码,


偶尔会报以下问题:

java.io.IOException: unexpected end of stream on Connection{drive.cloud.hicloud.com:443, proxy=DIRECT hostAddress=drive.cloud.hicloud.com/121.37.220.62:443 cipherSuite=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 protocol=http/1.1}

at Drv.Drv.Drvc.a.a(Http1Codec.java:213)

at Drv.Drv.Drvb.b.a(CallServerInterceptor.java:94)

at Drv.Drv.Drvb.g.a(RealInterceptorChain.java:152)

at Drv.Drv.Drva.b.a(ConnectInterceptor.java:52)

at Drv.Drv.Drvb.g.a(RealInterceptorChain.java:152)

at Drv.Drv.Drvb.g.a(RealInterceptorChain.java:126)

at Drv.Drv.Drv.a.a(CacheInterceptor.java:99)

at Drv.Drv.Drvb.g.a(RealInterceptorChain.java:152)

at Drv.Drv.Drvb.g.a(RealInterceptorChain.java:126)

at Drv.Drv.Drvb.a.a(BridgeInterceptor.java:98)

at Drv.Drv.Drvb.g.a(RealInterceptorChain.java:152)

at Drv.Drv.Drvb.j.a(RetryAndFollowUpInterceptor.java:136)

at Drv.Drv.Drvb.g.a(RealInterceptorChain.java:152)

at Drv.Drv.Drvb.g.a(RealInterceptorChain.java:126)

at Drv.aa.g(RealCall.java:238)

at Drv.aa.b(RealCall.java:82)

at com.huawei.cloud.client.okhttp.OkHttpRequest.execute(OkHttpRequest.java:122)

at com.huawei.cloud.base.http.HttpRequest.executeCurrentRequest(HttpRequest.java:749)

at com.huawei.cloud.base.http.HttpRequest.execute(HttpRequest.java:725)

at com.huawei.cloud.base.services.AbstractClientRequest.executeUnparsed(AbstractClientRequest.java:314)

at com.huawei.cloud.base.services.AbstractClientRequest.execute(AbstractClientRequest.java:475)


您好,相关问题这边帮您核实一下。

1楼 回复于 2020-10-16 10:01

错误码看起来像是Drive Scope设置的问题

2楼 回复于 2020-10-19 02:43
  • Elon GT :

    /**

    * Initialize and return the HuaweiIdSignInOptions object

    */

    @NotNull

    private HuaweiIdAuthParams initData() {

    List<Scope> scopeList = new LinkedList<>();

    scopeList.add(HuaweiIdAuthAPIManager.HUAWEIID_BASE_SCOPE);

    scopeList.add(new Scope(DriveScopes.SCOPE_DRIVE));

    scopeList.add(new Scope(DriveScopes.SCOPE_DRIVE_FILE));

    scopeList.add(new Scope(DriveScopes.SCOPE_DRIVE_METADATA));

    scopeList.add(new Scope(DriveScopes.SCOPE_DRIVE_METADATA_READONLY));

    scopeList.add(new Scope(DriveScopes.SCOPE_DRIVE_READONLY));

    scopeList.add(new Scope(DriveScopes.SCOPE_DRIVE_APPDATA));

    return new HuaweiIdAuthParamsHelper(HuaweiIdAuthParams.DEFAULT_AUTH_REQUEST_PARAM).setAccessToken().setIdToken().setScopeList(scopeList).createParams();

    }

    /**

    * Huawei Api Client authorized login method

    *

    * @param activity Call the Activity page handle of the singIn interface

    */

    public void singIn(Activity activity, int requestId) {

    if (authParams == null) {

    authParams = initData();

    }

    service = HuaweiIdAuthManager.getService(activity, authParams);

    activity.startActivityForResult(service.getSignInIntent(), requestId);

    }

    全部申请也是这样。之前本着够用的原则,只申请了:

    HuaweiIdAuthAPIManager.HUAWEIID_BASE_SCOPE;

    DriveScopes.SCOPE_DRIVE_FILE;

    DriveScopes.SCOPE_DRIVE_METADATA_READONLY;



    2020-10-19 04:11
  • PatrickG 回复 Elon GT :

    分析结果是可能在端侧或者网关处受阻,没有发到服务器上,方便提供一下这个应用的APP ID吗?是一串纯数字,可以在APPGalleryConnect网站的项目页面查看到

    另外请问下这个报错的Log信息是手机端侧采集到的吗还是云侧服务器上采集到的?


    2020-10-20 03:21
  • Elon GT 回复 PatrickG :

    是在端侧。

    AppID: 102271369


    2020-10-21 09:40
  • 展开共7条回复
显示 10
  • 1
  •