【发布时间】:2017-02-09 14:19:45
【问题描述】:
我尝试使用 security swagger 对象保护我的所有路径,使用 API 密钥可以正常工作,但我如何使用 auth0 或自定义身份验证来做到这一点?
security:
- api_key: []
securityDefinitions:
api_key:
type: "apiKey"
name: "key"
in: "query"
这不行
x-security:
- auth0_jwk:
audiences:
- "xxxxxxxxxxxxxxxx"
securityDefinitions:
auth0_jwk:
# Replace YOUR-ACCOUNT-NAME with your Auth0 account name.
authorizationUrl: "https://YOUR-ACCOUNT-NAME.auth0.com/authorize"
flow: "implicit"
type: "oauth2"
x-issuer: "https://YOUR-ACCOUNT-NAME.auth0.com/"
# Replace YOUR-ACCOUNT-NAME with your service account's email address.
x-jwks_uri: "https://YOUR-ACCOUNT-NAME.auth0.com/.well-known/jwks.json"
或者这个
security:
- auth0_jwk:[
"xxxxxxxxxxxxxxxx"
]
securityDefinitions:
auth0_jwk:
# Replace YOUR-ACCOUNT-NAME with your Auth0 account name.
authorizationUrl: "https://YOUR-ACCOUNT-NAME.auth0.com/authorize"
flow: "implicit"
type: "oauth2"
x-issuer: "https://YOUR-ACCOUNT-NAME.auth0.com/"
# Replace YOUR-ACCOUNT-NAME with your service account's email address.
x-jwks_uri: "https://YOUR-ACCOUNT-NAME.auth0.com/.well-known/jwks.json"
【问题讨论】:
标签: google-cloud-platform google-cloud-endpoints