moleculerjs / moleculer-web

:earth_africa: Official API Gateway service for Moleculer framework
http://moleculer.services/docs/moleculer-web.html
MIT License
291 stars 118 forks source link

Authorization adapters #238

Open intech opened 3 years ago

intech commented 3 years ago

Add sugar to the moleculer-web, the authorize option in the settings, example:

authorize: {
  type: "bearer", // add social and other adapters
  checkToken: "user.resolveToken"
}
authorize: {
  type: "query", // from url query params or header
  param: "token",
  checkToken: "user.resolveToken"
}

and through the function who needs a custom solution, example:

authorize: (ctx, route, req) => {},

Thus, it will be possible to make a semblance of an authorization adapter and use the modules.

Write your wishes in this issue! :speech_balloon:

icebob commented 3 years ago

good idea 👍