Skip to content

Any Example for Basic Authentication #48

@Erickud

Description

@Erickud

Hello,

I search a Example how we can setup the request authorization.
I think that is in authorizationChecker, but if I thow HttpQueryError that generate a error in output that doesn't send the error code and header.
I have extend the class HttpQueryError to setup default value.

class AuthenticationError extends HttpQueryError {

   constructor(
      statusCode?: number,
      message?: string,
      isGraphQLError: boolean = false,
      headers?: { [key: string]: string }
   ) {
      super(statusCode||401, message||"Access denied", isGraphQLError, headers || {
         'WWW-Authenticate': 'Basic realm="Test Eri"'
      });
   }
}

Regards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions