Bearer token from AzureAD

Is it possible to use scriptrunner to get a bearer token from AzureAD for authenticatinng user with a different system. This token will then be passed/used for creating a resource

What’s the “different system” in this case?

You could potentially create a REST call using SR. I’m just guessing (this is outside my area of expertise), but the relevant bit of Microsoft’s API documentation might be Azure IoT Central REST API auth | Microsoft Docs

Are you using Azure AD for your Jira IAM?

we have an home grown system that maintains our environments. So basically a scripted picklist that will show all the environments. this picklist will be be populated via rest api call and this is where the bearer token will be used for authentication.

So is the goal to only show the environments to which the current user has access? Or to let them click through from that list and be automatically authenticated to the target environment?

If I’m understanding/guessing correctly (and I may not be), it seems like Azure SSO would be the better solution rather than trying to grab a token from Jira. I’m not even sure you could because authentication has to happen at some stage… so let’s say you have a link/button you click to access that other environment and access it, the user has to first be authenticated before the bearer token can be retrieved.

Since authentication has to happen anyways, putting it at the point of the click feels sub-optimal to me (and potentially impossible, and if possible then potentially insecure). I’d be looking to implement SSO.