简体   繁体   中英

Getting 401 error on my hyperledger REST server

I am currently running as an admin on my REST server, but it seems like I am unauthorized to add, delete, or query information (I cannot use any of the functionalities). I updated permissions in the acl file in composer playground, but that hasn't seem to have done anything. I have attached a picture of the rest server and of my terminal screen, and have posted the code for the permissions file here:

我的终端浏览器

使用POST函数在ReST服务器内部

/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Access control rules for tutorial-network
 */
rule NetworkAdminUser {
    description: "Grant business network administrators full access to user resources"
    participant: "org.hyperledger.composer.system.NetworkAdmin"
    operation: ALL
    resource: "**"
    action: ALLOW
}

rule NetworkAdminSystem {
    description: "Grant business network administrators full access to system resources"
    participant: "org.hyperledger.composer.system.NetworkAdmin"
    operation: ALL
    resource: "org.hyperledger.composer.system.**"
    action: ALLOW
}

This is not an ACL error.

The Explorer GUI in the Browser is locked out because of the API Key you are using -y iplockchain . You can test this by restarting the REST server without that option.

You can also test using the curl command (with the option enabled) with a command like:

curl -X GET --header 'x-api-key: iplockchain' 'http://localhost:3000/api/models.participantModel.certificateHolder'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM