Forum Discussion
SaaS app integration
Well, it's not what I was hoping for but I solved it this way:
1. I added to the front end an api key generator. It allows an App Admin to generate an api key and assign it to a given user. I stick the key in the control database (non tenant) with an expiration date (default 30 days).
2. I then added an authentication scheme to my asp.net core 2.1 backend in addition to the Azure AD JWT Auth. It searches the database for a matching, unexpired key and completes the authentication setting the standard tenant id claim (same as what Azure AD does). My controller base class uses this to ensure it's talking to the correct database (the app is multi-tenant with a database per tenant).
3. I thought I would be able to access my query controllers (OData) from Excel/PowerBI with this api key auth, but it kept erroring out [I could find no good examples of anyone actually authenticating to an OData service from Power BI]. So, I extended the api key auth slightly to do Basic Auth as well. That works.
4. Now, Excel and Power BI can connect to an OData service successfully with Basic Auth using name: ApiKey, pwd: [generated ApiKey]
I hope this helps. If anyone wants to jump in with better ideas I'm all ears.
Kyle Reed