This is the authorization header need to invoke my REST api...
Authorization: MyAuth JWT:SIGNATURE
... where JWT is a Json Web Token containing standard claims as well as custom claims (e.g. encrypted API key) and SIGNATURE is a HmacSHA1 digest generated by the client (i.e. swagger-ui). Then, the server extracts the encrypted api key from the JWT, decrypts it with the application secret and recalculates the SIGNATURE by concatenating the JWT, HTTP method, URL, and request body. If the SIGNATURE calculated by the server corresponds to the SIGNATURE sent by the client, then the request is valid, otherwise it is rejected.
That said, I'm reading the Swagger specification... and it is not clear to me how should I document my authorization scheme:
@Api(
value = "/auth/users",
description = "Register users and manage their accounts",
authorizations = Array(
new Authorization(
value = "MyAuth",
// what should I put here?
)
)
)
How do I correctly describe my authorization scheme?
Tx,
j3d