Gcp app engine flex endpoints openapi CORS
up vote
2
down vote
favorite
Having an error while trying to send OPTIONS to server.
The error:
{
"code": 7,
"message": "The service does not allow CORS traffic.",
"details": [
{
"@type": "type.googleapis.com/google.rpc.DebugInfo",
"stackEntries": ,
"detail": "service_control"
}
]
}
I get a normal response if I send GET request (throught postman).
The node server uses KOA.js with cors enabled
app.use(cors());
it works without endpoints, so I don't think there could be a problem in server.
app.yaml
runtime: nodejs
env: flex
env_variables:
NODE_ENV: "dev"
handlers:
- url: /
static_dir: /
http_headers:
Access-Control-Allow-Origin: '*'
endpoints_api_service:
name: ******.appspot.com
rollout_strategy: managed
openapi-appengine.yaml
swagger: "2.0"
info:
description: "A simple Google Cloud Endpoints API example."
title: "Endpoints Example"
version: "1.0.0"
host: "******.appspot.com"
x-google-endpoints:
- name: "******.appspot.com"
allowCors: "true"
x-google-allow: all
paths:
/api/user:
get:
operationId: "getcurrentuser"
produces:
- "application/json"
parameters:
responses:
200:
description: "successful operation"
schema:
type: "object"
security:
- firebase:
securityDefinitions:
firebase:
authorizationUrl: ""
flow: "implicit"
type: "oauth2"
x-google-issuer: "https://securetoken.google.com/******"
x-google-jwks_uri: "https://www.googleapis.com/service_accounts/v1/metadata/x509/securetoken@system.gserviceaccount.com"
x-google-audiences: "******,******"
add a comment |
up vote
2
down vote
favorite
Having an error while trying to send OPTIONS to server.
The error:
{
"code": 7,
"message": "The service does not allow CORS traffic.",
"details": [
{
"@type": "type.googleapis.com/google.rpc.DebugInfo",
"stackEntries": ,
"detail": "service_control"
}
]
}
I get a normal response if I send GET request (throught postman).
The node server uses KOA.js with cors enabled
app.use(cors());
it works without endpoints, so I don't think there could be a problem in server.
app.yaml
runtime: nodejs
env: flex
env_variables:
NODE_ENV: "dev"
handlers:
- url: /
static_dir: /
http_headers:
Access-Control-Allow-Origin: '*'
endpoints_api_service:
name: ******.appspot.com
rollout_strategy: managed
openapi-appengine.yaml
swagger: "2.0"
info:
description: "A simple Google Cloud Endpoints API example."
title: "Endpoints Example"
version: "1.0.0"
host: "******.appspot.com"
x-google-endpoints:
- name: "******.appspot.com"
allowCors: "true"
x-google-allow: all
paths:
/api/user:
get:
operationId: "getcurrentuser"
produces:
- "application/json"
parameters:
responses:
200:
description: "successful operation"
schema:
type: "object"
security:
- firebase:
securityDefinitions:
firebase:
authorizationUrl: ""
flow: "implicit"
type: "oauth2"
x-google-issuer: "https://securetoken.google.com/******"
x-google-jwks_uri: "https://www.googleapis.com/service_accounts/v1/metadata/x509/securetoken@system.gserviceaccount.com"
x-google-audiences: "******,******"
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
Having an error while trying to send OPTIONS to server.
The error:
{
"code": 7,
"message": "The service does not allow CORS traffic.",
"details": [
{
"@type": "type.googleapis.com/google.rpc.DebugInfo",
"stackEntries": ,
"detail": "service_control"
}
]
}
I get a normal response if I send GET request (throught postman).
The node server uses KOA.js with cors enabled
app.use(cors());
it works without endpoints, so I don't think there could be a problem in server.
app.yaml
runtime: nodejs
env: flex
env_variables:
NODE_ENV: "dev"
handlers:
- url: /
static_dir: /
http_headers:
Access-Control-Allow-Origin: '*'
endpoints_api_service:
name: ******.appspot.com
rollout_strategy: managed
openapi-appengine.yaml
swagger: "2.0"
info:
description: "A simple Google Cloud Endpoints API example."
title: "Endpoints Example"
version: "1.0.0"
host: "******.appspot.com"
x-google-endpoints:
- name: "******.appspot.com"
allowCors: "true"
x-google-allow: all
paths:
/api/user:
get:
operationId: "getcurrentuser"
produces:
- "application/json"
parameters:
responses:
200:
description: "successful operation"
schema:
type: "object"
security:
- firebase:
securityDefinitions:
firebase:
authorizationUrl: ""
flow: "implicit"
type: "oauth2"
x-google-issuer: "https://securetoken.google.com/******"
x-google-jwks_uri: "https://www.googleapis.com/service_accounts/v1/metadata/x509/securetoken@system.gserviceaccount.com"
x-google-audiences: "******,******"
Having an error while trying to send OPTIONS to server.
The error:
{
"code": 7,
"message": "The service does not allow CORS traffic.",
"details": [
{
"@type": "type.googleapis.com/google.rpc.DebugInfo",
"stackEntries": ,
"detail": "service_control"
}
]
}
I get a normal response if I send GET request (throught postman).
The node server uses KOA.js with cors enabled
app.use(cors());
it works without endpoints, so I don't think there could be a problem in server.
app.yaml
runtime: nodejs
env: flex
env_variables:
NODE_ENV: "dev"
handlers:
- url: /
static_dir: /
http_headers:
Access-Control-Allow-Origin: '*'
endpoints_api_service:
name: ******.appspot.com
rollout_strategy: managed
openapi-appengine.yaml
swagger: "2.0"
info:
description: "A simple Google Cloud Endpoints API example."
title: "Endpoints Example"
version: "1.0.0"
host: "******.appspot.com"
x-google-endpoints:
- name: "******.appspot.com"
allowCors: "true"
x-google-allow: all
paths:
/api/user:
get:
operationId: "getcurrentuser"
produces:
- "application/json"
parameters:
responses:
200:
description: "successful operation"
schema:
type: "object"
security:
- firebase:
securityDefinitions:
firebase:
authorizationUrl: ""
flow: "implicit"
type: "oauth2"
x-google-issuer: "https://securetoken.google.com/******"
x-google-jwks_uri: "https://www.googleapis.com/service_accounts/v1/metadata/x509/securetoken@system.gserviceaccount.com"
x-google-audiences: "******,******"
asked Nov 8 at 7:32
RaShe
81421636
81421636
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
What path did you use when sending OPTIONS? "/" or "/api/user"?
From your Swagger, you only setup "/api/user" path so OPTIONS only works for that path.
New contributor
Wayne Zhang is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Welcome to Stack Overflow. This is not an answer to the question but more of a comment. Please take a look at How to Answer to understand when to provide an answer and when to add a comment.
– Simply Ged
Nov 10 at 2:25
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
What path did you use when sending OPTIONS? "/" or "/api/user"?
From your Swagger, you only setup "/api/user" path so OPTIONS only works for that path.
New contributor
Wayne Zhang is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Welcome to Stack Overflow. This is not an answer to the question but more of a comment. Please take a look at How to Answer to understand when to provide an answer and when to add a comment.
– Simply Ged
Nov 10 at 2:25
add a comment |
up vote
0
down vote
What path did you use when sending OPTIONS? "/" or "/api/user"?
From your Swagger, you only setup "/api/user" path so OPTIONS only works for that path.
New contributor
Wayne Zhang is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Welcome to Stack Overflow. This is not an answer to the question but more of a comment. Please take a look at How to Answer to understand when to provide an answer and when to add a comment.
– Simply Ged
Nov 10 at 2:25
add a comment |
up vote
0
down vote
up vote
0
down vote
What path did you use when sending OPTIONS? "/" or "/api/user"?
From your Swagger, you only setup "/api/user" path so OPTIONS only works for that path.
New contributor
Wayne Zhang is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
What path did you use when sending OPTIONS? "/" or "/api/user"?
From your Swagger, you only setup "/api/user" path so OPTIONS only works for that path.
New contributor
Wayne Zhang is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Wayne Zhang is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
answered Nov 10 at 1:48
Wayne Zhang
1
1
New contributor
Wayne Zhang is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Wayne Zhang is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Wayne Zhang is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Welcome to Stack Overflow. This is not an answer to the question but more of a comment. Please take a look at How to Answer to understand when to provide an answer and when to add a comment.
– Simply Ged
Nov 10 at 2:25
add a comment |
Welcome to Stack Overflow. This is not an answer to the question but more of a comment. Please take a look at How to Answer to understand when to provide an answer and when to add a comment.
– Simply Ged
Nov 10 at 2:25
Welcome to Stack Overflow. This is not an answer to the question but more of a comment. Please take a look at How to Answer to understand when to provide an answer and when to add a comment.
– Simply Ged
Nov 10 at 2:25
Welcome to Stack Overflow. This is not an answer to the question but more of a comment. Please take a look at How to Answer to understand when to provide an answer and when to add a comment.
– Simply Ged
Nov 10 at 2:25
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53203153%2fgcp-app-engine-flex-endpoints-openapi-cors%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password