Coding question: Federation Auth and API Tokens

Product: PowerShell Universal
Version: 5.5.5

Hello,
did anybody already work with SAML2 authentication and API access?

What I would like to do:
Create an executable, that:

  • calls PSU server and makes use of SAML2 authentication for the user
  • requests a token
  • calls PSU APIs using that token

The part I don’t know how to handle:
How to make use of Azure AD SAML2 auth, that most likely needs to take place in a browser, and then authenticated, call the PSU API to get a token.

Thanks
Michael