Oct 29 2020 09:08 AM - last edited on Feb 01 2021 04:20 PM by Eric Starker
Planning to design a simple azure function for multiple clients.
each client will have a separate function key.
In Serverless Function, I want to write a custom security check ( extra layer), to ensure that key is passed from desired tenant or client only. Hence I want to check, Key name of the value being passed while calling the function.
Function Name : SecureFunction
Authentication : Function level Security
Client1 : Key1
Client2 : Key2
User Calls SecureFunction with Key2 ( using x-functions-key header) : I want to derive the keyname of passd key
Expected output is Client2
Oct 29 2020 09:22 AM
@Bhargav1985 One thing to think about is API management - it's designed to do exactly what you're outlining: Create subscriptions in Azure API Management | Microsoft Docs
You can have 'subscriptions' created for each customer and you would know who the caller is and what they're allowed to do based on the passed in key. I think it would be easier to have this managed by a product that performs these tasks versus needing to maintain this look-up table in code.
Nov 05 2020 01:28 AM
@CloudyRyan : I tried APIM Subscriptions. But concept is same, it passes the key in header as Ocp-Apim-Subscription-Key.
As it's in header, I can just get the value. To identify the key Name, I need to have the lookup.
Correct me if I have misunderstood the concept.
My requirement is identify the product based on the key value.
Nov 05 2020 05:01 AM