Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any Example for Basic Authentication #48

Open
Erickud opened this issue Nov 5, 2018 · 0 comments
Open

Any Example for Basic Authentication #48

Erickud opened this issue Nov 5, 2018 · 0 comments

Comments

@Erickud
Copy link

Erickud commented Nov 5, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant