问题描述
我正在编写 WSO2 API Manager 开发人员基础培训文档 (LabkitAPIM200DF.pdf).它可以从 https://github.com/wso2/下载WSO2-Training/releases/tag/APIM2.0.0DF,
我正在尝试在第 53 页中执行 Publisher API.我遵循了所有步骤,但出现了 Forbidden 错误.
1. 在 [APIM_HOME]/bin 文件夹中创建 payload.json 文件,内容如下并保存:
{ "callbackUrl": "www.google.lk", "clientName": "rest_api_publisher", "tokenScope": "Production", "owner": "admin", "grantType": "password refresh_token", "saasApp": true }
2.打开命令行界面.
3. 使用命令导航到 {APIM_HOME/bin] 文件夹.
4. 为客户端注册提供 cURL 命令.(确保 API 管理器服务器在执行此操作之前正在运行).
curl -X POST -H "Authorization: Basic YWRtaW46YWRtaW4=" -H "Content-Type: application/json" -d @payload.json http://localhost:9763/client-registration/v0.09/register <!-- ~ Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. ~ ~ WSO2 Inc. licenses this file to you under the Apache License, ~ Version 2.0 (the "License"); you may not use this file except ~ --> <html> <head> <title>Error 403</title> </head> <body> <h1>Error 403 - Forbidden</h1> </body> </html>
推荐答案
URL中的版本应该是v0.10
http://localhost:9763/client-registration/v0.10/register
问题描述
I am working on WSO2 API Manager Developer Fundamentals training doc(LabkitAPIM200DF.pdf). It can be download from https://github.com/wso2/WSO2-Training/releases/tag/APIM2.0.0DF,
Here I am trying to do Publisher API in page 53. I followed all steps but I am getting Forbidden error.
1. Create the payload.json file in the [APIM_HOME]/bin folder with the following text and save:
{ "callbackUrl": "www.google.lk", "clientName": "rest_api_publisher", "tokenScope": "Production", "owner": "admin", "grantType": "password refresh_token", "saasApp": true }
2. Open a Command Line Interface.
3. Navigate to the {APIM_HOME/bin] folder using the command.
4. Give the cURL command for client registration. (Make sure the API Manager Server is running before doing this).
curl -X POST -H "Authorization: Basic YWRtaW46YWRtaW4=" -H "Content-Type: application/json" -d @payload.json http://localhost:9763/client-registration/v0.09/register <!-- ~ Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. ~ ~ WSO2 Inc. licenses this file to you under the Apache License, ~ Version 2.0 (the "License"); you may not use this file except ~ --> <html> <head> <title>Error 403</title> </head> <body> <h1>Error 403 - Forbidden</h1> </body> </html>
推荐答案
Version in the URL should be v0.10
http://localhost:9763/client-registration/v0.10/register