kutuluk / loglevel-plugin-remote

A loglevel plugin for sending browser logs to a server
MIT License
102 stars 36 forks source link

Authorization token #11

Closed jonattfin closed 6 years ago

jonattfin commented 6 years ago

Hello,

I've done an commit last week with the authorization token :-). I've set it in a specific way so that the user can add the token how he want's it... so can be ... const authorization = Bearer ${options.token};

but also const authorization = JwtToken ${options.token};

I want to be able to format what i send in the authorization token, and not be fixed to Bearer token. Can you do this fix?

Something like const authorization = ${options.token}; and i decide if it's bearer / JwtToken, whatsoever..

jonattfin commented 6 years ago

Maybe it could be something like ${options.tokenName} ${options.token}, and i can send whatever i want

kutuluk commented 6 years ago

https://jwt.io/introduction/

Whenever the user wants to access a protected route or resource, the user agent should send the JWT, typically in the Authorization header using the Bearer schema. The content of the header should look like the following:

Authorization: Bearer <token>

Bearer is not a type of token, it is a type of autotification scheme and it is de facto standard for token authentication.

It's very easy to add an additional option for specifying an authentication scheme, but since there is a standard scheme for this, I do not want to do this.

You most likely need to properly configure the server side to accept the standard authentication scheme.

kutuluk commented 6 years ago

Did you manage to solve this problem?