Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Mind_Taker
May 7, 2007



I have an Azure question, but I figure it'd be appropriate to ask here since I didn't see an Azure thread and it's more of a general question than Azure-specific.

My company that I just started working at has various client systems that need to securely access an API we are being tasked to write. One of the first things we want to do is introduce OAuth2 with client credentials flow in order to secure our APIs going forward. Currently our APIs are accessed via API keys, which has been deemed a security risk.

Provided we implement OAuth2 is there any downside to configuring Azure to be the authentication provider with the client credentials flow?

We would register the API and clients in Azure and assign roles/permissions to the clients and generate a secret key for each client. Our clients would then authenticate in Azure with their secret key and use the access tokens provided by Azure to make requests to the API according to their roles as defined in Azure.

My boss is concerned with this approach because "it could introduce a tight coupling between Azure and the client applications" but I don't really know what that means. Especially since the API and the resources/databases will also be deployed to Azure. One alternative he suggested was that we write our own authentication service/API but I really don't want to re-invent the wheel (and do a worse job of it) and I also don't want to waste time since we have a lot of projects we'll be working on in the near future.

Does anyone know what my boss could mean by this "tight coupling phrase? And does the approach I outlined make sense or are there downsides with it (big or small)?

Mind_Taker fucked around with this message at 04:43 on Oct 21, 2023

Adbot
ADBOT LOVES YOU

Mind_Taker
May 7, 2007



Obfuscation posted:

Yeah I'd like to hear more about why api keys are bad

The reason given to us was that API keys are passed with every call and while the keys are still encrypted our security team would prefer us to adopt OAuth2 because the tokens expire after a short duration while API keys are valid indefinitely.

I'm no security expert but it sounded reasonable enough to me at the time, however I'd like to hear why OAuth2 wouldn't be necessary in our case.

Mind_Taker
May 7, 2007



CarForumPoster posted:

Because it hampers adoption of your new API as your customers need to do more work to use your API. Meanwhile if you rely on a 3rd party auth provider, if any chain in that auth link gets broken, which literally happened to me yesterday with a thing talking to the MS Graph API, the client secret for the application expired after 2 years so we couldnt get new tokens, then your whole poo poo gets hosed up. Also if they go down, your whole poo poo gets hosed up.

Security is super important, but API keys versus a more complicated auth system is one of those things that directly trades something for something else, whether the balance of that trade is worth it depends on your application. If I made a product a lot of junior developers would be accessing (anything that isnt exclusively sold to enterprises) I'd stick with API keys.

That said, if a company gets thoroughly databreached, the API keys might never get rotated and that has whatever negative effects that might have.

Yeah this all makes sense. I think the decision has already been made to move to OAuth2 before I started my position but I'll at least convey some of the downsides.

Mind_Taker
May 7, 2007



It's a bad question but if it's multiple choice I'd say 0 red triangles because it's only drawing rectangles

Mind_Taker fucked around with this message at 21:42 on Mar 13, 2024

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply