title: Loopback 4 authorization provider not working
body: <p>I have a custom authentication strategy in my loopback 4 application. Now for authorization, I need to access the token which contains user details. I have created a very basic authorization provider but the problem is this provider is not getting called. Even the console.logs in the authorization provider are not getting displayed. I have also binded this provider in application.ts.</p>
  <p>Here is my code.</p>
  <p>Thank you in advance</p>
  <p>authorize.ts</p>
  <pre><code>import { AuthorizationContext, AuthorizationDecision, AuthorizationMetadata, Authorizer } from '@loopback/authorization';
  import { inject, Provider } from '@loopback/core';
  import { RestBindings, Request } from '@loopback/rest';
  
  export class MyAuthorizationProvider implements Provider&lt;Authorizer&gt; {
    constructor(@inject(RestBindings.Http.REQUEST) private req: Request) { }
  
    /**
     * @returns authenticateFn
     */
    value(): Authorizer {
      return this.authorize.bind(this);
    }
  
    async authorize(
      authorizationCtx: AuthorizationContext,
      metadata: AuthorizationMetadata,
    ) {
      console.log('authorize') // not getting displyed
      console.log(this.req.headers.authorization) // not getting displyed
      if (true) {
        console.log(true) //not getting displyed
      }
      else {
        console.log(false) //not getting displyed
      }
  
      return AuthorizationDecision.ALLOW;
  
    }
  }
  </code></pre>
  <p>controller</p>
  <pre><code>@authenticate('firebase')
    @authorize({ allowedRoles: ['retailers'] })
  
    @get('url')
  </code></pre>
  <p>application.ts</p>
  <pre><code>let app = new Application();
  
      const authOptions: AuthorizationOptions = {
        precedence: AuthorizationDecision.DENY,
        defaultDecision: AuthorizationDecision.DENY,
      };
  
      const binding = app.component(AuthorizationComponent);
      app.configure(binding.key).to(authOptions);
  
      app
        .bind('authorizationProviders.my-authorizer-provider')
        .toProvider(MyAuthorizationProvider)
        .tag(AuthorizationTags.AUTHORIZER);
  </code></pre>