私はAuth0でSwaggerを使用しようとしています。 私は現在ApiFirstHandとSwagger-uiを使って私のAPIをテストしています。Auth0でSwaggerを使用する
このexample.yamlからは、getUserTodos
にはuser, admin:org, admin:public_key
のスコープが必要です。ここで
はsecurityDefinitionsです:
securityDefinitions:
internalOAuth:
type: oauth2
scopes:
user: Grants read/write access to profile info only.
admin:org: Fully manage organization, teams, and memberships.
admin:public_key: Fully manage public keys.
flow: implicit
# we use a single API here to issue token (for SwaggerUI)
authorizationUrl: http://localhost:9000/example/token
# and to validate it later
x-token-validation-url: http://localhost:9000/example/token
私の質問は、私が代わりにinternal0AuthのAuth0を使用したい場合はAuth0とexample.yamlの私securityDefinitionsに私のユーザーのメタデータがどうあるべきか、ですか? これに加えてSwagger-UIを使用することはできますか?
私は
でsecurityDefinitions:
auth0:
type: oauth2
scopes:
openid: Grants access to user_id.
read:task: Grants read access to task
flow: accessCode
authorizationUrl: https://test.eu.auth0.com/authorize
tokenUrl: https://test.eu.auth0.com/userinfo
x-token-validation-url: https://test.eu.auth0.com/userinfo
を試してみました
"user_metadata": {
"admin:org": true,
"admin:public_key": true,
"openid": true
}
routes
ファイルにconf
フォルダやコメントを解除ライン33にsecurity.api.yaml
を移動することによって、UT、私は、彼らが持っているように、このサース=> https://auth0.com/docs/api/authentication に見え意味していますある種の "accessCode"と "implicit"フローが流れますが、 "scope"という概念はSwaggerとAuth0の間では一致していないようです。 –私はAuth0を知らなかった、申し訳ありません。私が助ける最もよい方法は、api-firstアクティベータテンプレートで別の例を作成することです。 [こちら](https://github.com/zalando/play-swagger-service)の問題を作成してもよろしいですか? –