What is the best approach for handling multiple security schemes in a Mule stream using RAML?

I am creating a webservice API using RAML.

I created RAML with two security schemes

  • OAuth 2.0
  • Custom

My first approach was to process authorization based on the request parameter, in which I sent a special parameter inside my request, and then delegated the authorization task to one of the authorization mechanisms. But this did not work, when the request was sent to the OAuth server, it quit Null Pointer Exception.
Then I found out that the authorization request for another authorization scheme must have different URIs, for example. if an oAuth request is made, should the URI be like / api / oauth 2 / authorize? parameters, but for another scheme they say that oauth 1.0 can be / api / oauth 1 / authorize? parameters

To implement this, I added two APIkit router threads with different URI patterns.

enter image description here

APIKit , OAuth. , OAuth APIkit .

, OAuth , ? OAuth , OAuth . - , OAuth , , , OAuth APIKit. .

.

+4
1

, http://security-update-site-1.4.s3.amazonaws.com

OAuth , API access_token . OAuth , , bebore . , .

-1

Source: https://habr.com/ru/post/1620504/


All Articles