TheSinding / authentication-api-key

FeathersJS API Key authentication
14 stars 3 forks source link

Static Key(s) as array? #1

Open corepay opened 4 years ago

corepay commented 4 years ago

Hello thank you - this saved my hours and errors

Couple questions...

1. Can I use this for multiple header api keys? For example, I have an x-api-key for my applications service...would like to also have an x-developer-key that checks my developers service.

  1. extending question 1... Can I also use the 'static' set api-key method in addition to the lookup method? If so, can you make this an array lookup? For example, I have several server to server connections and I want to provide those an x-server-key header option.

IRL scenario if this helps:

Again, thank you for your time here and sharing.

corepay commented 4 years ago

Hi, yes I got it working, simple actually no changes other than putting in missing the key-names into the authstrategy object. My bad...but this is real good.

So - all that's left is it possible for you to do an update allowing an array of keys in static?

TheSinding commented 4 years ago

Is there any reason, you can't set it up with the service method? Just add a field in the service, which indicates whether or not it is a developer key?

corepay commented 4 years ago

Is there any reason, you can't set it up with the service method? Just add a field in the service, which indicates whether or not it is a developer key?

Hello, back on this...

To answer your question - I want to use the static key as an array for system administrators. they get issued their own 'x-master-key' that is stored in an array - these admins may or may not be setup as users key bypasses all jwt user login authentication in addition to some required relationships I have when creating or querying users.