1

I couldn't find information on how other people solve this, so maybe you can help me out.

What I have

Multiple Services with REST APIs, that are secured using OpenID Connect. Connections between the Services work fine. Now I have multiple developers, who sometimes need to write and execute local scripts (Python, R, Bash etc.) for quick analysis and testing.

What I want

I want to enable the developers to use the services as easy as possible, but still respecting security concerns.

What I tried

I defined the script itself as a client. Therefore I created a public client in my OIDC product, which is called somewhat like 'developer-scripts'. Using a library which handles the oauth dance, I can then execute the script connecting as aforesaid client. First time, the browser pops up and requests the user to authenticate and therefore authorize the client to use the REST API on behalf of the user. After that, the tokens are cached and I can easily continue working on that script.

This simplified drawing tries to summarize, what I just described

That works perfectly fine and regarding security I'm glad that credentials are not saved on the local computers as it was before with e.g. Basic Authentication. Furthermore, I'm able to control the access to different services on a user level.

Other ideas, which didn't convince me:

  • every web service also has an public client which can then be used as a client by the scripts (so the scripts aren't defined as clients anymore)
  • token generation is done somewhere else and the developer just adds the generated access/refresh token to the script

My problem

What concerns me about my current solution is the definition of that client. In the described case it would be either a generic client used by all developers for all scripts, or a new client for every developer who want's to write a local script. The latter seems to be a lot of overhead, the former may be a security problem?

So finally I'm asking the question: Are there any known best practices for my described use case?



EDIT:
I found a small article by [Martin Fowler](https://martinfowler.com/articles/command-line-google.html), he is basically explaining, how he is receiving a token to use for a local script. But in his case, he's using it for one certain use case, and not as a general public client. So unfortunately it doesn't really contribute to my answer.
Chules
  • 426
  • 2
  • 8

0 Answers0