Copy to ClipboardCopied!Toggle word wrapToggle overflow
Here we have setup two security definitions
OAuth2 - with implicit authorization with the provided url
Api Key - using an api key that comes from HTTP header named myHeader
Then you need to specify on the rest operations which security to use by referring to their key (petstore_auth or api_key).
.get("/{id}/{date}").description("Find user by id and date").outType(User.class)
.security("api_key")
...
.put().description("Updates or create a user").type(User.class)
.security("petstore_auth", "write:pets,read:pets")
.get("/{id}/{date}").description("Find user by id and date").outType(User.class)
.security("api_key")
...
.put().description("Updates or create a user").type(User.class)
.security("petstore_auth", "write:pets,read:pets")
Copy to ClipboardCopied!Toggle word wrapToggle overflow
Here the get operation is using the Api Key security and the put operation is using OAuth security with permitted scopes of read and write pets.
Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar. Explore nuestras recientes actualizaciones.
Hacer que el código abierto sea más inclusivo
Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.
Acerca de Red Hat
Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.